Skip to content

feat: complete_tool() — SharedToolCallTimeline for per-call timing#4

Merged
jaikoo merged 1 commit intomainfrom
feat/complete-tool-timeline
Apr 26, 2026
Merged

feat: complete_tool() — SharedToolCallTimeline for per-call timing#4
jaikoo merged 1 commit intomainfrom
feat/complete-tool-timeline

Conversation

@jaikoo
Copy link
Copy Markdown

@jaikoo jaikoo commented Apr 26, 2026

Summary

Wires complete_tool() into CliToolExecutor::execute() so the tool call timeline records per-call timing, error status, truncation, and line counts.

What was added

  • SharedToolCallTimelineArc<Mutex<ToolCallTimeline>> wrapper with a .with() method for lock-and-call access
  • tool_timeline: Option<SharedToolCallTimeline> field on CliToolExecutor, initialized via constructor
  • complete_tool() calls in execute() — on success: marks elapsed time, sets was_truncated if >100 lines, records output line count; on error: marks is_error
  • All CliToolExecutor::new() call sites updated to pass None

Active connection deferred

Passing a live SharedToolCallTimeline from consume_stream() (where start_tool() fires) to the executor requires threading through build_runtimeConversationRuntime. This crosses the runtime crate boundary and is best done as a follow-up once the types are settled.

Verification

  • cargo test -p rusty-claude-cli --bin claw — 230 passed

- Add SharedToolCallTimeline (Arc<Mutex<ToolCallTimeline>>) for
  shared access between streaming client and tool executor
- Add tool_timeline field to CliToolExecutor + constructor param
- Wire complete_tool() in execute() — records duration, error,
  truncation, and line count on each tool result
- Update all CliToolExecutor::new() call sites with None arg
- Re-export SharedToolCallTimeline from tui/mod.rs
- 230 tests pass

Note: passing an active timeline from consume_stream to the executor
requires threading through build_runtime -> ConversationRuntime which
crosses the runtime crate boundary (separate PR).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@jaikoo jaikoo merged commit f727739 into main Apr 26, 2026
jaikoo pushed a commit that referenced this pull request Apr 26, 2026
…ecutor

- Create SharedToolCallTimeline once in build_runtime_with_plugin_state()
- Pass clone to both AnthropicRuntimeClient and CliToolExecutor
- Wire start_tool() via self.tool_timeline in consume_stream() (instead of
  a local ToolCallTimeline that was invisible to the executor)
- complete_tool() already wired in CliToolExecutor::execute() from PR #4
- Remove unused set_timeline() method since timeline is now passed at
  construction time
- Remove unused ToolCallTimeline import from app.rs
- 230 tests pass
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.

2 participants