fix(agent-worker): a Dev tool call's summary names what it acted on

Draft
SA
2d ago
+22-0

Summary

  • agent_turns.tool_calls[].summary is empty for every Dev MCP tool call: callSummary only reads shell and file arguments (command, path, pattern, shell_id, description). In production, all 14 recorded Dev tool calls (13 mcp__dev__reply, 1 mcp__dev__list_work) have an empty summary. A reply that went to the wrong room looks the same as a good one.
  • callSummary now also reads target, taskId, channel, routine_id, pageId, id, slug, title and query. description moves below them, so it is only used when nothing else fits.
  • Bulk text (body, instructions, text, content, html) stays out. The summary is still cut to 200 characters.

Compatibility

The worker change only. settleTurn already takes summary: z.string(), and the stored JSON shape does not change. Nothing reads summary except people diagnosing turns.

Validation

  • New test settleTurn > records where a reply tool call went. It fails on main and passes here. createActivities suite 15/15.
  • bun run typecheck in apps/agent-worker and biome check are clean.

The Dev doctor opened this as a first step on rough edge 32 ("a turn's tool calls keep no input"). The end state is a short, size-capped input per call.


Summary by cubic

Fixes Dev tool call summaries so agent_turns.tool_calls[].summary names what the call acted on. Previously the summary only read shell and file arguments, so every Dev MCP tool call in production (13 replies, 1 list_work) had an empty summary and a reply sent to the wrong room looked like a good one.

  • callSummary now also reads the reply target, task ID, channel, routine ID, page ID or slug, title, and query, with description demoted to a last resort.
  • Bulk text (body, instructions, text, content, html) stays out of the summary and the 200-character cap remains.
  • Only the worker changes; settleTurn already accepts a string summary and the stored JSON shape doesn't change.
  • Adds a test that a reply tool call records its channel, which fails on main and passes with this change.