OG T
d0f09705e5
fix(auto-repair): 修復三個阻礙自動修復的根本原因
...
CD Pipeline / build-and-deploy (push) Has been cancelled
1. playbook_rag: Ollama embedding http_client 滾動重啟後 is_closed
- 新增 _get_http_client() 偵測 is_closed 自動重建
- singleton get_playbook_rag_service() 加 is_closed 重建判斷
2. telegram: 加入 ai_model 欄位顯示底層判斷模型
- TelegramMessage.ai_model 欄位
- format() / format_with_nemotron() 顯示 "Nemotron (nemotron-70b)"
- openclaw proposal_dict 加入 model 欄位
- decision_manager / send_approval_card 串接
3. DB: 清除 9 筆 3/26 殭屍 PENDING (mock_fallback CRITICAL 測試記錄)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-04 11:46:25 +08:00
OG T
b6105b8214
fix(ai): 首席架構師審查修復 C1+C2 (Phase 24 C)
...
C1 — telegram_gateway.py Fail-Closed 白名單:
白名單為空時 'if whitelist and ...' 為 False → 任何人可執行 /ai
修復: 'if not whitelist or user_id not in whitelist' Fail-Closed
加入 whitelist_empty 欄位到 warning log
C2 — openclaw.py list comprehension await 語法錯誤:
Python 3.11 不支援 list comprehension 中使用 await
'if not await is_provider_disabled(p)' → SyntaxError
修復: 改為 for loop 明確 await
I4: 靜默 except 改為 logger.warning
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-03 00:42:02 +08:00
OG T
dbe71f82e3
feat(ai): Phase 24 C — Telegram /ai 動態控制 + Redis 狀態管理
...
CD Pipeline / build-and-deploy (push) Has been cancelled
新增 ai_control.py:
- /ai status: 所有 Provider 狀態 + 路由模式
- /ai router on/off: 動態切換 AIRouter (覆蓋 env var)
- /ai primary <provider>: 設定主要 Provider
- /ai enable/disable <provider>: 控制 Provider 啟停
- /ai cost: 費用統計
- 白名單: OPENCLAW_TG_USER_WHITELIST 保護
telegram_gateway.py:
- _handle_chat_message 加入 /ai 指令攔截路由
- 白名單未授權返回警告
openclaw.py:
- Redis 狀態覆蓋 env USE_AI_ROUTER (/ai router on/off 生效)
- Redis primary_provider 覆蓋路由決策 (/ai primary 生效)
- Redis disabled provider 過濾 (/ai disable 生效)
Redis Keys:
ai:control:use_router
ai:control:primary_provider
ai:control:disabled:<provider>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-03 00:34:14 +08:00
OG T
b4b3a457c5
refactor(openclaw): Phase 24 B4 — 封存舊 fallback Provider 方法
...
CD Pipeline / build-and-deploy (push) Has been cancelled
[ARCHIVED] _call_ollama / _call_gemini / _call_claude
- 這三個方法為 USE_AI_ROUTER=false 回滾保留路徑
- 新路徑: USE_AI_ROUTER=true → AIRouterExecutor (ai_router.py)
- 新 Provider: ai_providers/ollama.py / gemini.py / claude.py
- 封存而非刪除: 完整移除等 Phase 24 全驗收後 (ADR-052 D11)
R3 觀察結果 (通過 ✅ ):
- openclaw_nemo provider: 12/12 incidents 全部正確路由
- 信心度: 0.8~0.9 正常
- USE_AI_ROUTER=true 生效確認
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-03 00:29:56 +08:00
OG T
5a8aae89c4
fix(phase24): 首席架構師 Review C1/C2/C3/I4 修復
...
CD Pipeline / build-and-deploy (push) Successful in 7m12s
E2E Health Check / e2e-health (push) Successful in 18s
C1 (P0): AIRouterExecutor.execute() 補 Langfuse Trace (D5)
- 建立 langfuse_trace("ai_router_execute") 包住整個執行鏈
- 成功時記錄 generation (model/input/output/tokens/cost)
- prod 所有 AI 呼叫現在有 LLMOps 追蹤
C2 (P0): 絞殺者改為呼叫 AIRouter.route() 智慧路由
- 先取得 RoutingDecision (意圖分類 + 複雜度評分)
- provider_order 從 selected_provider + fallback_chain 動態生成
- D1 意圖路由矩陣、D7 隱私保護 (DIAGNOSE 強制 local) 生效
C3 (P1): 型別標注 typo 修復
- AIProviderEnumEnum → AIProviderEnum
- AIProviderEnumProtocol → AIProviderProtocol
I4 (P1): interfaces.py AIProvider Protocol 補 close() 定義
S1: ai_router.py 模組版本標頭更新至 v4.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-02 21:47:06 +08:00
OG T
73e8f8ab77
feat(ai): Phase 24-A+B1 — AI Provider Registry + 絞殺者包裝 (ADR-052)
...
E2E Health Check / e2e-health (push) Successful in 16s
CD Pipeline / build-and-deploy (push) Has been cancelled
Brain Layer 雙軌 Registry 架構:
- 新建 src/services/ai_providers/ 目錄 (interfaces + 4 providers)
- OllamaProvider (local, rca/chat/code_review)
- GeminiProvider (cloud, rca/chat)
- ClaudeProvider (cloud, rca/chat/code_review)
- OpenClawNemoProvider (cloud, rca — 委派 188→NIM)
- 擴展 ai_router.py 加入:
- AIProviderRegistry (動態註冊/啟停)
- AIRouterExecutor (Cache + 閘門 CB/RL/Sem + 執行)
- openclaw.py 絞殺者包裝: USE_AI_ROUTER=true 走新路徑
- config.py + ConfigMap 加入 USE_AI_ROUTER=false (安全預設)
- ADR-052 正式文件 (14 項決策 D1-D14)
- HARD_RULES v1.7 加入 AI Router 規範
安全: USE_AI_ROUTER=false 預設不啟用,需手動開啟觀察
回滾: kubectl set env deployment/awoooi-api USE_AI_ROUTER=false
2026-04-02 ogt: Phase 24 首批實作
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 13:16:09 +08:00
OG T
88051388d4
fix(ai): 修復 _call_openclaw_analyze datetime 序列化失敗 → fallback Gemini
...
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled
signals dict 內含 datetime 物件,httpx json= 無法序列化
加入 _to_serializable 遞迴轉換,datetime → str
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-01 22:37:04 +08:00
OG T
5809d3e336
feat(ai): 委派 Incident RCA 給 OpenClaw (Nemo) — 架構鐵律修正
...
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
架構鐵律: OpenClaw = AI 大腦,AWOOOI API 透過 HTTP 委派仲裁
修改:
- openclaw.py: 加入 _call_openclaw_analyze(),在 LLM fallback 前先呼叫 OpenClaw
- 04-configmap.yaml: OPENCLAW_URL 修正為 :8088 (新容器 port)
- AI_FALLBACK_ORDER 改為 ["ollama","claude"] (移除 Gemini 付費 API)
OpenClaw /api/v1/analyze/incident → qwen2.5:7b 本機 Ollama (Nemo)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-01 21:11:30 +08:00
OG T
eccf61fbc9
fix(ai): 修復假信心度 + 解除 Shadow Mode (Phase 22 P1)
...
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled
1. openclaw.py: LLM 截斷時 confidence 0.82→0.0 (禁止偽造信心度)
2. prompts.py: NEMOTRON schema 範例值改用佔位符,防模型照抄 0.75
3. configmap: SHADOW_MODE_ENABLED=false,開放 low 風險自動執行
條件門檻: confidence≥90% + trust_score≥5 + playbook_success≥95%
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-01 15:59:42 +08:00
OG T
cc6b18e3bc
fix(phase22): 修復 Telegram 對話三個 Bug (ADR-044)
...
E2E Health Check / e2e-health (push) Successful in 18s
P0: security_interceptor.py 新增 intercept_telegram() 方法
- 修復 _handle_chat_message 的 AttributeError (致命 Bug)
- 白名單驗證,不需要 Nonce (對話訊息 vs 按鈕回調)
P1: nvidia_provider.py chat() 新增 use_json_mode 參數
- 對話場景預設 False (自然語言回應)
- RCA/分析場景傳入 True (結構化 JSON 輸出)
- openclaw.py RCA 呼叫加上 use_json_mode=True
P2: K8s ConfigMap 啟用 TELEGRAM_ENABLE_POLLING=true
- K8s AWOOOI API 接管 @tsenyangbot Long Polling
- OpenClaw (188) 停止 Telegram,改為純 REST 服務
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-31 21:53:09 +08:00
OG T
dd526684ab
feat(ai): Phase 22 OpenClaw + Nemotron 協作架構 (ADR-044)
...
E2E Health Check / e2e-health (push) Successful in 17s
統帥批准實作「仲裁-執行分工」架構:
- OpenClaw = 仲裁者 (Why + Risk Level)
- Nemotron = 執行者 (How + kubectl Command)
新增功能:
- config.py: ENABLE_NEMOTRON_COLLABORATION Feature Flag
- openclaw.py: generate_incident_proposal_with_tools()
- openclaw.py: _call_nemotron_tools() Nemotron 呼叫
- telegram_gateway.py: TelegramMessage Nemotron 欄位
- telegram_gateway.py: format_with_nemotron() 雙區塊格式
- decision_manager.py: 整合協作方法
- proposal_service.py: 整合協作方法
觸發條件:
- LOW 風險 → 僅 OpenClaw
- MEDIUM/HIGH/CRITICAL → OpenClaw + Nemotron 雙軌
首席架構師審查: 83/100 條件通過
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-31 18:52:53 +08:00
OG T
d03668669b
fix(openclaw): optimize for Nemo-4B with lightweight prompt and resilient parsing
E2E Health Check / e2e-health (push) Successful in 26s
2026-03-31 15:59:58 +08:00
OG T
3562a67a58
fix(openclaw): robust JSON repair for small LLM responses
E2E Health Check / e2e-health (push) Successful in 19s
2026-03-31 15:04:39 +08:00
OG T
27a0cd0af4
fix(openclaw): aggressive prompt truncation to fit Nemo 4K limit and avoid output corruption
E2E Health Check / e2e-health (push) Successful in 19s
2026-03-31 15:02:57 +08:00
OG T
46843c8e19
fix(nvidia): revert to nemotron-mini, truncate context for 4K limit, enforce precise confidence
E2E Health Check / e2e-health (push) Successful in 17s
2026-03-31 13:57:10 +08:00
OG T
8d70df3ea2
fix(ai): NVIDIA 加入 Rate Limiter 檢查
...
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled
2026-03-30 ogt: 修復 AI 仲裁降級問題
問題: NVIDIA RPM=5 限制未在 fallback 檢查
修正: 加入 nvidia 到 rate_limiter 檢查清單
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-30 01:18:11 +08:00
OG T
04bfff9d19
refactor(ai): 模組化重構 - NVIDIA chat 移至 NvidiaProvider
...
符合 feedback_lewooogo_modular_enforcement.md 規範:
- 移除 openclaw.py 中的 _call_nvidia() (重複邏輯)
- 新增 NvidiaProvider.chat() 方法
- 更新 INvidiaProvider Protocol
- openclaw.py 改用 get_nvidia_provider().chat()
- 測試移至 test_nvidia_chat.py
架構層次:
- Router → Service → Provider (正確)
- 禁止 Service 層重複實作已存在的 Provider 功能
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 20:49:23 +08:00
OG T
1df21dcd07
fix(ai): P0/P1 修復 NVIDIA RCA 整合
...
修復項目:
- P1-1: 從 ModelRegistry 取得模型 (非 hardcoded)
- P1-2: models.json 新增 nvidia.rca 模型定義
- P0: 新增 test_openclaw_nvidia.py 測試
首席架構師審查 74/120 → 預期 85+
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 20:33:10 +08:00
OG T
79134fb019
feat(ai): 新增 NVIDIA Nemotron 到告警 Fallback Chain
...
- 新增 _call_nvidia() 一般告警支援 (非 Tool Calling)
- Fallback 順序: Gemini → Nvidia → Ollama → Claude
- Nvidia 免費 tier ($0),含 Token 追蹤
解決: Gemini 超限 (500/500) 後無法 fallback 問題
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 20:28:24 +08:00
OG T
938df7f291
fix(api): 全面清除假信心分數 - 遵循 feedback_confidence_truthfulness.md
...
🔴 違規修正: 規則匹配/Expert System 不是 AI 分析,confidence 必須 = 0.0
修正檔案:
- agents/action_planner.py: 0.9 → 0.0
- agents/blast_radius.py: 0.85/0.5/0.9 → 0.0
- agents/security.py: 計算公式 → 0.0
- signoz_webhook.py: 0.7 → 0.0
- auto_approve.py: default 0.5 → 0.0
- ci_auto_repair.py: 整個計算函數 → return 0.0
- error_analyzer_service.py: default 0.5 → 0.0
- intent_classifier.py: 計算公式 → 0.0
- openclaw.py: default 0.5 → 0.0
- resource_resolver.py: 0.8 → 0.0
- k8s_naming.py: 0.9/0.7 → 0.0
只有 LLM 真實分析返回的 confidence 才能 > 0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 16:00:46 +08:00
OG T
d89f0520f9
fix(api): 修復 34 個 Ruff lint 錯誤
...
- 自動修復 import 排序、unused imports
- 手動修復 raise from、isinstance union、unused variable
- scripts/ 暫時保留 (非 CI 阻擋)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 15:27:49 +08:00
OG T
5f9a6a7e55
fix(ai): 移除假信心分數 + 顯示 AI 模型來源
...
問題: AI 仲裁顯示硬編碼信心分數 (0.75/0.88/0.92/0.70)
修復:
- decision_manager: 預設 confidence 0.75 → 0.0
- decision_manager: Expert System confidence=0.0 + is_rule_based
- openclaw: 所有 Mock Response confidence → 0.0
- telegram_gateway: 新增 ai_provider 欄位
- telegram_gateway: 動態來源標籤 (Ollama/Gemini/Claude/規則匹配)
Telegram 卡片顯示:
- confidence > 0 + provider=ollama → 🤖 Ollama 仲裁
- confidence > 0 + provider=gemini → 🤖 Gemini 仲裁
- confidence > 0 + provider=claude → 🤖 Claude 仲裁
- confidence == 0 → ⚙️ 規則匹配
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 15:19:51 +08:00
OG T
7c905c4bf3
fix(ai): 修復 generate_incident_proposal tuple unpacking 錯誤
...
- _call_with_cache 返回 6 值 (含 ai_tokens/ai_cost)
- generate_incident_proposal 解包只取 4 值導致 ValueError
- 修復: 完整解包 6 值並傳遞 ai_tokens/ai_cost 到 proposal_dict
2026-03-29 ogt: Token/Cost 追蹤補遺
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 00:03:22 +08:00
OG T
c76a10ad6e
feat(ai): $5 USD 成本上限 + 自動切換 Ollama (2026-03-29 ogt)
...
統帥要求:
1. 累積成本超過 $5 USD → 自動停用 Gemini,切換回 Ollama
2. 發送 Telegram 告警通知統帥
3. $4 USD 時發送警告
實作:
- ai_rate_limiter.py: 新增 COST_LIMITS, record_cost(), reset_cost()
- openclaw.py: 每次成功呼叫後記錄成本
- 成本存入 Redis (不過期,手動重置)
- 重置指令: redis-cli DEL ai_rate:total_cost:gemini
API 端點: GET /api/v1/health/ai-usage
- 顯示 total_cost_usd.current/limit/remaining
- 顯示 cost_exceeded: true/false
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-28 22:34:51 +08:00
OG T
d469a239af
fix(ai): 移除 confidence 預設值,強制 LLM 真實計算
...
變更:
1. models/ai.py: confidence 改為 REQUIRED (移除 default=0.8)
2. openclaw.py: 如果 LLM 沒輸出 confidence,設為 0.5 + COLLAB
根本原因:
- 原本 Pydantic default=0.8 導致信心分數永遠是 80%
- 現在強制 LLM 必須計算真實信心分數
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-28 22:21:29 +08:00
OG T
984d31de0c
feat(ai): Gemini 優先 + Token/Cost 追蹤 (2026-03-29 ogt)
...
變更:
1. ConfigMap: Gemini 優先 ["gemini","ollama","claude"]
2. openclaw.py: 捕獲 Gemini usageMetadata (tokens/cost)
3. webhooks.py: 傳遞 ai_tokens/ai_cost 到 Telegram
4. telegram_gateway.py: 顯示 💰 Tokens: X / $Y.YYYY
Gemini 1.5 Flash 定價:
- Input: $0.075/1M tokens
- Output: $0.30/1M tokens
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-28 22:18:24 +08:00
OG T
60e9538889
feat(api): ADR-030 Phase 2 診斷資料收集強化
...
實作智能自動修復系統的資料收集層:
1. k8s_diagnostics.py - K8s 診斷服務
- Pod Events/Logs/ResourceUsage 收集
- CrashLoopBackOff/OOM/ImagePull 偵測
- 非同步並行收集 + 錯誤容忍
2. diagnosis_aggregator.py - 診斷聚合器
- 整合 K8s + SignOz + Expert Rules
- DiagnosisContext 提供結構化 LLM Prompt
- DiagnosisSignal 信號分析
3. decision_manager.py - 決策引擎整合
- Step 2.5 加入診斷收集
- 傳遞 diagnosis_context 給 LLM
4. openclaw.py - LLM Prompt 增強
- 整合 K8s/SignOz 深度診斷上下文
- 支援 diagnosis_signals 摘要
ADR-030 架構: 診斷先行,根因分析,非盲目重啟
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 21:55:50 +08:00
OG T
d148756b67
feat(api): LLM 整合 Expert System 診斷上下文
...
長期方案實作: Expert 診斷 + LLM 智能分析
變更:
1. decision_manager._dual_engine_analyze():
- 測試資源跳過 LLM (省錢)
- 傳遞 Expert 診斷上下文給 LLM
- LLM 失敗時根據診斷調整回應
2. openclaw.generate_incident_proposal():
- 新增 expert_context 參數
- Prompt 包含 Expert 診斷結果
- 引導 LLM 基於診斷做決策
流程:
Playbook → Expert診斷 → LLM(with context) → 智能建議
這是「先診斷根因,再決定行動」的正確實作
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 21:41:26 +08:00
OG T
bf32c4b1f2
feat(api): Phase 13.2 AI Rate Limiter + RAG 基礎設施 ( #84 )
...
Rate Limiter (防止 Gemini 用量暴衝):
- ai_rate_limiter.py: RPM/Daily/Token 三層閥值
- openclaw.py: 整合 rate limit 檢查,超限自動降級
- health.py: /health/ai-usage 監控端點
RAG Tool 基礎 (#84 進行中):
- embedding_service.py: Ollama embedding 封裝
- rag_service.py: Redis vector search 服務
閥值設定:
- Gemini: 10 RPM, 500/day, 100K tokens/day
- Claude: 5 RPM, 200/day, 50K tokens/day
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 15:52:57 +08:00
OG T
702e9a9634
fix(api): 移除未使用的 resource_resolver 導入
...
架構審查發現 get_resource_resolver 導入但未使用
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 12:43:59 +08:00
OG T
1cc34e1fc8
fix(api): Phase 18.1 修復 - Mock Response 正規化遺漏
...
問題: _generate_mock_response() 直接使用原始 target_resource,
導致 URL (如 https://api.awoooi.wooo.work ) 未正規化為有效 K8s 名稱
修復: 在 _generate_mock_response() 開頭加入 normalize_resource_name()
- 將 URL/域名轉換為有效 deployment 名稱
- 更新 namespace 為正確值 (awoooi-prod)
測試: E2E 驗證待部署後執行
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 12:07:16 +08:00
OG T
96c3ddd8c4
feat(api): Phase 18.1 K8s 資源名稱驗證 (ADR-016)
...
三層防禦架構確保 kubectl 指令有效:
1. Webhook 入口正規化 (webhooks.py)
2. OpenClaw 產生指令前驗證 (openclaw.py)
3. 靜態映射表 + 模糊匹配 (k8s_naming.py, resource_resolver.py)
新增:
- src/utils/k8s_naming.py: RFC 1123 正規化 + 靜態映射
- src/services/resource_resolver.py: MCP K8s Tool 動態驗證
- docs/adr/ADR-016-k8s-resource-naming.md: 契約文檔
- scripts/e2e_tool_call_verification.py: E2E 驗證腳本 v2.0
修改:
- webhooks.py: Phase 18.1.7 入口正規化
- openclaw.py: Phase 18.1.6 產生指令前驗證
- Skill 03 v1.4: 新增 K8s 資源驗證章節
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 11:22:47 +08:00
OG T
b6cff31653
feat(api): Phase 15.3 Deep Linking 三系統互連
...
實現 Sentry ↔ SignOz ↔ Langfuse 零斷鏈觀測:
新增 deep_linking.py:
- SignOz Trace URL 生成器
- Langfuse Trace URL 生成器
- Sentry Issue URL 生成器
- get_all_links() 統一取得所有連結
整合點:
- main.py: Sentry before_send 注入 otel_trace_id + signoz_trace_url
- langfuse_client.py: 自動注入 OTEL trace_id 到 metadata
- openclaw.py: SignOz span 記錄 langfuse.trace_id 反向連結
架構圖:
┌─────────┐ trace_id ┌─────────┐ trace_id ┌──────────┐
│ Sentry │◄────────►│ SignOz │◄────────►│ Langfuse │
│ Errors │ │ Traces │ │ LLMOps │
└─────────┘ └─────────┘ └──────────┘
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 00:48:28 +08:00
OG T
1ac8965a7a
feat(api): Phase 15.1 Langfuse LLMOps 整合 + 模型升級
...
## 新功能
- Langfuse 自建部署 (192.168.0.110:3100)
- langfuse_client.py - LLM 呼叫追蹤包裝
- OpenClaw 整合 Langfuse trace
## 模型升級 (統帥批准)
- 生產預設: llama3.2:3b → qwen2.5:7b-instruct
- 摘要任務: llama3.2:3b (速度優先)
## 配置更新
- requirements.txt: +langfuse>=2.0.0
- config.py: +LANGFUSE_* 設定
- models.json: 更新 Ollama 模型配置
- K8s: Secret + ConfigMap 更新
## 審查通過
- 模組化檢查 ✅
- 核心測試 31/31 ✅
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 00:32:19 +08:00
OG T
749b8bc554
fix(api): 修復時區 import 排序與未使用變數 lint 錯誤
...
- 修正 import 順序 (standard → third-party → local)
- 修復 datetime/timedelta 未定義錯誤
- 移除未使用的 imports
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 09:26:58 +08:00
OG T
2a2dac865a
feat(api): 統一使用台北時區 UTC+8 (禁止 UTC)
...
- 新增 src/utils/timezone.py 時區工具函式
- 修改 11 個後端檔案,全部改用 now_taipei()
- 更新 HARD_RULES.md 加入時區鐵律章節
- 更新 Skills 02/04 加入時區禁令
🔴 HARD RULE: 禁止 datetime.utcnow() / datetime.now(UTC)
✅ 正確做法: from src.utils.timezone import now_taipei
Memory: feedback_timezone_taipei.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 09:08:34 +08:00
OG T
6f049877fc
fix(lint): ruff auto-fix + lewooogo-core src 加入 git
...
- Python: ruff --fix 修復 280 個 lint 錯誤
- lewooogo-core: src/ 目錄未追蹤,導致 CI eslint 失敗
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 23:51:37 +08:00
OG T
7478dc0254
feat(phase6-9): Complete modular architecture and Agent Teams
...
Phase 6.4 - Modular Architecture:
- Add lewooogo-brain adapters for LLM providers
- Add lewooogo-data dual memory (Redis + PostgreSQL)
- Implement consensus engine for multi-agent decisions
- Add incident memory service for historical context
Phase 9 - Agent Teams (Claude Agent SDK):
- Add base agent class with Claude Sonnet 4 integration
- Implement action planner, blast radius, and security agents
- Add agent API endpoints and proposal workflow
- Integrate ADR-009 OpenClaw Agent Teams architecture
DevOps & CI/CD:
- Add GitHub Actions CI/CD workflows (ci.yaml, cd.yaml)
- Add pre-commit hooks and secrets baseline
- Add docker-compose for local development
- Update Kubernetes network policies
Frontend Improvements:
- Add auto-healing error boundary component
- Update i18n messages for agent features
- Enhance dual-state incident card with execution feedback
Documentation:
- Add 7 ADRs covering MCP, design system, architecture decisions
- Update ARCHITECTURE_MEMORY.md with modular design
- Add GLOBAL_RULES.md and SOUL.md for project identity
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 18:40:36 +08:00
OG T
de5796522f
fix(api): fix optimization_suggestions dict access in proposal generation
...
The optimization_suggestions field is list[dict], not list[object].
Use .get() to access dict keys instead of attribute access.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 01:40:00 +08:00
OG T
141df533cc
feat(api): Phase 6.4 LLM-based proposal generation with cache
...
- Add _call_with_cache wrapper in OpenClaw (Redis-based LLM cache)
- Add generate_incident_proposal method for incident analysis
- Integrate ProposalService with OpenClaw LLM
- Fallback to template-based proposals if LLM fails
- Include LLM metadata (provider, confidence, cache status) in proposals
憲法條款: 必須使用快取保護算力資源,嚴禁無快取裸奔調用
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 01:33:46 +08:00
OG T
196d269b92
feat: add all application source code
...
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages
Co-Authored-By: Claude <noreply@anthropic.com >
2026-03-22 18:57:44 +08:00