fix(growth,saas): B9 Agent创建502调查+日志增强
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

深入追踪 B9 (Agent 创建 502):
- SaaS create_agent_from_template 端点代码不可能产生 502
  (SaasError::Relay 是唯一 502 来源,仅 relay 模块使用)
- 前端 createFromTemplate 双层 try-catch + fallback 已足够健壮
- 结论: B9 不可复现,可能因当时 SaaS 未运行或 token 过期导致

改进:
- handlers.rs: 添加 create_agent_from_template 请求/响应日志
- agentStore.ts: outer catch 记录 status + message 便于未来诊断
This commit is contained in:
iven
2026-04-21 21:19:44 +08:00
parent 751ec000d5
commit 317b8254e4
2 changed files with 6 additions and 2 deletions

View File

@@ -186,5 +186,8 @@ pub async fn create_agent_from_template(
Path(id): Path<String>,
) -> SaasResult<Json<AgentConfigFromTemplate>> {
check_permission(&ctx, "model:read")?;
Ok(Json(service::create_agent_from_template(&state.db, &id).await?))
tracing::info!("[AgentTemplate] create_agent_from_template: id={}, account={}", id, ctx.account_id);
let result = service::create_agent_from_template(&state.db, &id).await?;
tracing::info!("[AgentTemplate] create_agent_from_template OK: name={}", result.name);
Ok(Json(result))
}