Skip to content

Make quick-action output inspectable in the transcript - #1633

Merged
currentbits merged 2 commits into
mainfrom
coder/p2-make-quick-action-output-inspectable--169715
Oct 13, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/p2-make-quick-action-output-inspectable--169715

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Setup and quick-action runs now keep their output in the transcript, so you can read it, copy it, or attach it to the next prompt without running the command again (#1216).

What changed

Main process (electron/projectCommands.js)

  • The end event for each run now stores the whole CommandRunResult as a new commandResult field. Two runs of the same action stay separate, and the output is still there after a remount because it's read back from the transcript.
  • The log is bounded with tailLog at this point as well. A swapped runner or a thrown error doesn't go through the usual tailing, so this catches those cases.
  • The result now records cwd, the checkout the command ran in.
  • The end event's text is now just the summary line ([name] failed: exit N in Xs). The old failure tail that was pasted into the event text (EVENT_LOG_MAX) has been removed.
  • appendEvent takes an optional extra object whose fields are merged onto the message.

Shared types (src/shared/ipc.ts)

  • New ChatMessage.commandResult?: CommandRunResult.
  • New CommandRunResult.cwd?: string.

Renderer

  • Events that carry a commandResult are rendered by a new CommandResultEvent in messages.tsx:
    • It shows a summary line that expands to the output in a bounded, scrollable <pre> (max 320px).
    • The output starts open when the run failed and collapsed when it succeeded.
    • Copy puts $ <command> followed by the output on the clipboard.
    • Add to prompt attaches the output to the thread's draft as a terminal context chip. Nothing is sent.
    • Both buttons use only the selected text if there's a selection inside the output, otherwise all of it.
  • ThreadView passes addCommandOutput down, bound to the current thread. It is not passed for archived threads, so they show no Add to prompt button.
  • New commandOutputChip in contextChips.ts builds the chip: action summary, cwd, and the output. It keeps the end of the output within CONTEXT_BODY_CAP and marks how much was trimmed, because failing commands print their summary last.
  • The dev mock in src/dev/threads.ts attaches commandResult and cwd to its fake runs.

Tests

  • electron/test/project-commands.test.js: updated for the new event shape.
  • test/contextChips.test.ts: covers commandOutputChip.
  • test/threadHeader.test.tsx: covers rendering the output, Copy and Add to prompt.

🤖 Generated with Claude Code

Solenta-Message-Id: 73c3da83-259c-4c5a-9e1f-0e25b003e088
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T14:41:30.853012Z 6722277 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6722277e10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +459 to +460
appendEvent(store, threadId, eventText(resolved.name, "end", result), {
commandResult: result,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redact command output before persisting it

When a successful setup or quick action prints a value previously supplied through secret_request—for example, a test script echoes a credential read from the checkout—this stores and broadcasts that value verbatim. appendEvent writes through store.setMessages, bypassing the threadSecrets.redact call in Store.appendMessage, so the new commandResult.log can persist a secret that the store otherwise guarantees never to retain; redact the complete event before appending it.

Useful? React with 👍 / 👎.

Comment on lines +609 to +612
const c = chip();
void navigator.clipboard
?.writeText(`$ ${result.command}\n${c.text}`)
.then(() => flash("copied"), () => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Copy only the selected or complete command output

When Copy is clicked, chip() returns the terminal-chip text, which prepends the action summary and cwd to either the selected text or the full log. The clipboard therefore contains $ <command>, the summary, the checkout path, and then the output, even though the control promises to copy the output and a selection should restrict the copy to that selected output. Build the clipboard body directly from the selection or result.log, leaving the contextual chip formatting only for Add to prompt.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit ae55e87 into main Oct 13, 2026
6 checks passed
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.

1 participant