fix field name mismatch

This commit is contained in:
2026-07-15 16:01:31 +08:00
parent 29a3fd9b84
commit 79bef5a238
3 changed files with 5 additions and 1 deletions
@@ -567,6 +567,7 @@ pub async fn confirm_editor_agent_tool_call(
let context = context::build_tool_context(&document);
let generation_inputs = |title: &str, value: &str| {
Some(json!({
// TODO extract const
"source": "editor-agent",
"conversationId": conversation.conversation_id,
"toolCallMessageId": message_id,
@@ -110,6 +110,7 @@ fn reconcile_completed_editor_agent_tool_call(
let response = result_payload_json
.ok_or_else(|| "生成任务缺少结果数据".to_string())
.and_then(|payload| serde_json::from_str::<Value>(payload).map_err(|e| e.to_string()))?
// TODO extract const
.get("editor-agent-tool-call-result")
.cloned()
.ok_or_else(|| "生成任务缺少 Agent 工具调用结果".to_string())?;
@@ -1079,6 +1079,7 @@ fn editor_generation_result_payload_json(
// The Agent needs this compact result to restore its tool-call card. Other jobs keep
// master's metadata-only completion payload to avoid turning the queue into an asset API.
object.insert(
// TODO extract const
"editor-agent-tool-call-result".to_string(),
compact_editor_generation_result(response.clone()),
);
@@ -1098,7 +1099,8 @@ fn is_editor_agent_generation_job(job: &ExternalGenerationJobRecord) -> bool {
payload
.pointer("/generationInputs/source")
.and_then(Value::as_str)
.is_some_and(|source| source.trim() == "editor-agent-tool-call-result")
// TODO extract const
.is_some_and(|source| source.trim() == "editor-agent")
})
}