Repository navigation
fix(test): queued-session rotation E2E exits before readiness on a retired agent roster - #163906
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 maintainer review before merge. Reviewed October 2, 2026, 9:41 PM ET / October 3, 2026, 01:41 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR updates both queued-session Gateway test fixtures to use keyed agent entries and an explicit model allowlist while retaining their runtime metadata. Merge readiness✅ Ready for maintainer review The fixture repair remains necessary on current main, preserves the existing regression assertions, and has convincing after-fix Gateway evidence. The overlapping open PR should be coordinated so only one repair lands. Priority: P2 Review scores
Verification
How this fits togetherThese end-to-end tests start an isolated Gateway and send chat requests through its real client. They verify replacement turns after session rotation and orderly shutdown with a queued follow-up. flowchart LR
A[Canonical fixture config] --> B[Gateway admission]
B --> C[Gateway chat client]
C --> D[Session rotation or shutdown]
D --> E[Local model server]
E --> F[Request and lifecycle assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the existing rotation and shutdown coverage runnable with canonical fixture config, landing one of the two equivalent repairs. Do we have a high-confidence way to reproduce the issue? Yes: current-main fixture config violates the documented admission contract, and the captured Testbox evidence records startup failures before repair. This read-only review did not execute the tests. Is this the best way to solve the issue? Yes: updating the fixture producer to canonical config is the narrow repair, and preserving runtime metadata and assertions avoids weakening coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f79496c87155. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
47434ee to
28ad7ca
Compare
Both queued-session rotation Gateway E2E cases exited with code 78 before readiness: the fixture still wrote a retired agents.list roster and an unmarked legacy agents.defaults.models restriction, which config admission now rejects. Write the shape Doctor produces instead: a sole keyed main entry and an explicit agents.defaults.modelPolicy.allow, keeping the models map as runtime metadata (the same shape #163618 gave the steer fixture). Assertions are unchanged. Co-authored-by: Dallin Romney <[email protected]>
28ad7ca to
a8a9afd
Compare
|
Merged via squash.
|
…ter (openclaw#163906) Both queued-session rotation Gateway E2E cases exited with code 78 before readiness: the fixture still wrote a retired agents.list roster and an unmarked legacy agents.defaults.models restriction, which config admission now rejects. Write the shape Doctor produces instead: a sole keyed main entry and an explicit agents.defaults.modelPolicy.allow, keeping the models map as runtime metadata (the same shape openclaw#163618 gave the steer fixture). Assertions are unchanged. Co-authored-by: Dallin Romney <[email protected]>
What Problem This Solves
Fixes: both Gateway queued-session rotation E2E cases fail on
mainbecause the Gateway exits with code 78 before readiness. The fixture still writes a retiredagents.listroster and an unmarked legacyagents.defaults.modelsrestriction.These were two of the five deterministic Gateway E2E shard 4/4 failures seen on
1b4dbda4c95f. The other three were fixed onmainwhile this PR was in review:With this PR, all five pass under the original repro.
User Impact
No user-visible change; product code is untouched. Hourly
mainCI does not runtest/**E2E files, which is why this stayed red there.Why This Change Was Made
Config admission rejects a populated
agents.list(since #162612) and an unmarked legacyagents.defaults.modelsrestriction. The fixture now writes whatopenclaw doctor --fixproduces:agents.entries.main, with no default marker,agents.defaults.modelPolicy.allow,modelsmap kept as per-model runtime metadata.This is the same shape #163618 gave the sibling steer fixture. Assertions are unchanged.
This covers the same failure as #163661 by @RomneyDa, who is credited as co-author. The only difference is that this version keeps
agentRuntimeinagents.defaults.models, where Doctor leaves it, instead of moving it onto the provider model entry. Either shape is valid; only one of the two PRs should land.Investigation of the canceled-steer failure (fixed on main by #163852)
Before #163852 landed, this PR carried its own fix for the canceled-steer case. That fix was dropped in favor of main's
agent.waitsynchronization, which uses an owned completion signal instead of polling history. The investigation supports that fix.Which owner held the session active. Gateway-side instrumentation of
resolveVisibleActiveSessionRunStatein the failing window found:embeddedRunState: "running", from the reply operation finishing post-run accounting and cleanup after lifecycleend, chatfinal, and thesession.stateidle diagnostic.The window closed within about 250 ms.
When it started. Single-case Testbox runs with a t=0 history probe, fresh checkout per SHA:
b2c302324fb74e9dec17f323d6929f854d2e1b4dbda4c95fEvidence
All runs are Blacksmith Testbox through
scripts/crabbox-wrapper.mjsor one-shotcrabbox run, withOPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 pnpm build. The exact repro command isCI=1 OPENCLAW_E2E_USE_PREBUILT_DIST=1 OPENCLAW_E2E_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.tsover the original four files. Payloads print SHA-256 of the four files to bind results to the bytes.main56a17f9c9503(tbx_01m3zhe0x8e0101hf63jc2t6hq): 2/2 runs fail, with 4 files failed, 5 tests failed and 41 passed.mainthat includes fix(agent): mid-turn messages no longer skip freshly requested tools #163852 and fix(cli): preserve the reason when an update fails #163901):tbx_01m3zp1v8wdyvzwwnz4s79rfh3: the same 4-file command passes 3/3 runs, 4 files and 46/46 tests each, at 75–82 s wall time per run. The queued-session file hash is56ec24e7…. The steer file is main's fix(agent): mid-turn messages no longer skip freshly requested tools #163852 version (ddc64b59…), so itsagent.waitfix holds under the 2-worker load. On this tree, queued-session, fault-sequence and run-embedded fallback weigh into shard 2/4, and steer FIFO into 4/4.tbx_01m3zgrhmeycq4fx3qmt8s538k): 3/3 runs, 46/46 tests each.--shard=4/4replay on those bytes (tbx_01m3zkn5p23kkyfbvcmgrqavf4): all four files green; 482 passed, 2 failed.plugin-subagent-self-yield-followupfailure (fix(agents): a subagent's previous result is lost when its next turn starts quickly #163352, fix in fix(agents): stale pause notice wakes the requester after a quick subagent follow-up #163814). The other ispackages/aipackage typing, a proof-build artifact because the runtime-only build skipstsdown-aideclarations.selectWeightedShard.oxfmt --checkandgit diff --checkare clean. Codex autoreview is scoped-clean on this commit's content.