Skip to content

feat(ui): show the full tool request in an approval panel - #47

Merged
kacigaya merged 2 commits into
mainfrom
feat/tui-approval-panel
Nov 6, 2026
Merged

kacigaya merged 2 commits into
mainfrom
feat/tui-approval-panel

Conversation

@kacigaya

@kacigaya kacigaya commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Tool approval is the one moment the agent waits for a person, but the request was hard to read. It showed as one transcript line with the policy reason joined to the arguments by a semicolon. The status line cut long commands. The input box only said Approve tool? y / N.

Approval requests now open a panel above the input. The panel shows the tool name, the full arguments, the policy reason on its own why line, and the keys: y run once, n deny, esc stop turn. Long commands wrap inside the panel and are not cut. The transcript records only the answer. A denial shows in red with the denied arguments.

The palette also gives each color one job. Before, one violet filled 5 of the 9 palette names.

Role Color Used for
Accent violet (unchanged) Logo, prompt, selection, key hints, inline code
Attention ANSI yellow Approval panel, spinner, waiting state
Success ANSI green Added diff lines
Danger ANSI red Errors, denials, removed diff lines
Text terminal default Messages, headings, code blocks, and the input border

The new colors are named ANSI colors, so they follow the user's terminal theme.

Real screen captures showed two older bugs, and this PR fixes them too:

  • Transcript lines dropped their line-level style when joined to the role bullet. Code and diff colors never showed.
  • Text streamed before a tool call was discarded. Text streamed before a denied approval was joined to the next reply (…confirm it.## Finding). Both now go to the transcript before the tool event.

Key behavior does not change: n and Enter deny, and Esc stops the turn. The approval event now carries reason as a separate field. agent.rs no longer joins it into args_summary.

Validation:

  • cargo fmt -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test: 208 tests passed, including new tests for the approval panel, the transcript viewport, diff colors, and streamed text around tool events
  • One-off TestBackend render at 96×24, not kept in the branch: a long curl command wraps inside the panel
  • Real binary in a 100×30 pseudo-terminal against a local mock Ollama server: home, /model, the approval panel, and the reply after a denial. The tools ran on a sample workspace.
  • Website bun run test and bun run build, for the docs change

Cloud providers were not called.

Approval requests were a single transcript line with the policy reason
joined to the arguments, and the status line cut long commands.

Add a reason field to ApprovalRequired and render requests in a panel
above the input that wraps the full command. Give each palette color
one role so violet no longer marks every element.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Transcript lines dropped their line-level style when merged with the
role bullet, so code and diff colors never showed. Streamed text before
a tool call was discarded, and text before a denied approval was glued
to the next reply. Flush it to the transcript instead.
@kacigaya
kacigaya merged commit dba4f17 into main Nov 6, 2026
7 checks passed
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