Skip to content

fix(web): show command output in work log#4083

Open
LikoKiko wants to merge 1 commit into
pingdotgg:mainfrom
LikoKiko:fix/4076-command-output
Open

fix(web): show command output in work log#4083
LikoKiko wants to merge 1 commit into
pingdotgg:mainfrom
LikoKiko:fix/4076-command-output

Conversation

@LikoKiko

@LikoKiko LikoKiko commented Jul 17, 2026

Copy link
Copy Markdown

What Changed

Fixes #4076.

Updated command work-log entries so they display:

  • The executed command once
  • The actual command output underneath it

The fix supports output from Codex and ACP-based providers such as Claude.

It also preserves the existing Cursor behavior when stdout is available but the original command input is missing.

Added focused regression tests covering:

  • Codex command output
  • Claude ACP stdout
  • Commands with no output
  • Cursor events without command metadata

Why

Command execution entries were sometimes showing the command twice instead of showing the command followed by its output.

This happened because the command text could be stored as both the command and detail, while the real provider output was not being selected for the expanded work-log entry.

The updated logic extracts the actual output only when the original command is available, preventing duplicated command text and avoiding misleading output-only rows.

UI Changes

This changes the content shown when expanding a command work-log entry:

Before

printf hello

printf hello

After

printf hello

hello

There are no visual styling or layout changes.

Testing

  • vp test apps/web/src/session-logic.command-output.test.ts — 3 tests passed
  • vp test apps/web/src/session-logic.test.ts — 59 tests passed
  • vp check — completed with 0 errors
  • git diff --check — passed
  • vp run test — attempted, but unrelated oxlint-plugin-t3code tests could not spawn the local Windows oxlint executable (ENOENT)

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

Low Risk
UI-only presentation logic in deriveWorkLogEntries with focused unit tests; no auth or data-path changes.

Overview
Fixes expanded command work-log rows that repeated the command string instead of showing stdout/provider output.

extractToolDetail now treats command executions specially: it ignores detail when it matches the extracted command, requires a known command before attaching output, and pulls text via new extractToolOutput (Codex aggregatedOutput, ACP rawOutput stdout/stderr, nested result/content, ACP text blocks via extractAcpTextContent), with exit-code suffix stripping. When there is no distinct output, detail is omitted so the row is command-only.

Adds session-logic.command-output.test.ts with regression cases for Codex, Claude ACP stdout, and silent commands.

Reviewed by Cursor Bugbot for commit c1189de. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Show command output instead of command text in work log entries

  • Adds extractToolOutput in session-logic.ts to retrieve normalized output from tool/command executions, checking aggregatedOutput, stdout/stderr, and ACP content arrays in priority order, stripping trailing exit code markers.
  • Updates extractToolDetail to prefer actual command output over echoing the command string, and returns null when no output is available instead of repeating the command.
  • Adds extractAcpTextContent to collect non-empty text from ACP-style { type: 'content', content: { type: 'text', text } } entry arrays.
  • Behavioral Change: work log entries for command activities now show output (or nothing) rather than the raw command text.

Macroscope summarized c1189de.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

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: f70d0e61-84a4-4dca-9123-57a0a30d42ed

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 17, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR adds new output extraction logic for displaying command results in the work log. While the changes are UI/display focused and well-tested, the author is new to this file and the extraction logic handles multiple payload formats, warranting human verification.

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

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

Labels

size:M 30-99 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.

[Bug]: Ran commands don't show output

1 participant