Skip to content

fix(tui): avoid double-formatting friendly tool labels - #62809

Open
CNSeniorious000 wants to merge 2 commits into
NousResearch:mainfrom
CNSeniorious000:fix/tui-friendly-tool-label-context
Open

fix(tui): avoid double-formatting friendly tool labels#62809
CNSeniorious000 wants to merge 2 commits into
NousResearch:mainfrom
CNSeniorious000:fix/tui-friendly-tool-label-context

Conversation

@CNSeniorious000

Copy link
Copy Markdown
Contributor

Summary

The TUI treated backend-formatted friendly tool labels as raw context and passed them through formatToolCall(...) again, duplicating the displayed action.

Changes

  • Keep raw tool context separate from the optional friendly label across live events and resumed history.
  • Render friendly labels directly while preserving legacy formatting for custom tools and disabled friendly labels.

Validation

  • Targeted tests/test_tui_gateway_server.py (3 passed)
  • bunx vitest run src/__tests__/text.test.ts src/__tests__/createGatewayEventHandler.test.ts src/__tests__/messages.test.ts (114 passed)
  • bun run typecheck
  • ESLint on all modified TUI files
  • git diff --check

Fixes #62796

@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists labels Jul 11, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tracing the producer/consumer contract across live events and resumed history. The core fix is needed: current main passes build_tool_label() through context (tui_gateway/server.py:3441-3445, :3595-3607), and Ink wraps that context (ui-tui/src/components/thinking.tsx:840; ui-tui/src/lib/text.ts:198-203).

Problems

  • delegate_task now renders as Delegating … (agent/display.py:582), but ToolTrail only detects Delegate Task at ui-tui/src/components/thinking.tsx:889 and :1066. After this PR's label pass-through at :840, delegated subagents no longer attach inline to their tool group and the /agents hint is omitted.

Suggested changes

  • Match both Delegate Task and Delegating through one predicate at both call sites, with a focused delegate-label/subagent rendering test.

Automated hermes-sweeper review.

Comment thread ui-tui/src/components/thinking.tsx
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TUI double-formats friendly tool labels

3 participants