Agent Mode: add copy buttons to chat log - #630
Conversation
📝 WalkthroughWalkthroughAdds a shared ChangesChat copy controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AgentTimeline
participant AgentMode
participant ChatCopyButton
participant Clipboard
AgentTimeline->>AgentMode: derive copy text for grouped turn
AgentMode->>ChatCopyButton: render copy action
ChatCopyButton->>Clipboard: write turn text
Clipboard-->>ChatCopyButton: report copy result
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Deploying maple with
|
| Latest commit: |
295602b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3ed15003.maple-ca8.pages.dev |
| Branch Preview URL: | https://codex-agent-chat-copy-button.maple-ca8.pages.dev |
275bc29 to
b21eced
Compare
|
Agent Mode should copy only the final assistant content message in a turn, rather than concatenating every assistant message around tool calls. For a turn like:
please have the copy action copy only the final assistant message. The earlier assistant messages, thinking, tools, tool results, permissions, system events, and errors should not be included. Please also suppress the copy action on the currently active assistant turn until the run finishes, since otherwise an intermediate assistant message temporarily becomes copyable. Copy actions on earlier completed turns should remain available. A focused test should cover |
b21eced to
295602b
Compare
|
Addressed in 295602b.
Validation: 93 tests pass, production build passes, and lint completes with 0 errors (12 existing warnings). |
AnthonyRonning
left a comment
There was a problem hiding this comment.
Reviewed the updated implementation at 295602b. The final-message-only copy behavior and active-turn suppression match the requested Agent Mode behavior, with focused test coverage. Local validation passed; approving pending completion of the remaining required CI builds.
Summary
ChatCopyButtonWhy
Agent Mode already reused the standard chat turn layout, but it did not wire actions into those shared turn shells. The existing clipboard control was private to
UnifiedChat, so Agent Mode could not reuse it without first extracting the component.Validation
bun test— 93 passedbun run lint— 0 errors (12 pre-existing warnings)bun run buildbun run formatCloses #629
Summary by CodeRabbit
New Features
Bug Fixes
Tests