fix(phase25): 首席架構師 Review C1/C2/I1/I3 修正
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 57s
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 57s
C1: NemotronProvider.privacy_level cloud→local
NIM 部署在 192.168.0.188 內網,非官方雲端 API
可納入 DIAGNOSE _local_fallback_chain 隱私邊界
C2: adopt() 端點暫停,返回 501
API Pod 執行 git add -A 有安全風險
ADR-057 起草後改用 Gitea PR API 實作
I1: timeout log 修正,記錄實際套用的 timeout 值
原本永遠記錄 NEMOTRON_TIMEOUT_SECONDS=45
現在記錄依 task_type 選擇的正確值
I3: route_sync() 補 DIAGNOSE 隱私邊界
async route() 已有 _local_fallback_chain
sync 版本遺漏,此次補齊
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -111,8 +111,10 @@ class NemotronProvider:
|
||||
|
||||
@property
|
||||
def privacy_level(self) -> str:
|
||||
# NIM 是雲端 GPU,首席架構師 Q2 裁示: cloud 等級
|
||||
return "cloud"
|
||||
# 2026-04-04 ogt: Phase 25 首席架構師裁示 — NIM 部署在 192.168.0.188(內網 GPU)
|
||||
# 非 NVIDIA 官方雲端 API,屬 local infra,可納入 DIAGNOSE 隱私邊界
|
||||
# 原標注 cloud 錯誤(Q2 裁示前的預設),此次更正
|
||||
return "local"
|
||||
|
||||
async def analyze(
|
||||
self,
|
||||
@@ -227,11 +229,12 @@ class NemotronProvider:
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
latency_ms = (time.perf_counter() - start) * 1000
|
||||
timeout_secs = getattr(settings, "NEMOTRON_TIMEOUT_SECONDS", 30)
|
||||
# 2026-04-04 ogt: I1 修正 — 使用實際套用的 timeout(依 task_type 選擇)
|
||||
logger.warning(
|
||||
"nemotron_provider_timeout",
|
||||
incident_id=incident_id,
|
||||
timeout_seconds=timeout_secs,
|
||||
timeout_seconds=timeout,
|
||||
task_type=task_type,
|
||||
latency_ms=round(latency_ms, 1),
|
||||
)
|
||||
return AIResult(
|
||||
@@ -239,7 +242,7 @@ class NemotronProvider:
|
||||
success=False,
|
||||
provider=self.name,
|
||||
latency_ms=latency_ms,
|
||||
error=f"Tool calling timeout after {timeout_secs}s",
|
||||
error=f"Tool calling timeout after {timeout}s",
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -536,7 +536,11 @@ class AIRouter:
|
||||
)
|
||||
|
||||
# 建立 Fallback 鏈
|
||||
fallback_chain = self._build_fallback_chain(provider)
|
||||
# 2026-04-04 ogt: I3 修正 — route_sync 也須尊重 DIAGNOSE 隱私邊界
|
||||
if intent == IntentType.DIAGNOSE:
|
||||
fallback_chain = [fc for fc in self._local_fallback_chain if fc[0] != provider]
|
||||
else:
|
||||
fallback_chain = self._build_fallback_chain(provider)
|
||||
|
||||
# 延遲預算
|
||||
latency_budget = PROVIDER_LATENCY_BUDGET.get(provider, 30000)
|
||||
|
||||
Reference in New Issue
Block a user