Skip to content

Add an Edit Queued button while Claude has queued prompts - #15258

Closed
teamleaderleo wants to merge 6 commits into
feat/agent-action-buttonsfrom
feat/agent-edit-queued
Closed

teamleaderleo wants to merge 6 commits into
feat/agent-action-buttonsfrom
feat/agent-edit-queued

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Second slice of #15223, stacked on #15234. With Settings > Terminal > Agent Edit Queued Button on (agentActions.promptEditing, off by default), the terminal's agent pill shows Edit Queued while Claude Code has prompts waiting in its input queue. Clicking it sends Up, Claude's own key for moving queued prompts back into the input so you can edit them.

  • Knowing what's queued: Claude writes its queue to the session transcript as queue-operation lines: enqueue (with the prompt), then dequeue (sent as the next turn), remove (absorbed into the running turn or delivered), or popAll (pulled back with Up). ClaudeQueuedPromptLedger (CmuxAgentChat) folds those lines and ignores everything else.
  • Following the pane's session: ClaudeQueuedPromptMonitor reads the hook store's activeSessionsBySurface pointer for the pane, so a nested claude -p run in the pane is never mistaken for the pane's session. It folds the last 512 KB of that transcript, then only appended bytes, using the existing FileWatcher. It runs only while Claude is running in the pane with the setting on, and stops when either changes.
  • The button: it sits beside Stop in the same pill, shows only for Claude with a non-empty queue, and hides as soon as it's clicked. The click is re-checked against the pane's lifecycle, so a late click sends nothing. Codex has a queue too (Alt+Up edits it), but its transcript doesn't record it, so Codex gets no button yet.
  • Known limit: Up pulls back queued prompts only when the input cursor is on its first line. With a multi-line draft and the cursor lower down, Up moves the cursor instead.

Testing

  • swift test --package-path Packages/Shared/CmuxAgentChat --filter ClaudeQueuedPromptLedgerTests (local, 3 passed): enqueue, absorbed remove, dequeue, and popAll; unrelated lines and stray resolutions are ignored; tracking is bounded.
  • The ledger's semantics were checked against about 80,000 queue-operation lines in local Claude transcripts. The operations seen were enqueue, dequeue, remove (reasons absorbed_mid_turn and delivered_to_agent), and popAll.
  • cmuxTests/TerminalAgentQueuedPromptTests.swift (added, runs in CI):
    • The monitor follows the active session, not a newer nested entry, and reports 1 then 0 as the transcript grows.
    • Edit Queued shows for running Claude with queued prompts, sends exactly one key event, and hides.
    • It never shows for Codex or with the setting off.
  • python3 scripts/verify-local.py (15/15) and python3 tests/test_cmux_settings_supported_paths.py passed.
  • Not yet run: a tagged build with a live Claude queue. Screenshots will be added before merge.

Changelog

Added: An optional Edit Queued button over a terminal moves Claude Code's queued prompts back into its input (Settings > Terminal > Agent Edit Queued Button).

Demo Video

Pending dogfood on a tagged build.

🤖 Generated with Claude Code


Summary by cubic

Adds an optional Edit Queued button to the terminal's agent pill while Claude Code has prompts waiting in its input queue. Off by default behind the new agentActions.promptEditing setting, clicking it sends Up, Claude's own key for moving queued prompts back into the input for editing.

  • Queue tracking: a ledger folds queue-operation lines (enqueue, dequeue, remove, popAll) from the active session's transcript and ignores Claude's own task notifications and queued shell commands, which Up doesn't pull back.
  • A monitor tails the transcript only while Claude runs in the pane with the setting on, retrying for up to 10 seconds if the transcript isn't recorded yet.
  • Clicking sends one Up; quick repeat clicks send one, and the button stays until the transcript reports the queue emptied, so it doesn't hide if Up just moved the cursor in a multi-line draft.
  • Codex gets no button because its transcript doesn't record its queue.

Written for commit 66705c8. Summary will update on new commits.

Review in cubic

Behind the new agentActions.promptEditing setting (off by default), the
terminal's agent pill shows Edit Queued while Claude Code has prompts
waiting in its input queue. Clicking it sends Up, Claude's own key for
moving queued prompts back into the input.

Claude records its queue in the session transcript as queue-operation
lines (enqueue, then dequeue, remove, or popAll). ClaudeQueuedPromptLedger
folds them; ClaudeQueuedPromptMonitor tails the transcript of the session
the hook store marks active on the pane, only while Claude runs there with
the setting on.

Part of #15223.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f7b9d4db-c5a6-4517-8353-684900507a86

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

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 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Dogfood build of 66705c86c3c992cfcf18a0915805594972f881e2

cmux DEV pr-15258-66705c86.app

The link opens this exact commit in the cmux dev menu bar app. The build starts on each push and the page waits until it is ready; a newer push replaces it. It signs in against production, so Cloud or backend changes still need a tagged build with a development backend.

Dogfood tours of 66705c86

sidebar-and-chrome-tour at 66705c86: not run (run)

skipped: the tour job left no result; the next CI attempt tries again

Tours are picked by the paths globs in dogfood/scenarios/*.json; a Dogfood-tours: a, b line in the description picks them instead (none turns this off). Look at every frame before merging: a green tour only means no step failed.

Review fixes, checked against local Claude transcripts:
- Claude queues its own task notifications and queued shell commands.
  Up doesn't pull those back and notifications are often never resolved,
  so the ledger ignores them. Folding 1,290 local sessions now leaves only
  7 (all live) with anything queued, instead of a stuck count in finished
  sessions.
- popAll is written once per pulled-back prompt with that prompt, so it is
  folded like remove.
- Clicking Edit Queued no longer hides the button until the transcript
  says the queue emptied. If Up only moved the cursor in a multi-line
  draft, the button stays. Quick repeat clicks send one Up.
- The monitor retries for up to 10 s when the transcript isn't recorded
  yet, stops cleanly mid-start, and reads the Claude hook store through
  RestorableAgentKind.hookStoreFileURL, which honors
  CMUX_AGENT_HOOK_STATE_DIR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	cmux.xcodeproj/project.pbxproj
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

CI failure attribution

CI failed on 66705c86c3 (run 36438658600 attempt 2): 1 code.

Job Verdict Why
macos / app-host unit tests (5/7) code a test failed
Matched log lines
macos / app-host unit tests (5/7): ✘ Test fallsBackToSystemBlueWhenUnset() recorded an issue at KeyboardShortcutModifierHoldHintsSettingsFileTests.swift:213:9: Expectation failed: (WorkspaceAttentionColor(configuredHex: nil).nsColor.hexString() → "#0088FF") == (NSColor.systemBlue.hexString() → "#007AFF")

Not re-run automatically: macos / app-host unit tests (5/7) is not a machine failure.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's.

@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

CountRecorder is main-actor isolated, so the test that creates it must
be too; the app-host test build failed on it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 6, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Parked: stale stacked queued-prompt editing slice with base conflicts; needs a dedicated rebase pass.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Reopen if needed.

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.

2 participants