Repository navigation
fix(conn-server): Pass 4 approval, async answers, failure wakes and Claude app notes, as T3 - #276
Merged
Merged
Conversation
…al, as T3 Ending any run cancelled every pending runtime request on the thread. So removing queued run B while run A waited on an approval cancelled A's card, and the server refused the answer while the provider still waited. A run's end now cancels only the requests whose node belongs to that run. T3's queued-run cancel writes only the run, its attempt and its root node. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…starts one run, as T3 A question whose provider can no longer take it live (responseCapability `message`, as one imported from T3 after its provider exited) was answered like a live approval. With no live session the delivery failed, the card expired and the answer was lost: no message and no run. The respond command now matches the capability. For `message` it checks the answers against the question as T3 does, resolves the card and its item, and dispatches one user message `async-answer:<requestId>` in the same transaction: a steer of the active run, or a queued or started turn. Like T3, it refuses the answer when the thread's provider is disabled for its project. Live requests keep their adapter delivery. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… wake, as T3 A failed turn held every queued run. A buffered provider notification replays output the CLI already produced, so T3 starts it while it holds the user's messages. Here it stayed held with them. The failure hold now leaves a queued run free when its message is a buffered provider notification (agent, provider source, a notification, no delegated completion), and the normal queue starts it. Stop and other holds are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s T3 The engine passed MCP app notes in the turn input, but the Claude session never used them, so the model never saw what an app reported. As T3's withClaudeAppContext, a turn now puts each note the native thread has not seen with its current text before the prompt, as quoted app data (`<external_KEY>text</external_KEY>`). A slash command gets none. What a turn offers enters the history only when the turn completes, so an interrupted turn's notes go again. Compaction, a conversation reset and a rollback clear what the history holds. Steers follow with SteerInput. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rules Gate findings on 4.2 and 4.4: - A held queue is released only by a client send (`sentByUserFromClient`: a user's web or mobile message, not a steer follow-up or scheduled task). The async answer, created by the server, no longer resumes work the user stopped. - The async answer steers only into a provider turn that runs. A run still starting gets the answer as its own later run, instead of the deferred steer that delivered it into the start. - A provider result queued while a held queue waits does not take the hold unless Stop reached the active run (`wakeSkipsHold`), so a second buffered result drains while the user's message stays held. - A usage-limit failure holds everything queued, provider wakes too, as T3 checks `usageLimitHoldsQueue` before a failure starts a wake. T3's worktree-setup condition has no counterpart: this engine records no workspace preparation on runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nded and usage-limit rules Round-2 gate findings on #276: - Runs imported from T3 carry workspacePreparation. After a failed or stopped worktree setup on a thread with no checkout, a new message waits held instead of starting in the project root (worktreeMissingRun), and neither a client send nor a provider result passes the hold while setup is pending (worktreeSetupPending). - An async answer steers only when the active run's session advertises supportsActiveSteering; otherwise it queues behind waiting work instead of a declined steer putting it first. - A run that completes as the thread's newest without a Stop releases held work nobody reviews: agent, server and scheduled messages (releaseUnattendedHolds), before the next run is picked, also after a checkpoint capture. The user's held messages stay held. - A usage limit writes no hold. Automatic starts and queue.resume check the next run's own provider (usageLimitHoldsQueue), so a limited provider waits in queue order while another provider's work can start. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llow T3's queue checks Round-3 gate findings on #276: - queued-run.start (Send now) runs queue.resume's checks on the selected run before clearing any hold: a pending worktree setup or a limited provider refuses it and leaves the queue as it was. - An async answer that would steer a run Stop already reached is refused, so the answer stays pending and can be sent again (stopReachedRun). - Send now and queue.resume start as the user (no reset-time wait), apart from whether a run was selected. Ports T3's "holds a limited provider's queue through another provider's turn until the user resumes". - A queued run whose message follows the thread's conversation (monitor wakes, delegated results, followsThreadSelection) is checked and started on the thread's current selection (queuedRunModelSelection); buffered provider results keep their recorded provider. - A provider failure holds the queue only when the next run would start on the failed provider. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… wakes drop before a failure holds, a newer session error lifts a usage limit, as T3 - A monitor wake queued on model A starts on model B after the user picks B on the same instance (startNextQueuedRun copies the full selection). - A stale pull request wake at the head of the queue is cancelled before a provider failure decides what to hold, so runnable work on another provider still starts. - usageLimitHoldsQueue reads the latest session's lastError first; a different error means the old usage_limit item no longer holds the queue. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ll request wake The stale-wake check at run end loaded every message of the thread for any queued message. It now checks the queued message for a pull request watch stamp first, so an ordinary user message never scans history under the store lock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # apps/conn-server/crates/conn-provider-claude/src/interrupt_tests.rs
# Conflicts: # apps/conn-server/crates/conn-engine/src/commands.rs
# Conflicts: # apps/conn-server/crates/conn-engine/src/commands.rs
This was referenced Nov 24, 2026
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.
Fixes four Pass 4 findings of the Conn Server port audit (guide "Approval, queues, PR watches and provider input"). One commit per finding. Each acceptance test was run failing on
a9b09d8af3and passing after its fix.73bde24719engine_tests::removing_a_queued_run_keeps_the_active_runs_approval: B cancelled, A's card stays pending in the shell, answering it completes A once6dc84ec7ddruntime-request.respondmatchesresponseCapability. Formessageit validates answers as T3 does, resolves the card, and dispatches one user messageasync-answer:<requestId>in the same transaction. The provider-enabled guard covers it. Live answers keep adapter delivery.engine_tests::an_async_question_is_answered_with_one_message_and_one_run: T3's four invalid answers refused with no change, retry by command id returns the first outcome, a new id is refused, and after reopening there is one resolved card, one messageWhich color?\nBlue\n\nWhich sizes?\nSmall, Largeand one run0402dce7f9isBufferedProviderNotification), so the normal queue starts them. Stop and other holds are unchanged.engine_tests::a_provider_failure_holds_messages_and_starts_a_buffered_wake: the user message and a server-sourced wake stay held, and the provider wake completes once91e6ba0bed<external_KEY>text</external_KEY>blocks (T3'swithClaudeAppContext). Slash commands get none. Notes count as delivered on turn completion and are cleared by compaction, conversation reset and rollback.interrupt_tests::mcp_app_notes_reach_the_claude_prompt_until_a_turn_takes_them_in, against the fake SDK host's recordedinputframes: note sent, resent after an interrupt, skipped after a completed turn, resent after compactionExtra evidence for 4.2: the real T3 pre-answer database (written by T3's own async-question test via
VACUUM INTO) was imported. Answering it twice and reopening gave one resolved card, the T3 message text and one run. On main it gave none. That probe is not committed because it needs the T3-generated fixture.Checks run on macOS, sealed (
sealedCargoEnv):cargo fmtcargo clippy -D warnings --all-targets, per crate: conn-engine after 4.1, 4.2 and 4.4; conn-provider-claude after 4.5. The whole workspace was also clean on the tree that holds 4.5 plus the next change.cargo test: conn-engine 210, 211 and 212 passed after 4.1, 4.2 and 4.4; conn-provider-claude 83 passed, 11 ignored, after 4.5.Not run:
tools/check.sh, held back because of low disk on the build host. CI covers the Linux run.Gate fixes
ef94b00f9d(round 1):5ad020e1cb(round 2):workspacePreparation(copied by the importer) holds work after a failed worktree setup.supportsActiveSteering.queue.resume, in queue order.0a03a133b8(round 3), each with a test that failed on5ad020e1cb:df9d168676(round 4), each with a test that failed on0a03a133b8:startNextQueuedRun). Test:a_monitor_wake_takes_a_new_model_on_the_same_instance(failed: ran onmodel-a).a_stale_wake_does_not_hold_other_provider_work_after_a_failure(failed: wake and Codex run both held).usageLimitHoldsQueuereads the latest session'slastErrorfirst; a different error lifts the oldusage_limititem (threadErrorSummary). Test:a_newer_session_error_lifts_an_old_usage_limit(failed:queue.resumerefused).followsThreadSelection; fix(conn-server): an undone settle keeps the thread's place in Active #260 writes it.f54a467b69(round 5): the failure check loads thread history only when the queued message carries a pull request watch stamp, so an ordinary queued user message never scans every message under the store lock. Existing tests cover the behaviour; no new test.Merge with #256: combine the
RunEndandHeldimports inrunner.rs. #256'sRunEndhandling and this PR's request-owner filter and queue rules both stay.Coordination: #256 changes the
end_runsignature next to the 4.4 hold and adds aRunEndargument tofinish_run_as, which 4.1 also edits. Expect textual conflicts, not semantic ones. Neither PR changes the other's rule. The outbox stack (#261/#268/#269) does not touch queued-run cancel or request cleanup.Not in this PR: 4.6 (Codex/Claude steer notes, which needs a build) and 4.3 (external merge wake with T3's own-merge detection) follow in separate PRs.
Model: Claude Opus 5.5, Claude Code.
🤖 Generated with Claude Code