修复: 断路器失败判定纯结构化(失败 content 包 JSON envelope,is_failure_content 只读字段不解析内容文本)
This commit is contained in:
@@ -503,7 +503,12 @@ pub(crate) async fn process_tool_calls(
|
||||
{
|
||||
let mut session = session_arc.lock().await;
|
||||
// T2: 大工具结果进 namespace
|
||||
let msg_content = if df_ai::namespace_store::should_use_namespace(&content, &draft.name) {
|
||||
// 失败包结构化 envelope {"status":"failed","error":...}:让断路器按 status 判
|
||||
// (不解析内容文本,理论可靠)。emit 给前端的 result 与 audit 仍用原 err_msg 纯文本
|
||||
// (前端卡片/审计可读,与断路器信号解耦)。
|
||||
let msg_content = if status == "failed" {
|
||||
serde_json::json!({"status":"failed","error":&content}).to_string()
|
||||
} else if df_ai::namespace_store::should_use_namespace(&content, &draft.name) {
|
||||
session.namespace_store.store(&draft.name, &content)
|
||||
} else {
|
||||
content.clone()
|
||||
@@ -622,7 +627,12 @@ pub(crate) async fn process_tool_calls(
|
||||
{
|
||||
let mut session = session_arc.lock().await;
|
||||
// T2: 大工具结果进 namespace,主队列只留引用
|
||||
let msg_content = if df_ai::namespace_store::should_use_namespace(&content, &draft.name) {
|
||||
// 失败包结构化 envelope {"status":"failed","error":...}:让断路器按 status 判
|
||||
// (不解析内容文本,理论可靠)。emit 给前端的 result 与 audit 仍用原 err_msg 纯文本
|
||||
// (前端卡片/审计可读,与断路器信号解耦)。
|
||||
let msg_content = if status == "failed" {
|
||||
serde_json::json!({"status":"failed","error":&content}).to_string()
|
||||
} else if df_ai::namespace_store::should_use_namespace(&content, &draft.name) {
|
||||
session.namespace_store.store(&draft.name, &content)
|
||||
} else {
|
||||
content.clone()
|
||||
|
||||
Reference in New Issue
Block a user