Return deliverable generation to the agent and fix the artifact-card root cause #32

Merged
weichen merged 1 commits from feature/agent-native-deliverables-r1 into main 2026-10-01 03:33:54 +00:00
Owner

task feature/agent-native-deliverables-r1(后端半):ExecuteTool 工件回填根因修复(工具产物→对话卡片,runmgr 级测试);register_artifact 登记桥 + base.deliverables 交付工作流提示词(python-docx/openpyxl/python-pptx 配方);移除 write_docx 系统工具;最终输出契约(内联 折离)。go test 19 包全绿。run_shell/run_python 解释器待安全门禁分批落盘。

task feature/agent-native-deliverables-r1(后端半):ExecuteTool 工件回填根因修复(工具产物→对话卡片,runmgr 级测试);register_artifact 登记桥 + base.deliverables 交付工作流提示词(python-docx/openpyxl/python-pptx 配方);移除 write_docx 系统工具;最终输出契约(内联 <think> 折离)。go test 19 包全绿。run_shell/run_python 解释器待安全门禁分批落盘。
weichen added 1 commit 2026-10-01 03:33:41 +00:00
Why: two field reports against the live build — deliverable cards never
appeared in chat (only model-written filenames) and the artifacts panel
felt dead. Root cause found in runmgr.ExecuteTool: registry tools that
write artifacts via rc.WriteArtifact never had res.Artifact set (only
the oversized-result path did), so llm.go never emitted artifact_ref
parts for real tool output; the unit suite passed via fakes that set
it directly. Architecturally, document generation moves back to the
agent (user directive): system provides execution primitives and the
delivery bridge, not domain tools like write_docx.

Evidence:
- runmgr: toolCtx tracks artifacts written during a call and
  ExecuteTool backfills res.Artifact (new runmgr test proves
  write_artifact now surfaces one; negative test: no phantom artifact)
- new tools/register_artifact: bridge from workspace files (binary
  docx/xlsx/pptx/pdf/images, <=10MB) to deliverable artifacts;
  run_shell/run_python interpreter executors are designed
  (script-to-disk + whitelisted bash/python3, sandbox cwd, caps) and
  land in a follow-up batch behind the security gate decision
- removed builtin write_docx + its prompt; write_artifact prompt now
  text-only with explicit no-binary guidance; new always-on base
  prompt base.deliverables teaches the generate->register->summarize
  workflow with python-docx/openpyxl/python-pptx recipes;
  task.doc-minutes rewritten to the workflow
- final-output contract: inline <think> blocks in streamed content are
  split into thinking (process) parts so the final reply stays clean
  (unit + runner tests)
- go test ./... 19 packages ok; vet clean

Impact: every tool artifact now lands as an in-chat deliverable card;
mock #doc unchanged as demo fixture; binary office mimes stay out of
the text index; write_docx callers see the tool gone (prompt reroutes
them).

Refs: task feature/agent-native-deliverables-r1
weichen merged commit 3c08f9008e into main 2026-10-01 03:33:54 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#32