feat: add ability to see live output of commands#1665
feat: add ability to see live output of commands#1665sethigeet wants to merge 8 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: 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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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; | ||
| } |
There was a problem hiding this comment.
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.


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
UI Changes
A "Show Output" button is added for the commands:
Checklist
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 relevanttool.startedentries and to merge ephemeral command output into matching work-log rows usingitemId, 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/datain tool lifecycle activity payloads while explicitly not persistingcommand_outputdeltas.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
subscribeProviderRuntimeToolOutputEvents) that streamscontent.deltaevents withstreamKind === 'command_output'from the provider runtime to the client.runtimeToolOutputStore.ts, a Zustand store that accumulates streaming command output per thread and item, capped at 24,000 characters per item.session-logic.tsto includetool.startedentries for command and file change activities, attach live output byitemId, and collapse lifecycle entries (started/updated/completed) more robustly.Macroscope summarized 72ef2d3.