Skip to content

Add ToolActivityDescriber for real-time tool status - #155

Draft
myzie wants to merge 1 commit into
mainfrom
worktree-feat+tool-activity-description
Draft

Add ToolActivityDescriber for real-time tool status#155
myzie wants to merge 1 commit into
mainfrom
worktree-feat+tool-activity-description

Conversation

@myzie

@myzie myzie commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds ToolActivityDescriber optional interface (raw json.RawMessage input) — backward-compatible, no required method on Tool
  • Adds TypedActivityDescriber[T] for typed tools to implement with strongly-typed input
  • TypedToolAdapter delegates to the underlying tool's ActivityDescription when present
  • Agent's tool execution path checks for ToolActivityDescriber before PreToolUse hooks and populates HookContext.ActivityDescription
  • Consumers attach a PreToolUseHook and read hctx.ActivityDescription to display status

Toolkit implementations (spec table):

Tool Example output
BashTool "Running: go test ./..."
ReadFileTool "Reading src/agent.go"
WriteFileTool "Writing src/agent.go"
FetchTool "Fetching https://example.com"
GlobTool "Searching **/*.go"
GrepTool "Grepping for 'CreateResponse'"
ListDirectoryTool "Listing toolkit/"

Implements tech spec: docs/tech-specs/tool-activity-description.md

Test plan

  • go test -run TestToolActivityDescriber . — adapter delegation and fallback for non-implementing tools
  • go test ./... — full suite passes

🤖 Generated with Claude Code

Defines ToolActivityDescriber (raw JSON) and TypedActivityDescriber[T]
(typed input). TypedToolAdapter delegates to the underlying tool when
present. ActivityDescription is populated on HookContext before PreToolUse
hooks run, so consumers can display status in TUIs and log streams without
needing to parse tool input themselves.

Toolkit implementations: Bash, ReadFile, WriteFile, WebFetch, Glob, Grep,
ListDirectory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23eb043c-8127-417d-acb4-b0de46680878

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-feat+tool-activity-description

Comment @coderabbitai help to get the list of available commands and usage tips.

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