fix(kernel): 使用 Kernel 配置的 model 而非 Agent 持久化的旧值
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

问题:在"模型与 API"页面切换模型后,对话仍使用旧模型
根因:Agent 配置从数据库恢复,其 model 字段优先于 Kernel 配置

修复:
- kernel.rs: send_message/send_message_stream 始终使用 Kernel 的当前 model
- openai.rs: 添加 User-Agent header 解决 Coding Plan API 405 错误
- kernel_commands.rs: 添加详细调试日志便于追踪配置传递
- troubleshooting.md: 记录此问题的排查过程和解决方案

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-23 22:56:06 +08:00
parent 86e79b4ad1
commit ae4bf815e3
5 changed files with 415 additions and 40 deletions

View File

@@ -2,6 +2,10 @@
//!
//! LLM drivers, tool system, and agent loop implementation.
/// Default User-Agent header sent with all outgoing HTTP requests.
/// Some LLM providers (e.g. Moonshot, Qwen, DashScope Coding Plan) reject requests without one.
pub const USER_AGENT: &str = "ZCLAW/0.2.0";
pub mod driver;
pub mod tool;
pub mod loop_runner;