Skip to content

fix(test): queued-session rotation E2E exits before readiness on a retired agent roster - #163906

Merged
steipete merged 1 commit into
mainfrom
steipete/gateway-e2e-stale-premises
Oct 3, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/gateway-e2e-stale-premises

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: both Gateway queued-session rotation E2E cases fail on main because the Gateway exits with code 78 before readiness. The fixture still writes a retired agents.list roster and an unmarked legacy agents.defaults.models restriction.

These were two of the five deterministic Gateway E2E shard 4/4 failures seen on 1b4dbda4c95f. The other three were fixed on main while 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 main CI does not run test/** 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 legacy agents.defaults.models restriction. The fixture now writes what openclaw doctor --fix produces:

  • a sole keyed agents.entries.main, with no default marker,
  • an explicit agents.defaults.modelPolicy.allow,
  • the models map 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 agentRuntime in agents.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.wait synchronization, 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 resolveVisibleActiveSessionRunState in the failing window found:

  • no chat-abort controller and no terminal persistence,
  • no projected or subagent owner,
  • only embeddedRunState: "running", from the reply operation finishing post-run accounting and cleanup after lifecycle end, chat final, and the session.state idle 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:

SHA Change History active at t=0
b2c302324fb7 #163618 0/2
4e9dec17f323 parent of #163378 0/6
d6929f854d2e #163378 (worker-owned session metadata commits) 3/6
1b4dbda4c95f reported failing main 2/2

Evidence

All runs are Blacksmith Testbox through scripts/crabbox-wrapper.mjs or one-shot crabbox run, with OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 pnpm build. The exact repro command is CI=1 OPENCLAW_E2E_USE_PREBUILT_DIST=1 OPENCLAW_E2E_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts over the original four files. Payloads print SHA-256 of the four files to bind results to the bytes.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 3, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 9:41 PM ET / October 3, 2026, 01:41 UTC (Revision 4).

ClawSweeper review

What this changes

The 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
Reviewed head: a8a9afdcef810c6180e8b03a3edfcebccb73cb20

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with preserved coverage and strong, source-bound before/after execution evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Captured Testbox output exercises the real child-Gateway admission and chat-client path with the repaired fixture, reporting three successful final-head runs including both rotation and shutdown cases; the file hash matches. No stored product data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Captured Testbox output exercises the real child-Gateway admission and chat-client path with the repaired fixture, reporting three successful final-head runs including both rotation and shutdown cases; the file hash matches. No stored product data contract changes.
Evidence reviewed 7 items Pinned introduced change: The merge-base-to-head delta changes only the two fixture configurations: explicit modelPolicy.allow and keyed entries.main replace the retired roster shape. Assertions, deadlines, runtime selection, and production code are unchanged.
Current main still needs the repair: Fetched main retains agents.list with a default marker and a models map without modelPolicy in this fixture. Its recent file history contains no merged repair for this request.
Canonical config contract: Doctor's roster rules identify agents.list and entry default markers as legacy. Explicit modelPolicy makes the sibling models map metadata-only, which matches the proposed fixture and avoids restoring retired runtime compatibility.
Findings None None.
Security None None.

How this fits together

These 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 2 +2

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This bounded fixture repair restores two existing Gateway regressions without changing product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Captured Testbox output exercises the real child-Gateway admission and chat-client path with the repaired fixture, reporting three successful final-head runs including both rotation and shutdown cases; the file hash matches. No stored product data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Captured Testbox output exercises the real child-Gateway admission and chat-client path with the repaired fixture, reporting three successful final-head runs including both rotation and shutdown cases; the file hash matches. No stored product data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head delta changes only the two fixture configurations: explicit modelPolicy.allow and keyed entries.main replace the retired roster shape. Assertions, deadlines, runtime selection, and production code are unchanged. (test/gateway-queued-session-rotation.e2e.test.ts:215, a8a9afdcef81)
  • Current main still needs the repair: Fetched main retains agents.list with a default marker and a models map without modelPolicy in this fixture. Its recent file history contains no merged repair for this request. (test/gateway-queued-session-rotation.e2e.test.ts:220, f79496c87155)
  • Canonical config contract: Doctor's roster rules identify agents.list and entry default markers as legacy. Explicit modelPolicy makes the sibling models map metadata-only, which matches the proposed fixture and avoids restoring retired runtime compatibility. (src/config/model-policy-allowlist-migration.ts:36, a8a9afdcef81)
  • Retained runtime metadata is supported: Runtime policy resolution reads agent-entry and default model maps before provider model metadata. Keeping agentRuntime.id=openclaw in the default model map is supported and establishes no dependency on the Codex implementation. (src/agents/model-runtime-policy.ts:169, a8a9afdcef81)
  • After-fix production-boundary evidence: The captured PR body reports isolated Blacksmith Testbox child-Gateway runs: the original four-file scenario fails twice before repair and passes all 46 tests in three final-head runs, taking 75–82 seconds each. The reported queued-session hash prefix matches the inspected file's SHA-256, 56ec24e791b86d90d8024e69c4ece30cadae45eb88d706dfbec258007caa0742. The suite uses a real Gateway process and chat client with a local HTTP model server; results are contributor-recorded evidence, not reviewer-executed tests. (test/gateway-queued-session-rotation.e2e.test.ts:255, a8a9afdcef81)
  • Overlapping repair remains open: fix(test): migrate queued-session gateway fixture #163661 addresses the same two rejected fixtures and reports 2/2 passing cases. A live GitHub read confirms it remains open, unmerged, and cleanly mergeable. The current PR explicitly credits that work and explains its supported alternative placement of runtime metadata. (99e357a201f6)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • EricCai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-03T00:59:32.371Z sha 47434eec20af18f2c5e464cadb6617971dc6c7cb :: needs changes before merge. :: none
  • reviewed 2026-10-03T01:16:53.339Z sha 28ad7ca5bf53db508174cee27e0ebe8efd5f3342 :: needs changes before merge. :: none
  • reviewed 2026-10-03T01:32:27.850Z sha a8a9afd :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/gateway-e2e-stale-premises branch from 47434ee to 28ad7ca Compare October 3, 2026 01:10
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Oct 3, 2026
@steipete steipete changed the title fix(test): Gateway E2E shard 4/4 fails on stale roster fixtures, concise error copy, and an early history read fix(test): Gateway E2E shard 4/4 fails on a retired roster fixture and an early steer history read Oct 3, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 3, 2026
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]>
@steipete
steipete force-pushed the steipete/gateway-e2e-stale-premises branch from 28ad7ca to a8a9afd Compare October 3, 2026 01:27
@steipete steipete changed the title fix(test): Gateway E2E shard 4/4 fails on a retired roster fixture and an early steer history read fix(test): queued-session rotation E2E exits before readiness on a retired agent roster Oct 3, 2026
@steipete
steipete merged commit aa7e16b into main Oct 3, 2026
77 checks passed
@steipete
steipete deleted the steipete/gateway-e2e-stale-premises branch October 3, 2026 05:35
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant