feat(cli): /debug-tool-call to inspect the last tool call#205
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(cli): /debug-tool-call to inspect the last tool call#205emal-avala merged 1 commit intomainfrom
emal-avala merged 1 commit intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
057c1ee to
71e7c76
Compare
Walks the conversation history, pairs tool_use blocks with their matching tool_result, and prints the most recent call's tool name, id, input, and result. Useful for debugging when the agent misbehaves and you want to see exactly what it invoked. Usage: /debug-tool-call inspect the most recent call /debug-tool-call 2 inspect the 2nd-most-recent call /debug-tool-call list list the last 10 calls /debug-tool-call full show untrimmed input/result Aliases: /dtc, /last-tool
71e7c76 to
c6327eb
Compare
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
/debug-tool-call(aliases/dtc,/last-tool) — inspect the most recent tool invocation in the session.tool_useblock with its matchingtool_result, rendering name, id, JSON input, and result (with error flag)./debug-tool-call <N>for Nth-most-recent,/debug-tool-call listfor the last 10, and/debug-tool-call fullto disable output truncation.Why
When a tool call misbehaves — wrong args, surprising result — the user currently has no quick way to see exactly what the model sent and what came back. This command reads straight from the session's message log, so it works for the current session and any resumed session.
Test plan
cargo clippy -p agent-code --all-targets -- -D warningscargo clippy -p agent-code-lib --all-targets -- -D warningscargo test -p agent-code --bin agent(92 passed)collect_tool_calls_pairs_use_with_resultcollect_tool_calls_empty_session_returns_emptycollect_tool_calls_marks_error_flagclip_for_display_shortens_long_textclip_for_display_passes_short_text_through