fix(relay): fix llm_routing read path bug and add User-Agent header for Coding Plan
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

1. connectionStore.ts: storedAccount.account.llm_routing → storedAccount.llm_routing
   - saveSaaSSession stores SaaSAccountInfo directly, not { account: SaaSAccountInfo }
   - This bug caused admin llm_routing config to never take effect

2. relay/service.rs: add User-Agent: claude-code/1.0 header
   - Kimi Coding Plan requires recognized coding agent User-Agent
   - Default reqwest UA is rejected with 403

3. Docs: add llm_routing routing mode explanation and troubleshooting entries
This commit is contained in:
iven
2026-03-31 12:02:32 +08:00
parent ee51d5abcd
commit 3e5d64484e
4 changed files with 77 additions and 4 deletions

View File

@@ -243,6 +243,8 @@ pub async fn execute_relay(
let mut req_builder = client.post(&url)
.header("Content-Type", "application/json")
// Kimi Coding Plan 等 Coding Agent API 需要识别 User-Agent 为 coding agent
.header("User-Agent", "claude-code/1.0")
.body(request_body.to_string());
if let Some(ref key) = api_key {