Allow /copy to copy status output and individual fields (#43055)

## Why

`/copy` only offered the last assistant response and its code blocks or quotes, leaving `/status` output unavailable in the copy picker.

## What changed

After `/status`, offer the whole status as plain text, the model, the full directory path, and the thread name and session ID when present. Preserve the displayed status fields across repeated copies and include refreshed rate limits in whole-status copies.

Return to assistant-response copying after a later user message, assistant response, or command other than `/copy`. Rename the picker to “Copy to clipboard”.

## Testing

Add snapshots and regression tests covering status text and field selection, missing fields, full directory paths, repeated copying, refreshed limits, and returning to response copying after subsequent turns and commands, including queued commands.

GitOrigin-RevId: 9424cdca9753c834971992ca29494161957b50c4
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-05 16:43:40 +00:00
1 parent 89208f09f8
commit 52e73e3a54
12 files changed
+367 -79

No files matched your search

@@ -0,0 +1,14 @@
---
source: tui/src/chatwidget/tests/slash_commands.rs
assertion_line: 2032
expression: "render_bottom_popup(&chat,\n100).replace(&directory,\n\"[[workspace]]\").replace(crate::version::CODEX_CLI_VERSION, \"VERSION\")"
---
Copy to clipboard
› 1. Whole status >_ OpenAI Codex (vVERSION)
2. Model gpt-5.4
3. Directory [[workspace]]
4. Thread name Clipboard example
5. Session ID 00000000-0000-0000-0000-000000000123
Press enter to confirm or esc to go back
@@ -0,0 +1,20 @@
---
source: tui/src/chatwidget/tests/slash_commands.rs
assertion_line: 2041
expression: "whole_status.replace(&directory,\n\"[[workspace]]\").replace(crate::version::CODEX_CLI_VERSION, \"VERSION\")"
---
>_ OpenAI Codex (vVERSION)
Visit https://chatgpt.com/codex/settings/usage for up-to-date
information on rate limits and credits
Model: gpt-5.4 (reasoning medium, summaries auto)
Directory: [[workspace]]
Permissions: Read Only (Ask for approval)
Agents.md: <none>
Thread name: Clipboard example
Collaboration mode: Default
Session: 00000000-0000-0000-0000-000000000123
Token usage: 0 total (0 input + 0 output)
Limits: data not available yet