Skip to content

feat: add ability to see live output of commands#1665

Open
sethigeet wants to merge 8 commits intopingdotgg:mainfrom
sethigeet:feat/cmd-outputs
Open

feat: add ability to see live output of commands#1665
sethigeet wants to merge 8 commits intopingdotgg:mainfrom
sethigeet:feat/cmd-outputs

Conversation

@sethigeet
Copy link
Copy Markdown

@sethigeet sethigeet commented Apr 1, 2026

I know this is not exactly a small PR, but its not really that huge and most of the stuff is boilerplate + tests and there aren't a lot of complicated changes.

What Changed

The tool calls are shown in the UI when they start (this is especially useful for seeing that the model ran a command like running tests or benchmarks which can take significant time and the user is not stuck seeing "working...") and the output of the terminal commands are streamed into the UI (just kept in memory for the current session, not persisted, just like the Codex App) so that the user can see what's happening

Why

  • It's useful to see what the model is running as soon as it starts running it (rather than after it completes running it) so that we can stop it if its doing something wrong (for example, it might not be using something from our build system by default due to it not being mentioned in the Agents.md (or equivalent) and we can stop the model and ask it to change).
  • Its also useful to see the outputs of the commands that the agent has run due to obvious reasons!

UI Changes

A "Show Output" button is added for the commands:

image image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Adds a new WebSocket stream and client-side buffering/merging logic for provider runtime command_output, which could affect event ordering, memory usage, and work-log collapsing behavior across threads/turns.

Overview
Adds end-to-end streaming of provider runtime command stdout into the web app via a new WS RPC subscription (subscribeProviderRuntimeToolOutputEvents) and corresponding client API wiring.

On the web side, introduces an in-memory runtimeToolOutputStore (per thread + itemId, size-capped) and updates chat/work-log derivation to include relevant tool.started entries and to merge ephemeral command output into matching work-log rows using itemId, with more robust lifecycle collapsing for concurrent/replayed commands.

UI updates the work log to show a per-entry Show/Hide output toggle (collapsed by default), and orchestration batching now clears buffered runtime output on turn start and thread deletion. Server ingestion is adjusted to include itemId/data in tool lifecycle activity payloads while explicitly not persisting command_output deltas.

Written by Cursor Bugbot for commit 72ef2d3. This will update automatically on new commits. Configure here.

Note

Add live command output streaming to chat work log entries

  • Introduces a new WebSocket subscription (subscribeProviderRuntimeToolOutputEvents) that streams content.delta events with streamKind === 'command_output' from the provider runtime to the client.
  • Adds runtimeToolOutputStore.ts, a Zustand store that accumulates streaming command output per thread and item, capped at 24,000 characters per item.
  • Extends work log derivation in session-logic.ts to include tool.started entries for command and file change activities, attach live output by itemId, and collapse lifecycle entries (started/updated/completed) more robustly.
  • Renders a collapsible

Macroscope summarized 72ef2d3.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 90677d94-ec15-4c93-827d-4e10705bb392

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 1, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 1, 2026

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature for live command output streaming, including a new state store, WebSocket subscription, UI components, and significant logic changes across multiple layers. New features of this scope warrant human review regardless of code quality.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}
if (normalizedLabel.length === 0 && itemType.length === 0) {
return undefined;
}
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.

Dead code: impossible condition inside guarded branch

Low Severity

Inside the if (itemType === "command_execution" || itemType === "file_change") branch of deriveToolLifecycleCollapseKey, the condition normalizedLabel.length === 0 && itemType.length === 0 can never be true because itemType is guaranteed to be a non-empty string ("command_execution" or "file_change") by the enclosing guard. This dead check makes the function harder to reason about and could mislead future readers into thinking there's a path where itemType is empty in this branch.

Fix in Cursor Fix in Web

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant