nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] Tool output can only be expanded all-at-once, and some formatters have no line cap

Open addyCooks opened this issue 2 months ago • 1 comments

Description

The only way to see a tool result's full output is a single global toggle (Ctrl+O) that switches every tool result in the conversation between a compact one-liner and full formatter output at the same time. There's no way to expand just the one result you actually want. This is made worse by the fact that not every formatter caps its expanded output write_file's expanded view renders the entire file with no line limit, unlike execute_bash, which is capped at a fixed number of lines with a "+N earlier lines" indicator.

Parent: #907

Steps to Reproduce

  1. Have a conversation with a mix of tool calls, including at least one write_file on a large file.
  2. Press Ctrl+O to toggle compact/expanded display.
  3. Note it affects every tool result at once, and that the write_file result in expanded mode has no line cap.

Expected Behavior

Expanding a result should be a per-message action, and every formatter's expanded output should be capped at a reasonable length, the way execute_bash's already is.

Actual Behavior

Expand/collapse is global and binary; write_file in particular has no cap in expanded mode.

Recording

Image

Root Cause

source/utils/tool-result-display.tsx the compact parameter on displayToolResult, together with the ALWAYS_EXPANDED_TOOLS set, apply one boolean to every tool result uniformly. source/components/bash-progress.tsx caps execute_bash output at BASH_OUTPUT_DISPLAY_LINES; source/tools/file-ops/write-file.tsx's WriteFileFormatter has no equivalent cap.

Note: #769 (closed, fixed by merged PR #786) added a related but different 20,000-character cap that one bounds only the LLM-facing text of oversized results before they enter the conversation, explicitly keeping "structured tool payloads intact." It doesn't touch this terminal display, which reads args.content directly.

Suggested Fix

Replace the global toggle with a per-message expand affordance, and apply a display-level line cap to every formatter's expanded view, not just bash's.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs on the latest main

addyCooks avatar Sep 13 '26 20:09 addyCooks

Hey @akramcodez ! I’d be happy to take this one up could you assign it to me ?

addyCooks avatar Sep 13 '26 20:09 addyCooks