Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Groups 3+ consecutive bash_output tool calls to the same process_id in the UI:

  • Shows first call with 'start' indicator
  • Shows collapsed indicator with squiggly line showing count of hidden calls
  • Shows last call with 'end' indicator

This reduces visual clutter when agents poll background processes repeatedly, while preserving access to first and last output.

Changes

  • Added groupConsecutiveBashOutput() function in messageUtils.ts to transform message arrays
  • Created BashOutputCollapsedIndicator component with squiggly line SVG
  • Updated BashOutputToolCall to show group position (start/end)
  • Applied grouping in AIView.tsx message pipeline
  • Added unit tests and a story to demonstrate the behavior

Generated with mux

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Groups 3+ consecutive bash_output tool calls to the same process_id:
- Shows first call with 'start' indicator
- Shows collapsed indicator with squiggly line and count
- Shows last call with 'end' indicator

This reduces visual clutter when agents poll background processes
repeatedly, while preserving access to first and last output.
- Replace groupConsecutiveBashOutput() with computeBashOutputGroupInfo()
- Compute grouping inline during render loop instead of array transformation
- Skip middle items (return null) and render collapsed indicator after first
- Simplify MessageRenderer to use DisplayedMessage (no synthetic types)
- Update tests for new function signature

This fixes the issue where grouped items rendered as generic tool calls
instead of BashOutputToolCall components.
The type guard for bash_output validates against the Zod schema which
requires timeout_secs. The mock was missing this field, causing the
type guard to fail and fall back to GenericToolCall.
Add debug logging to trace bash_output grouping (temporary)
- Add isExpanded and onToggle props to BashOutputCollapsedIndicator
- Track expanded groups in AIView state (keyed by first message ID)
- Add firstIndex to BashOutputGroupInfo for reliable group identification
- Middle items are shown when group is expanded, hidden when collapsed
- Indicator shows 'Show/Hide X more output checks' with visual feedback
The full-width button caused the tooltip to appear in the middle of
the chat view. Now the button is inline-flex and the tooltip is removed
since the text already indicates the action (Show/Hide).
@ammario
Copy link
Member

ammario commented Dec 10, 2025

Will leave this as a maybe depending on bash spam behavior.

@ammario ammario merged commit 087ebb9 into main Dec 10, 2025
20 checks passed
@ammario ammario deleted the bash-output-grouping branch December 10, 2025 15:57
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.

2 participants