Repository navigation
Add /copy to copy the last assistant reply (#493) - #1664
Conversation
Adds /copy to the composer palette. It copies the newest finished assistant reply as Markdown and flashes "Copied last reply" on the composer status strip. An empty thread is a no-op. The per-message copy button already existed; it now has test coverage for copying an older turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb2a98a035
ℹ️ 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".
| m.role === "assistant" && | ||
| !m.thinking && | ||
| m.id !== streamingMessageId && | ||
| m.text.trim() !== "", |
There was a problem hiding this comment.
Exclude every message from the active run
When a working turn emits assistant text and then starts a tool, the runners append the tool after that assistant message, so useTranscriptAnnotations sets streamingMessageId to null because the last message is no longer an assistant. Invoking /copy during the tool then selects the current turn's pre-tool commentary instead of the previous completed reply (and does so even when no completed reply exists). Exclude assistant messages belonging to the active run while the thread is working, rather than excluding only streamingMessageId.
Useful? React with 👍 / 👎.
Typing
/copyin the composer now copies the latest assistant reply on the thread as Markdown, like/copyin the Kimi and Grok CLIs. Before this, getting an answer into a PR description or Slack meant drag-selecting a bubble that re-renders on every stream tick. Closes #493.Changes
/copyis a new run verb in the/palette. It copies the newest assistant reply that has text. Tool cards, thinking, and a reply that is still streaming are skipped. On an empty thread it does nothing.Verification
tsc --noEmitis clean.slashCommands.test.ts16/16 pass.composerSlashActions,composerCommands,threadHeaderandthreadView230/230 pass. The new tests cover/copyon the latest reply with a tool card after it, the per-message button on an older reply, and/copyon an empty thread.threadHeader.test.tsx, and that file passed 2/2 when rerun on its own.Notes for reviewers
/copycopies the previous finished reply, not the partial one.🤖 Generated with Claude Code