fix(agent): Agent 运行 - 截断工具参数纠偏重试并修复 ask_user 后续跑与清单状态
模型返回不完整的工具参数 JSON 时,Pi 桥接带 truncated_tool_arguments 纠偏上下文重做同一步,不再把整轮判为中断。ask_user 进入提问后结束本轮 Pi 调用;续轮会话快照缺失时改用服务端 canonical 历史。继承的待办清单挂到新一轮,等待用户确认时清单显示暂停而非停止。
This commit is contained in:
@@ -287,6 +287,11 @@ func (s *Service) ensureCloudAgentExecution(task *model.Task, initial cloudAgent
|
||||
}
|
||||
state.event(task.ID, "tool_completed", map[string]any{"toolName": "skills_load", "skillIds": skillIDs, "text": fmt.Sprintf("已启用 %d 个技能,正文将按需读取", len(initial.Skills))})
|
||||
}
|
||||
if len(state.Plan) > 0 {
|
||||
// 继承的待办清单必须挂到本轮:前端按 plan-<runId> 展示清单,不发这条事件时
|
||||
// 界面会一直停在上一轮(已结束)的清单上,显示"未完成项已停止"。
|
||||
state.event(task.ID, "plan_updated", map[string]any{"items": state.Plan, "pendingTitles": cloudAgentPendingPlanItems(state.Plan), "inherited": true})
|
||||
}
|
||||
pressure := s.cloudAgentContextPressure(input.Requests.Canonical, initial.Request.Prompt, initial.Request)
|
||||
if carrier {
|
||||
// The carrier is deliberately not a model call. Pi will create the first
|
||||
|
||||
Reference in New Issue
Block a user