fix(agent): Agent 运行 - 截断工具参数纠偏重试并修复 ask_user 后续跑与清单状态
模型返回不完整的工具参数 JSON 时,Pi 桥接带 truncated_tool_arguments 纠偏上下文重做同一步,不再把整轮判为中断。ask_user 进入提问后结束本轮 Pi 调用;续轮会话快照缺失时改用服务端 canonical 历史。继承的待办清单挂到新一轮,等待用户确认时清单显示暂停而非停止。
This commit is contained in:
@@ -193,6 +193,7 @@ async function run() {
|
||||
content: [{ type: "text", text: result.content || "操作正在等待用户审批。" }],
|
||||
details: { approvalId: result.approvalId, paused: true },
|
||||
isError: true,
|
||||
terminate: true,
|
||||
};
|
||||
}
|
||||
// 工具结果必须是非空文本:交回 "null" 会让模型返回空回复。
|
||||
@@ -202,6 +203,7 @@ async function run() {
|
||||
content: [{ type: "text", text }],
|
||||
details: result.details,
|
||||
isError: Boolean(result.isError),
|
||||
terminate: Boolean(result.terminate),
|
||||
};
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user