Repository navigation
fix(agent): unblock ChatGPT Host task Wakes behind stale uncertain attention delivery - #1420
Beaten0123 wants to merge 5 commits into
Conversation
swjnxyf
left a comment
There was a problem hiding this comment.
Reviewed PR #1420 at a460d3b9ebaeffadd202737e1ed9e5275c231916 directly in the special primary checkout (no worktree). No blocking source-code issues found; LGTM.
I traced the new recovery path through claim_next_agent_wake, exact and implicit read-only bootstrap_agent_conversation, consume_agent_wake, Task Attempt expiration, endpoint execution bindings, and the existing one-shot Host dispatch fence:
- Only
delivery_unknownattention-event Wakes older than the 15-minute grace are retired; their exact wake attempts/tokens are revoked in the same SQLite transaction, with source attention/audit facts preserved. No uncertainui/messageis replayed. delivery_unknownTask Wakes are retired only after both the 15-minute window and terminal/expired source Attempt lease conditions. The existing mutually exclusive Task execution backends remain enforced; expiration does not silently revive an outcome-unknown CodingAgent run.- The read-only bootstrap hides only eligible stale uncertain Wakes, while the canonical authorized acquire performs retirement and selects fresh short-lease Task Wakes ahead of pending notifications. Older pending notifications remain durable.
- A racing late exact consume and an authorized retirement serialize under the Store's immediate transaction. Late revoked tokens cannot consume the retired Wake.
On special: cargo test --locked --offline -p webcodex-store --profile dogfood --lib passed 328 tests (0 failed, 4 ignored); agent_continuation_tests passed 25/25, mcp::tests::agent_continuation_app passed 11/11; cargo fmt --all -- --check and git diff --check passed. The Store regression covers both old-token refusal and a successor Task Wake's exact consumption.
CI caveat (not caused by these four changed files): GitHub run #43710045930 is red in test-linux-tooling and contract because the unchanged scripts/tests/test_build_identity.py suite reports the same four len(outputs) == 1 assertions failing (regular repo and linked worktree). The test aggregator then fails. The same five Build Identity self-tests pass locally on special (5/5), while Linux Server/Runner/Store-related CI jobs have passed. This is a repeatable CI runner/toolchain-dependent discrepancy, not evidence of Wake test regression and not a generic timeout/flaky test; it warrants separate tooling investigation. Please keep required CI checks enforced before merging.
Finally, the tests prove Store and MCP App in-process contracts, not that the deployed ChatGPT Host has scheduled or exact-consumed a new Wake. Production acceptance still requires observing a fresh consume_agent_wake record.
|
Follow-up on the red CI: I reproduced the four failing Build Identity assertions on special using the exact Cargo 1.100.0 toolchain from GitHub Actions. This is due to Cargo's changed intermediate build-script output layout, not to the Agent Wake changes in this PR. I fixed the test-only output discovery on our repository in #1421 (commit Since this PR's fork has |
|
Thanks for the additional Wake fixes. #1421 has now been merged into Could you please update your PR branch Once the updated branch is pushed, GitHub Actions should trigger a new CI run automatically; I'll review the fresh results and the additional Wake commits. Please don't merge this PR into |
Problem (reproduced against real WebCodex SQLite)
An Oct 31 attention_event Wake remains
delivery_unknownand blocks every laterpendingWake for the same Agent inclaim_next_agent_wake. A Nov 15agent_task_attemptWake expired and retired without being claimed. MCP App Endpoint binding/readiness was true but Host model turn never exact-consumed the new Wake.Fix
attention_eventdelivery_unknown notifications after a bounded 15-minute grace, atomically revoking their exact Wake Attempts and preserving source attention/audit records.ui/message, and never auto-retire prepared/delivered/inbox/AgentWait/execution-bound AgentTask Wakes.agent_task_attemptWakes over older pending notification Wakes.Verification (local, isolated latest-main worktree)
cargo fmt --all -- --check: passcargo test -p webcodex-store --lib --offline --quiet: 327 passed, 0 failed, 4 ignoredcargo check -p webcodex --bin webcodex-server: passcargo test -p webcodex --lib agent_continuation_tests --offline --quiet: 25 passedcargo test -p webcodex --lib mcp::tests::agent_continuation_app --offline --quiet: 11 passedgit diff --check: pass42908201de343edcb284f4a825b2388ee6bc49cf; fork branch verified same SHA.Acceptance boundary
This PR proves the server/store and MCP App adapter contracts in-process. It does NOT assert that the deployed ChatGPT Host has scheduled and exact-consumed a fresh Wake. Installed production Server is a separate older build; real Host acceptance requires maintainers' deployment followed by a fresh Wake's exact
consume_agent_wakerecord. Do not mark an unfinished durable Goal completed from this PR alone.