Repository navigation
fix(cli): queue remote prompts instead of dropping or overlapping turns - #226
Merged
Merged
Conversation
The supplementary dequeue drained every queued remote prompt while a turn was streaming, and a remote cancel could clear streaming while the previous query still owned current_query, so the next prompt replaced its handle. Primary-transport prompts skipped the queue entirely and spawned a query per message, so one poll batch started two API requests. Primary InboundPrompt now appends literal text to a local queue and keeps processing controls and permissions. take_remote_prompt starts at most one turn per frame, only when nothing is streaming and no query is running, drawing primary messages first and then supplementary ones, through the existing remote launch setup. One duplicated query-launch block is removed. Primary prompts are cleared on disconnect. Four unit tests plus scripts/test_remote_prompt_queue.py (live tmux fixture with localhost bridge and SSE endpoints). Coven-Harness: Claude Code / claude-opus-5-5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 15, 2026
BunsDev
added a commit
that referenced
this pull request
Oct 15, 2026
…ng (#272) Goal-bearing commands lost their captured authority in the payload, rate-limit and transport retries could re-send after the goal was replaced, an unattempted turn's UUID stayed in the persisted session, and old background children could mark a later turn. Track attempt state per captured logical turn (retries and their child/housekeeping work share it; each continuation gets fresh state), mark requests as attempted at the transport, roll back a turn that never reached a provider, and open rate-limit recovery only from the joined outcome, retaining the abandoned owner until its outcome is gated. Interactive launches go through InteractiveTurn/InteractiveQuery. The remote-control launch keeps #226's queue ownership: remote prompts stay in their own FIFO (never the local Enter path) and also wait while a file-injection decision is pending. Enhancement unit 8b. Coven-Harness: Claude Code / claude-opus-5-5
10 of 11 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remote-control prompts are no longer lost while a turn is streaming. Two prompts in one bridge poll no longer start overlapping model requests; they run as sequential turns.
Context
crates/cli/src/main.rsremote prompt intake and turn start, plus a live fixture script.Changes
while/ifreceived before checking streaming, silently consuming every queued item while busy. A remote cancel could also clearis_streamingwhilecurrent_querystill owned the previous task, so the next prompt replaced that handle.TuiBridgeEvent::InboundPromptspawned a query for every message and replacedcurrent_query/cancel. One poll batch started two concurrent API requests.VecDequeand keeps processing control and permission events.take_remote_promptreturns at most one prompt per frame, only when!is_streaming && current_query.is_none(). Already-observed primary messages come first, then supplementary ones on the next idle frame. Both transports use the existing remote launch setup (goal baseline, effective model, token limit, message bookkeeping), and one duplicated query-launch block is removed. Primary prompts are cleared on disconnect./exitpreservation.scripts/test_remote_prompt_queue.pyruns the debug binary with isolated HOME/cwd, a dedicated tmux, dummy credentials and localhost bridge/SSE endpoints. It checks that:/exitreaches the provider literally;Surface:
main.rsproduction code before the test module is 5496 -> 5459 lines (-37), with one duplicate launch block removed.Validation
cargo test --locked -p claurst --bin coven-code: 103 passed, 0 failed (includes the 4 remote-prompt tests and fix(cli): deliver remote permission replies to the waiting tool #214's 3 bridge-permission tests).cargo fmt --all -- --check,cargo check --workspace --locked,cargo clippy --workspace --all-targets --locked -- -D warnings: pass on this branch (current main, including fix(bridge,cli): own and join bridge worker tasks through shutdown #222).python3 scripts/test_remote_prompt_queue.py <debug coven-code>on this branch: both cases pass, with 2 sequential provider turns, the literal/exitdelivered, and the second reply rendered.... --expect-startup-cancellationon this branch (with fix(query): honor cancellation while a stream is starting #216): passes. The cancelled request closes before headers and the next turn starts. The first strict attempt passed its assertions, then hit a fixture teardown race (TemporaryDirectorycleanup while the engine still wrotesessions.db-journal); the rerun passed cleanly.git diff --check: clean.cargo test --workspace: hosted Rust CI. Source integration assembly: 2,018 passed, 0 failed, 8 ignored.pending_remote_prompts.clear()ahead of it, matching the verified integration assembly.PR Readiness