Skip to content

feat(tui): show tool subcommand line under tool calls - #257

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/tool-subcommand-line
Aug 5, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/tool-subcommand-line

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

What

Always-visible subcommand line under each tool call in the conversation panel, so the operator sees what was actually invoked without expanding via Ctrl+O.

✓ Repository explored          [Ctrl + o]
  └─ $ git status --short · 12 output lines

How

  • New forge_tools::tool_invocation(name, args) formatter (crates/forge-tools/src/invocation.rs) — each built-in tool's invocation string (git → git status --short, bash/exec → $ cmd, read/write → path, fffind/ffgrep/web_search → query/pattern, load_skill → name).
  • ChatItem::ToolCard carries the invocation; ActivityGroupPresentation.subcommands: Vec<String> feeds the renderer (0-1 per call today; the ├─/└─/│ glyph set already supports multiple children).
  • Long invocations wrap with the connector carried down instead of truncating at 80 chars.
  • [Ctrl + o] hint replaces · Ctrl+O details (no Shift needed).
  • Validation commands keep their Tests passed/failed phrase on the subcommand line (derived from the real outcome, never rendered text).
  • Sensitive invocations are redacted like other tool output.

Out of scope

  • Render-only tools (apply_patch, write_stdin, update_plan) and MCP/remote tools keep the old single-line form.
  • Grouped routine-activity fan-out (Vec field is ready; no current tool emits multiple commands).

Validation

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings clean
  • cargo test --package forge-tools: 158 passed
  • cargo test --package forge-tui --lib: 740 passed
  • New tests: invocation formatter (forge-tools), connector-line render, write-tool path, render-only fallback, validation phrase, sensitive redaction.

Note: 3 forge-config permissions tests fail on this machine (merged.allow not empty) because they read the developer's real user-level ~/Library/Application Support/forge/permissions.toml. Confirmed via git stash that they fail on clean main too — pre-existing environmental, unrelated to this change.

… panel

Render the actual invocation (git status --short, $ cargo test, path,
query) on an always-visible connector line under each tool call, instead
of burying it behind the Ctrl+O expanded output. Tools emit their own
invocation formatter (forge-tools::tool_invocation); render-only tools
(apply_patch, write_stdin, update_plan) and MCP calls keep the old
single-line form. Long invocations wrap with the tree connector carried
down. Validation commands keep their Tests passed/failed phrase, and
sensitive invocations are redacted.
@github-actions
github-actions Bot enabled auto-merge (squash) August 5, 2026 10:17
@github-actions
github-actions Bot merged commit 4a417e9 into main Aug 5, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
… panel (#257)

Render the actual invocation (git status --short, $ cargo test, path,
query) on an always-visible connector line under each tool call, instead
of burying it behind the Ctrl+O expanded output. Tools emit their own
invocation formatter (forge-tools::tool_invocation); render-only tools
(apply_patch, write_stdin, update_plan) and MCP calls keep the old
single-line form. Long invocations wrap with the tree connector carried
down. Validation commands keep their Tests passed/failed phrase, and
sensitive invocations are redacted.
mohitranka added a commit that referenced this pull request Sep 11, 2026
… panel (#257)

Render the actual invocation (git status --short, $ cargo test, path,
query) on an always-visible connector line under each tool call, instead
of burying it behind the Ctrl+O expanded output. Tools emit their own
invocation formatter (forge-tools::tool_invocation); render-only tools
(apply_patch, write_stdin, update_plan) and MCP calls keep the old
single-line form. Long invocations wrap with the tree connector carried
down. Validation commands keep their Tests passed/failed phrase, and
sensitive invocations are redacted.
mohitranka added a commit that referenced this pull request Sep 11, 2026
… panel (#257)

Render the actual invocation (git status --short, $ cargo test, path,
query) on an always-visible connector line under each tool call, instead
of burying it behind the Ctrl+O expanded output. Tools emit their own
invocation formatter (forge-tools::tool_invocation); render-only tools
(apply_patch, write_stdin, update_plan) and MCP calls keep the old
single-line form. Long invocations wrap with the tree connector carried
down. Validation commands keep their Tests passed/failed phrase, and
sensitive invocations are redacted.
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.

1 participant