Skip to content

feat(desktop): improve tool call detail views - #69868

Merged
ethernet8023 merged 3 commits into
mainfrom
ethie/tool-call-nicer
Jul 23, 2026
Merged

feat(desktop): improve tool call detail views#69868
ethernet8023 merged 3 commits into
mainfrom
ethie/tool-call-nicer

Conversation

@ethernet8023

@ethernet8023 ethernet8023 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Improves Hermes Desktop tool-call detail views so useful product UI does not get buried under raw payloads:

  • failed image-generation calls now use the readable fallback row;
  • normal web-search details no longer duplicate structured results as raw JSON;
  • Technical Mode formats object/array payloads with indented JSON while preserving ordinary scalar strings;
  • terminal calls render a terminal-style command transcript with an exit code before ANSI-safe stdout/stderr.

Related Issue

No related issue.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • apps/desktop/src/components/assistant-ui/tool/fallback.tsx: simplify normal tool detail views, format Technical Mode payloads, and render terminal command/exit metadata.
  • apps/desktop/src/components/assistant-ui/tool/fallback-model/{index,types}.ts: expose terminal command and exit-code presentation data.
  • apps/desktop/src/components/assistant-ui/thread/message-parts.tsx: route malformed/failed image generation results to the fallback row.
  • Focused model, fallback, and renderer regression tests cover readable image failures, Technical Mode formatting, and terminal transcript rendering.

How to Test

  1. Run nix develop -c npm run check --workspace=apps/desktop.
  2. Expand a completed terminal tool call in Desktop and verify the $ command, exit code, and stdout/stderr render.
  3. Enable Appearance → Tool call view → Technical and expand a tool call with object or array arguments/results; JSON should be indented.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: NixOS / Linux

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A: no user-facing docs change is needed
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A: presentation-only React/CSS change covered by TypeScript tests
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A: tool behavior/schema unchanged

Screenshots / Logs

Captured from a seeded Desktop session in WLR_BACKENDS=headless cage via Playwright. Each image is pinned to evidence commit d2b28403d5b75893548c5e96f1136e5a3b8fb60f.

Terminal — one reconciled completed row, command transcript, stdout, and exit status

Terminal tool call

Web search — query at the top, above structured results

Web-search tool call

Image generation failure — readable fallback instead of a blank result

Image-generation error tool call

Technical Mode — indented payload arguments for every changed row

Technical-mode tool calls

Verification

  • nix develop -c npm run check --workspace=apps/desktop: 2,649 passed, 3 skipped; renderer/Electron production builds and Linux unpacked package passed.
  • nix develop -c npm run test --workspace=apps/desktop -- --run src/lib/chat-messages.test.ts src/components/assistant-ui/tool/fallback-model.test.ts: 63 passed.
  • Deterministic visual capture passed in Cage: nix develop -c env WLR_BACKENDS=headless cage -- npx playwright test e2e/pr-tool-call-evidence.spec.ts.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 06ee9d4

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence is publishing...

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) tool/vision Vision analysis and image generation tool/web Web search and extraction tool/terminal Terminal execution and process management labels Jul 23, 2026
Show failed image-generation calls through the normal fallback row, remove duplicate normal-mode web-search JSON, and format Technical Mode payloads as readable JSON.
Show terminal commands with a prompt and exit status, then reveal ANSI-safe stdout and stderr in the expanded tool row.
Match context-only tool starts with command-bearing completions when their IDs differ, preventing stale duplicate terminal rows. Show the web-search query above its result cards.
@ethernet8023
ethernet8023 force-pushed the ethie/tool-call-nicer branch from 0d8f525 to 06ee9d4 Compare July 23, 2026 05:15
@ethernet8023
ethernet8023 merged commit 26f1f6a into main Jul 23, 2026
30 checks passed
@ethernet8023
ethernet8023 deleted the ethie/tool-call-nicer branch July 23, 2026 05:27
Digidash23 added a commit to Digidash23/hermes-agent that referenced this pull request Jul 23, 2026
Ports upstream's feat(desktop): improve tool call detail views (NousResearch#69868,
26f1f6a) into apps/ccf, which has its own diverged copy of this
rendering (our tool-diffs store shape differs from desktop's). Isolated
the exact diff this one commit made (not the accumulated drift between
the two apps) and applied it precisely:

- fallback-model/types.ts + index.ts: new searchQuery/terminalCommand/
  terminalExitCode view fields, shellCommand() helper extracted
- fallback.tsx: terminal tool calls now render as a transcript ($ prompt
  + exit code badge, expandable to ANSI-safe stdout/stderr) instead of
  raw JSON; Technical Mode payloads pretty-print with JSON.stringify(…,
  null, 2) and labeled Arguments/Result sections instead of compact
  unlabeled JSON; web-search results show their query above the hit list
- message-parts.tsx: a failed/malformed image-generation result now
  falls through to the normal tool row (readable error) instead of the
  image card silently rendering nothing
- chat-messages.ts: tool-call reconciliation now also matches on
  command/code/path, not just search_term/query/question — a context-only
  tool-start and its command-bearing completion correlate correctly even
  when their IDs differ, preventing stale duplicate terminal rows

Verified live: ran a real terminal command through CCF, confirmed the
transcript renders with the $ prompt and exit code badge.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
* fix(desktop): improve fallback tool-call details

Show failed image-generation calls through the normal fallback row, remove duplicate normal-mode web-search JSON, and format Technical Mode payloads as readable JSON.

* feat(desktop): render terminal tool calls as transcripts

Show terminal commands with a prompt and exit status, then reveal ANSI-safe stdout and stderr in the expanded tool row.

* fix(desktop): reconcile tool calls by command

Match context-only tool starts with command-bearing completions when their IDs differ, preventing stale duplicate terminal rows. Show the web-search query above its result cards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have tool/terminal Terminal execution and process management tool/vision Vision analysis and image generation tool/web Web search and extraction type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants