Version: 0.9.50.dev.260428

后端:
1. 工具执行结果协议升级为结构化 ToolExecutionResult——execute/tool_runtime、ToolRegistry、stream extra 与 timeline 持久化统一改为透传 observation_text / summary / argument_view / result_view,不再只回写纯文本结果;context_tools、upsert_task_class 与旧 schedule/web 工具通过兼容包装接入新协议
2. 日程写工具注册继续收口——place / move / swap / batch_move / unplace / queue_apply_head_move 从 registry 内联实现下沉为独立 handler,降低注册表内参数解析与业务逻辑混写
3. 工具结果展示基础能力补齐——新增 execution_result / schedule_operation_handlers 公共件,为日程操作结果、参数本地化展示、blocked/failed/done 状态统一建模

前端:
4. AssistantPanel 接入结构化工具卡片渲染——新增 ToolCardRenderer,tool_call / tool_result 支持 argument_view / result_view 展示;schedule_completed 恢复为时间线内的占位卡片块,避免排程卡片脱离原消息顺序
5. 时间线类型与渲染收敛——schedule_agent.ts 补齐 ToolView 协议,AssistantPanel 改为按块渲染 tool / schedule_card / business_card,并移除旧 demo/prototype 路由与页面,收束正式面板代码路径

仓库:
6. AGENTS.md 新增协作约束——禁止擅自回滚、覆盖或删除用户/其他代理产生的工作区改动
This commit is contained in:
LoveLosita
2026-04-28 11:55:34 +08:00
parent 32d5dd0262
commit 509e266626
17 changed files with 2431 additions and 2199 deletions

View File

@@ -233,12 +233,31 @@ func (e *ChunkEmitter) EmitToolCallStart(blockID, stage, toolName, summary, argu
// 协议约束:
// 1. status 由调用方明确传入(如 done/blocked/failed
// 2. 结果事件只走 extra.tool不回写 reasoning_content。
func (e *ChunkEmitter) EmitToolCallResult(blockID, stage, toolName, status, summary, argumentsPreview string, includeRole bool) error {
func (e *ChunkEmitter) EmitToolCallResult(
blockID string,
stage string,
toolName string,
status string,
summary string,
argumentsPreview string,
argumentView map[string]any,
resultView map[string]any,
includeRole bool,
) error {
if e == nil || e.emit == nil {
return nil
}
_ = includeRole
return e.emitExtraOnly(NewToolResultExtra(blockID, stage, toolName, status, summary, argumentsPreview))
return e.emitExtraOnly(NewToolResultExtra(
blockID,
stage,
toolName,
status,
summary,
argumentsPreview,
argumentView,
resultView,
))
}
// emitExtraOnly 仅输出结构化 extra 事件,不附带 content/reasoning。

View File

@@ -87,10 +87,12 @@ type StreamStatusExtra struct {
// StreamToolExtra 表示一次工具调用相关事件。
type StreamToolExtra struct {
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Summary string `json:"summary,omitempty"`
ArgumentsPreview string `json:"arguments_preview,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Summary string `json:"summary,omitempty"`
ArgumentsPreview string `json:"arguments_preview,omitempty"`
ArgumentView map[string]any `json:"argument_view,omitempty"`
ResultView map[string]any `json:"result_view,omitempty"`
}
// StreamConfirmExtra 表示一次待确认事件的展示摘要。
@@ -234,7 +236,16 @@ func NewToolCallExtra(blockID, stage, toolName, status, summary, argumentsPrevie
}
// NewToolResultExtra 创建“工具结果”事件的 extra。
func NewToolResultExtra(blockID, stage, toolName, status, summary, argumentsPreview string) *OpenAIChunkExtra {
func NewToolResultExtra(
blockID string,
stage string,
toolName string,
status string,
summary string,
argumentsPreview string,
argumentView map[string]any,
resultView map[string]any,
) *OpenAIChunkExtra {
return &OpenAIChunkExtra{
Kind: StreamExtraKindToolResult,
BlockID: blockID,
@@ -245,6 +256,8 @@ func NewToolResultExtra(blockID, stage, toolName, status, summary, argumentsPrev
Status: status,
Summary: summary,
ArgumentsPreview: argumentsPreview,
ArgumentView: argumentView,
ResultView: resultView,
},
}
}