fix: 三端联调测试 2 P0 + 6 P1 + 2 P2 修复
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
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
P0-1: SaaS relay 模型别名解析 — "glm-4-flash" → "glm-4-flash-250414" (resolve_model)
P0-2: config.rs interpolate_env_vars UTF-8 修复 (chars 迭代器替代 bytes as char)
+ DB 启动编码检查 + docker-compose UTF-8 编码参数
P1-3: UI 模型选择器覆盖 Agent 默认模型 (model_override 全链路: TS→Tauri→Rust kernel)
P1-6: 知识搜索管道修复 — seed_knowledge 创建 chunks + 默认分类 (seed/uploaded/distillation)
P1-7: 用量限额从当前 Plan 读取 (非 stale usage 表)
P1-8: relay 双维度配额检查 (relay_requests + input_tokens)
P2-9: SSE 路径 token 计数修复 — 流结束检测替代固定 500ms sleep + billing increment
This commit is contained in:
@@ -25,7 +25,7 @@ impl Kernel {
|
||||
agent_id: &AgentId,
|
||||
message: String,
|
||||
) -> Result<MessageResponse> {
|
||||
self.send_message_with_chat_mode(agent_id, message, None).await
|
||||
self.send_message_with_chat_mode(agent_id, message, None, None).await
|
||||
}
|
||||
|
||||
/// Send a message to an agent with optional chat mode configuration
|
||||
@@ -34,6 +34,7 @@ impl Kernel {
|
||||
agent_id: &AgentId,
|
||||
message: String,
|
||||
chat_mode: Option<ChatModeConfig>,
|
||||
model_override: Option<String>,
|
||||
) -> Result<MessageResponse> {
|
||||
let agent_config = self.registry.get(agent_id)
|
||||
.ok_or_else(|| zclaw_types::ZclawError::NotFound(format!("Agent not found: {}", agent_id)))?;
|
||||
@@ -41,12 +42,16 @@ impl Kernel {
|
||||
// Create or get session
|
||||
let session_id = self.memory.create_session(agent_id).await?;
|
||||
|
||||
// Use agent-level model if configured, otherwise fall back to global config
|
||||
let model = if !agent_config.model.model.is_empty() {
|
||||
agent_config.model.model.clone()
|
||||
} else {
|
||||
self.config.model().to_string()
|
||||
};
|
||||
// Model priority: UI override > Agent config > Global config
|
||||
let model = model_override
|
||||
.filter(|m| !m.is_empty())
|
||||
.unwrap_or_else(|| {
|
||||
if !agent_config.model.model.is_empty() {
|
||||
agent_config.model.model.clone()
|
||||
} else {
|
||||
self.config.model().to_string()
|
||||
}
|
||||
});
|
||||
|
||||
// Create agent loop with model configuration
|
||||
let subagent_enabled = chat_mode.as_ref().and_then(|m| m.subagent_enabled).unwrap_or(false);
|
||||
@@ -122,7 +127,7 @@ impl Kernel {
|
||||
agent_id: &AgentId,
|
||||
message: String,
|
||||
) -> Result<mpsc::Receiver<zclaw_runtime::LoopEvent>> {
|
||||
self.send_message_stream_with_prompt(agent_id, message, None, None, None).await
|
||||
self.send_message_stream_with_prompt(agent_id, message, None, None, None, None).await
|
||||
}
|
||||
|
||||
/// Send a message with streaming, optional system prompt, optional session reuse,
|
||||
@@ -134,6 +139,7 @@ impl Kernel {
|
||||
system_prompt_override: Option<String>,
|
||||
session_id_override: Option<zclaw_types::SessionId>,
|
||||
chat_mode: Option<ChatModeConfig>,
|
||||
model_override: Option<String>,
|
||||
) -> Result<mpsc::Receiver<zclaw_runtime::LoopEvent>> {
|
||||
let agent_config = self.registry.get(agent_id)
|
||||
.ok_or_else(|| zclaw_types::ZclawError::NotFound(format!("Agent not found: {}", agent_id)))?;
|
||||
@@ -150,12 +156,16 @@ impl Kernel {
|
||||
None => self.memory.create_session(agent_id).await?,
|
||||
};
|
||||
|
||||
// Use agent-level model if configured, otherwise fall back to global config
|
||||
let model = if !agent_config.model.model.is_empty() {
|
||||
agent_config.model.model.clone()
|
||||
} else {
|
||||
self.config.model().to_string()
|
||||
};
|
||||
// Model priority: UI override > Agent config > Global config
|
||||
let model = model_override
|
||||
.filter(|m| !m.is_empty())
|
||||
.unwrap_or_else(|| {
|
||||
if !agent_config.model.model.is_empty() {
|
||||
agent_config.model.model.clone()
|
||||
} else {
|
||||
self.config.model().to_string()
|
||||
}
|
||||
});
|
||||
|
||||
// Create agent loop with model configuration
|
||||
let subagent_enabled = chat_mode.as_ref().and_then(|m| m.subagent_enabled).unwrap_or(false);
|
||||
|
||||
Reference in New Issue
Block a user