Repository navigation
fix: messages received during preflight wait until the turn ends - #161046
creanet-64 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThe PR retains incoming messages during preflight compaction so they can steer the same reply after its backend becomes ready, with cancellation and lifecycle regression coverage. Review scores
Merge readiness⛔ Blocked before merge - 3 items remain Current main has a merged backend-readiness fix, but the exact preflight report remains paired with an open issue and lacks a formally linked merged resolution. Keep this PR open; no concrete introduced defect was found. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe reply runner turns incoming messages into either input for an active agent turn or queued follow-up work. Its registry tracks the exact reply owner and backend readiness so messages cannot transfer to a replacement turn. flowchart TD
A[Incoming message] --> B[Reply admission]
B --> C[Park pending input]
C --> D[Wait for same reply backend]
D --> E[Recheck owner and authority]
E --> F[Steer active turn]
E --> G[Queue follow-up]
Technical reviewBest possible solution: Use main's single backend-readiness owner and preserve any distinct preflight regression coverage without adding a second waiting mechanism. Do we have a high-confidence way to reproduce the issue? No current-main failing reproduction was established. The historical source defect is clear, but main now waits for backend readiness and the contributed real preflight attempt failed before that boundary. Is this the best way to solve the issue? The exact-owner waiting approach is appropriate, but current main now provides that responsibility with post-wait authority preparation. A narrow reconciliation using that owner is preferable to retaining parallel readiness mechanisms. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9df0cd095766. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +91, Tests +463. Total +554 across 6 files. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 7, 2026, 3:10 PM ET / 19:10 UTC (Revision 3). |
|
@clawsweeper re-review Updated the PR body with exact-shard and exact-Node CI reproductions, measured costs for all three new test files, and the failed real preflight attempt with its explicit authentication blocker. No source change is claimed for the unexplained CI timeout; real successful same-turn proof remains outstanding. |
|
🦞👀 Re-review progress:
|
|
I found a way to close the real-proof gap without depending on an external provider credential. Current main already has a production-path local provider harness in The real embedded injection owner is also production code: I wrote the full proof contract here: The key shape is: This is stronger than the existing synthetic-backend integration test and avoids the previous failed qualification attempt's external host-compaction auth blocker. The local provider is controlled, but HTTP transport/config/provider dispatch, Gateway transport, backend registration, and embedded steering are real production owners. I would require a redacted trace of both ownership and consumption (same run id + accepted steer + transcript/runtime consumption before terminal), not only registry state. Source-reviewed against |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Thanks for working through this preflight race and adding cancellation, owner-replacement, and session-rotation coverage. Closing as superseded by #165537, merged as 145a5e5. Main now waits for the original reply owner’s backend, rejects terminal or replaced owners, and refreshes session identity before rechecking steering authority. That covers this PR’s preflight-without-a-backend behavior; #161045 is resolved. This qualification used source and regression-test inspection; no new runtime execution is claimed. If this reproduces on current main, please reopen with the trace. |
Closes #161045
What Problem This Solves
Fixes messages received during host preflight compaction waiting until the entire turn finishes instead of steering that same turn when it becomes ready.
User Impact
A message arriving while the host prepares a turn can reach that same turn once its backend is ready. This does not shorten compaction or promise universal FIFO ordering.
Why This Change Was Made
Keep a waiting admission reservation only while the same operation is in preflight without a backend. Resume after readiness, then repeat the normal injection checks using the current session identity. Cancellation or owner replacement must not transfer that authority to a successor.
Evidence
CI failure investigation
The GitHub job
checks-node-changed-compact-large-32-6failed inreply-turn-admission.module-identity.test.ts:Admission probe stalled: native-same-store parent, after the existing 5-second per-operation limit. It failed at the first parent admission, before the fixture enters its preflight phase. This observation does not establish a root cause or prove the PR unrelated.A bounded local investigation used the original 24-file shard selection/order and worker configuration. Result: 472/472 tests passed, command wall 176.36 s, including 69.5 s of worker compilation. The unchanged module-identity file also passed alone (7.444 s test time; 26.28 s command wall). The timeout, assertions, and retry behavior were not weakened. An earlier local attempt stopped because concurrent source edits invalidated worker compilation; that attempt is not counted as a product test result.
Local Node was 26.10.0, whereas CI used 24.21.0. Relevant admission, steering, session, and lifecycle source files match the reviewed PR head; the lab checkout as a whole contains separate update changes. These passing reproductions do not prove that the CI failure is fixed. Its cause remains unresolved. No speculative source modification or CI rerun was made just to obtain green.
Exact CI Node version replay
The unchanged module-identity test also passed with official Node 24.21.0, whose Linux x64 archive SHA256 was verified against the official SHASUMS256.txt. Canonical command:
node scripts/run-vitest.mjs src/auto-reply/reply/reply-turn-admission.module-identity.test.ts --maxWorkers=1, with the isolated Node binary first in PATH. Result: 1/1 passed, 10.670 s test execution, 120.16 s command wall, including 87.714 s worker generation. Node 24 versus 26 alone did not reproduce the failure. No source, dependencies, timeout, assertions, or global tools were changed for this replay. The original CI cause remains unproven.Measured new-test costs
agent-runner-preflight-steering.integration.test.ts: 1/1 passed, 66 ms test case, 36.05 s command wall (includes compiler/cache/import overhead).agent-runner-steer-adoption.preflight.test.ts: 7/7 passed, cases 9–51 ms, 99.66 s command wall, including 74.577 s worker preparation.queue.compaction-admission.test.ts(Node 24.21.0): 2/2 passed, cases 33 ms and 6 ms, 44.89 s command wall, including 8.290 s cached worker preparation.These are command costs on the development host, not steady-state production latency or CI performance guarantees.
Real preflight attempt: outstanding proof, not a success
An isolated installed Gateway with the real authenticated Codex engine was instrumented with a metadata-only stdio observer. The fixture requested a message on the actual preflight log event. The host compaction provider lacked its separate API authentication; ChatGPT authentication for native Codex does not satisfy that host-provider requirement.
Redacted observed sequence (UTC):
This is a failed qualification attempt, not evidence of same-turn delivery or a newly established patch defect. It did not exercise successful preflight followed by backend readiness; credentials, production configuration, and source were not modified to force a result. The isolated Gateway was shut down cleanly. The requested real successful preflight-to-same-turn trace remains outstanding and requires a correctly authenticated host compaction provider in the laboratory. Unit/integration successes and the Node-version replays do not close this proof gap.