feat: complete_tool() — SharedToolCallTimeline for per-call timing#4
Merged
feat: complete_tool() — SharedToolCallTimeline for per-call timing#4
Conversation
- 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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires
complete_tool()intoCliToolExecutor::execute()so the tool call timeline records per-call timing, error status, truncation, and line counts.What was added
SharedToolCallTimeline—Arc<Mutex<ToolCallTimeline>>wrapper with a.with()method for lock-and-call accesstool_timeline: Option<SharedToolCallTimeline>field onCliToolExecutor, initialized via constructorcomplete_tool()calls inexecute()— on success: marks elapsed time, setswas_truncatedif >100 lines, records output line count; on error: marksis_errorCliToolExecutor::new()call sites updated to passNoneActive connection deferred
Passing a live
SharedToolCallTimelinefromconsume_stream()(wherestart_tool()fires) to the executor requires threading throughbuild_runtime→ConversationRuntime. This crosses theruntimecrate 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