Skip to content

feat(display): configurable tool preview length -- show full paths by default#3841

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-ac2495d7
Mar 30, 2026
Merged

feat(display): configurable tool preview length -- show full paths by default#3841
teknium1 merged 1 commit intomainfrom
hermes/hermes-ac2495d7

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Tool call previews (paths, commands, queries) were hardcoded to truncate at 35-40 chars across CLI spinners, completion lines, and gateway progress messages. Users couldn't see full file paths like ~/projects/lynis-compliance/ansible/inventory.yml — they'd get ~/projects/lynis-compliance/ansible/i... instead.

New config option: display.tool_preview_length (default 0 = no limit). Set a positive number to truncate at that length.

Before (hardcoded 35-40 char truncation)

┊ ✍️  write     ...nested/path/test-output.txt  0.7s
┊ 📖 read      ...ompliance/ansible/inventory.yml  0.7s

After (default: full paths)

┊ ✍️  write     /tmp/hermes-test-preview-length/deeply/nested/path/test-output.txt  0.7s
┊ 📖 read      ~/projects/lynis-compliance/ansible/inventory.yml  0.7s

Changes

  • display.py: Module-level _tool_preview_max_len with getter/setter. build_tool_preview() and get_cute_tool_message() _trunc/_path helpers respect it.
  • cli.py: Reads config at startup, spinner widget respects config instead of hardcoded 50-char cap.
  • gateway/run.py: Reads config per-message, progress callback respects config instead of hardcoded 80-char cap.
  • run_agent.py: Removed redundant 30-char quiet-mode spinner truncation.
  • config.py: Added display.tool_preview_length: 0 to DEFAULT_CONFIG.

Config

display:
  tool_preview_length: 0    # 0 = no limit (default), or set chars to truncate

Testing

  • 285 tests pass (display, run_agent, cli_init, config)
  • Live E2E tested with hermes chat -q — full paths visible in spinner, completion lines, and preparing messages.

Reported by @kriskaminski in Discord.

… default

Tool call previews (paths, commands, queries) were hardcoded to truncate
at 35-40 chars across CLI spinners, completion lines, and gateway progress
messages. Users could not see full file paths in tool output.

New config option: display.tool_preview_length (default 0 = no limit).
Set a positive number to truncate at that length.

Changes:
- display.py: module-level _tool_preview_max_len with getter/setter;
  build_tool_preview() and get_cute_tool_message() _trunc/_path respect it
- cli.py: reads config at startup, spinner widget respects config
- gateway/run.py: reads config per-message, progress callback respects config
- run_agent.py: removed redundant 30-char quiet-mode spinner truncation
- config.py: added display.tool_preview_length to DEFAULT_CONFIG

Reported by kriskaminski
@teknium1 teknium1 merged commit e314833 into main Mar 30, 2026
4 of 5 checks passed
itsXactlY pushed a commit to itsXactlY/hermes-agent that referenced this pull request Mar 30, 2026
… default (NousResearch#3841)

Tool call previews (paths, commands, queries) were hardcoded to truncate
at 35-40 chars across CLI spinners, completion lines, and gateway progress
messages. Users could not see full file paths in tool output.

New config option: display.tool_preview_length (default 0 = no limit).
Set a positive number to truncate at that length.

Changes:
- display.py: module-level _tool_preview_max_len with getter/setter;
  build_tool_preview() and get_cute_tool_message() _trunc/_path respect it
- cli.py: reads config at startup, spinner widget respects config
- gateway/run.py: reads config per-message, progress callback respects config
- run_agent.py: removed redundant 30-char quiet-mode spinner truncation
- config.py: added display.tool_preview_length to DEFAULT_CONFIG

Reported by kriskaminski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant