Enable and render basic tool calling for the TUI#13283
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e556dca to
032f1a5
Compare
032f1a5 to
5693b52
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR wires basic TUI tool-call rendering and shell-command execution through the shared Agent Mode action model. The description includes visual evidence, and spec_context.md did not provide approved spec context to validate against.
Concerns
- TUI conversations are now forced into
RunToCompletioneven outside sandboxed/autonomous execution, which bypasses the user's configured tool permissions for non-denylisted commands and other actions.
Security
RunToCompletionshort-circuits several permission checks, so enabling it by default for local TUI sessions can let model-emitted shell commands and other tool actions run without the user's approval settings.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| let text_color = | ||
| Fill::from(ThemeFill::from(theme.terminal_colors().bright.black)).into(); | ||
| Box::new( | ||
| TuiContainer::new( |

Description
This PR gets basic tool calling working, and renders these tool calls in the blocklist (in a very basic way, for now). Most of this PR is just wiring, as, because we reused the terminal model, manager, blocklist ai models, etc., tool calling is basically the same for the TUI and the GUI (which is great).
For shell commands, there's a bit of extra wiring required, but it's still pretty minimal. I had the agent draw up an ascii diagram for the shell command execution flow as it's a bit hard to trace in the code:
We don't implement file diffs in this PR, as that will require some extra work (the file diff executor relies on the GUI's diff view directly right now, so there's some extraction that needs to be done). Marked as TODO for now and will submit a PR above this one in the stack to get that working.
The last change is that, for GUI ai block rendering, we now walk through the messages in the given block's exchange and render them as various sub-sections (i.e. input, agent output, tool calls, etc.). This sets us up well to reach parity with the GUI ai block, as there's a clear place to add rendering for thinking, todo creation, etc.
Testing
./script/runScreenshots / Videos
https://www.loom.com/share/4cdd488c6ace49caa4a94485cfe96e08
Agent Mode