Skip to content

claude: project tool calls as work and pre-tool narration as commentary - #499

Merged
sandersonstabo merged 1 commit into
masterfrom
claude-work-rows
Sep 27, 2026
Merged

sandersonstabo merged 1 commit into
masterfrom
claude-work-rows

Conversation

@sandersonstabo

@sandersonstabo sandersonstabo commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Claude turns rendered unlike Codex turns: the header was the latest thinking stretch ("I should wrap up here · 35s") and kept changing, interim narration appeared as answer paragraphs, and there was no shimmering live line. The Claude adapter emitted no tool rows and tagged all text unspecified, so the Editor saw a thought-only turn.

What

  • claude/tools.rs: tool_use (buffered assistant frame) starts a step, the root user frame's tool_result settles it. Bash → terminal activity; Read/Write/Edit/Grep/Glob/WebSearch/WebFetch/Task/mcp → canonical tool kinds with their target as detail.
  • claude/text.rs + adapter: the first tool_use block of a message re-phases that message's text to commentary via a snapshot; later text of the message streams as commentary.
  • Tests: fixture replay projects both reads as work and keeps the answer non-commentary; constructed stream covers commentary re-phase, command success/failure, unknown results. Both fail with the projection disabled.

Verification

  • cargo test -p artisan-backend --lib engine_owner::engine_owner_claude: 64 pass.
  • Full backend suite: 15 failures (streaming sink, composer_state_handler, preflight cleanup, hold_turn_answers) that fail identically on master without this change.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Claude turns now render like Codex turns instead of thought-only rows: tool calls project as work, and narration before a tool call is tagged as commentary.

  • Bash tool calls project as terminal activity with command, bounded output, and failure state; all other tools (read, write, edit, grep, glob, web search, web fetch, task, mcp) project as tool steps with canonical kind and target detail.
  • The first tool-use block of a message re-phases that message's streamed and buffered text as commentary, so interim narration no longer appears as answer paragraphs.
  • Tool results from the root user frame settle the matching started tool; unknown or duplicate tool IDs emit nothing.

Migration
No migration or rollout action needed; projection is gated by tests that fail when disabled.

Written for commit 8750ea5. Summary will update on new commits.

Review in cubic

A Claude turn reached the Editor as pure thinking: the adapter dropped
every tool_use/tool_result, and all text stayed `unspecified`. The Editor
therefore narrated the turn as Thinking with the newest thinking stretch
as a changing header chip, promoted interim narration to answer
paragraphs, and suppressed the shimmering live line whenever that
narration streamed.

Tool calls now project like Codex's: Bash as terminal activity (command,
bounded output, failure) and every other tool as a step under the
canonical kind the Editor groups (read, edit, grep, web_search, ...).
The first tool-use block of a message re-phases that message's text as
commentary, so the turn reads "Working for …" with narration and work
rows inside it and the live summary line shimmering beneath.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sandersonstabo
sandersonstabo merged commit effe9a8 into master Sep 27, 2026
21 of 31 checks passed
@sandersonstabo
sandersonstabo deleted the claude-work-rows branch September 27, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant