Commit Graph

9 Commits

Author SHA1 Message Date
Your Name
e208798531 fix(ai): keep GCP Ollama lane on safe models
All checks were successful
CD Pipeline / tests (push) Successful in 54s
Code Review / ai-code-review (push) Successful in 14s
CD Pipeline / build-and-deploy (push) Successful in 3m25s
CD Pipeline / post-deploy-checks (push) Successful in 1m50s
2026-05-05 23:37:33 +08:00
OG T
2e9845074e fix(test): nvidia → openclaw_nemo 對齊 RATE_LIMITS/COST_LIMITS key (I3)
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m57s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 14:00:21 +08:00
OG T
6266a4fc01 fix(test): 更新 AIProviderEnum 測試 — NVIDIA → NEMOTRON (Phase 24 B3)
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 7m6s
- test_nvidia_provider_in_router: 改為驗證 NEMOTRON enum
- test_tool_calling_route: 改為期望 NEMOTRON provider
- test_existing_routing_not_affected: 排除 NEMOTRON (非一般路由)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 23:39:46 +08:00
OG T
5a7919f55c fix(test): AIProvider → AIProviderEnum (Phase 24 C1 rename fix)
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 7m11s
E2E Health Check / e2e-health (push) Successful in 16s
C1 修復 (3ad7b60) 重命名 AIProvider Enum 為 AIProviderEnum
test_nvidia_provider.py 未同步更新,導致 CD 測試失敗。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:38:04 +08:00
OG T
cd6da9c8d6 fix(tests): 更新 NVIDIA rate limiter 測試至當前配置值
ai_rate_limiter.py 在 2026-03-31 更新了 NVIDIA 免費版限制值,
但測試未同步更新導致失敗:
- rpm: 5 → 10 (放寬並發控制)
- daily_requests: 100 → 99999 (免費版無限制)
- daily_tokens: 50_000 → 9999999 (免費版無限制)
- total_cost_usd: 0.0 → 999999.0 (修復 $0>=0 永遠 True bug)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 11:15:22 +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
ae21ba2cc6 feat(ai): Phase 20 P3 優化 - Circuit Breaker + 指數退避 + Prometheus
P3-1: Circuit Breaker 狀態機 (CLOSED/OPEN/HALF_OPEN)
- 連續 3 次失敗觸發斷路
- 60 秒後自動嘗試恢復
- 防止連鎖故障

P3-2: 指數退避重試
- 基礎延遲 1s,最大 30s
- 含 10% jitter 避免雷鳴

P3-3: Prometheus Metrics
- nvidia_tool_call_requests_total (status, tool_name)
- nvidia_tool_call_latency_seconds (histogram)
- nvidia_circuit_breaker_state_changes_total

測試: 25 → 34 PASSED

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 01:49:08 +08:00
OG T
4f7282a97a fix(ai): Phase 20 P2 修復 - Protocol + 邊界測試 + model_registry
P2-1: 定義 INvidiaProvider Protocol (@runtime_checkable)
P2-2: 補充邊界測試 15 → 25 案例
P2-3: model_registry 新增 NVIDIA + tool_calling_fallback_order

首席架構師評分: 82 → 86 → 90/100

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 01:24:17 +08:00
OG T
b77e151387 feat(ai): ADR-036 NVIDIA Nemotron Tool Calling 整合
Phase 20 - 提升 Tool Calling 精準度 50% → 83.3%

新增:
- src/models/nvidia.py: Pydantic Schema
- src/services/nvidia_provider.py: NvidiaProvider 類別
- tests/test_nvidia_provider.py: 15 項單元測試 (全部通過)

修改:
- ai_router.py: AIProvider.NVIDIA + route_tool_calling()
- ai_rate_limiter.py: NVIDIA 限制 (5 RPM, 100/day)
- models.json: NVIDIA 配置
- cd.yaml: Secrets 注入 NVIDIA_API_KEY

路由策略:
- Tool Calling: Nemotron → Gemini → Claude
- 一般對話: Ollama → Gemini → Claude (不變)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 00:00:08 +08:00