Skip to content

fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port - #163003

Merged
steipete merged 3 commits into
mainfrom
fix/gateway-e2e-connect-1006
Oct 2, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/gateway-e2e-connect-1006

Conversation

@steipete

@steipete steipete commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Gateway e2e tests intermittently fail with gateway closed during connect (1006): right after startGateway() reports ready, because another test's in-process Gateway took the instance's claimed port during its spawn handoff. Observed in test/gateway-cold-agent-abort.e2e.test.ts on a Gateway e2e shard 1/4 Testbox replay, where the whole test failed in 264 ms. Passing runs take about 7–8 s.

User Impact

No product or user-visible change. Gateway e2e shards stop losing OpenClawTestInstance tests to cross-fixture port theft, and a post-start connect failure now reports which process answered readiness.

Why This Change Was Made

A test that fails in 264 ms cannot have been answered by its own cold Gateway child. OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), which probes a port and then releases its claim, and then called startGatewayServer(). The production listener retries EADDRINUSE every 500 ms (src/gateway/server/http-listen.ts). A fixture that probed the same candidate just before the instance claimed it therefore kept retrying against the reservation and won the port at the handoff. Two forks that hash to the same port shard both try offset 0 first, so the collision is realistic. The instance's /readyz probe was then answered by the foreign Gateway. A closing contender terminates the upgrade (1006, the observed signature); a live one rejects the token.

The fix:

  • getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock() (next to startClaimedGateway in src/gateway/test-helpers.listener.ts) returns a held claim.
  • Every caller keeps its claim until the Gateway or server bound to that port has closed. In-process servers go through startClaimedGateway, client fixtures through startGatewayWithClient({ portClaim }), and the rest release explicitly after close. Same-port restarts keep one claim, and claims not yet handed to a starting Gateway are released by their owner.
  • docs/ci/capacity.md already promised that shared port claims cover in-process listener lifetimes; that now holds. docs/reference/test/runner-internals.md records the rule.
  • Kernel-assigned port-0 binders (getFreePort) are intentionally unchanged. On Linux the claimed pool excludes the ephemeral range, so they cannot collide with instance claims.

Diagnostics, with no assertion changes:

  • The instance records the responder's reported uptimeMs per readiness probe.
  • New diagnose() returns bounded facts: child pid/exit state/age, the last probe with the child's age at that probe, Linux LISTEN-socket owners of the port with pgid under a 1 s scan budget, and a 64 KB log tail.
  • The acquisition close error now names the handshake stage.
  • gateway-cold-agent-abort attaches this snapshot when connect fails after readiness.
Why not a readiness identity check in the product?

/readyz has no cheap token-bound identity field. Binding the responder strongly would need a product readiness change for a test-only concern. The defect lives in fixture port ownership, so the fix is there. The recorded uptimeMs vs child age makes any recurrence self-explaining (a responder older than the child is foreign).

Evidence

Mechanism reproduced locally, deterministically (scratch tests, not committed). The instance's first candidate was forced onto a port that an in-process contender had probed:

  • Synthetic contender using the production listenGatewayHttpServer retry: startGateway() resolved after 1 probe in 16 ms. The instance child was alive and never listening. Connect failed with gateway closed during connect (1006): [pre-hello socketOpened=true connectRequestSent=false].
  • Real in-process startGatewayServer contender: a closing contender reproduces the exact 1006 signature; a live one gives unauthorized: gateway token mismatch.

Regression (test/helpers/openclaw-test-instance.port-collision.test.ts): an instance whose first candidate is an in-process Gateway E2E port must allocate a different port.

  • Red against the old probe-only semantics: expected 64008 not to be 64008.
  • Green with the fix.
  • Cost: pnpm test test/helpers/openclaw-test-instance.port-collision.test.ts --maxWorkers=1. The new test takes 11–17 ms; file import share is unchanged at about 6%, because the helper lives in the light listener module.

Testbox baseline (unfixed tree plus diagnostics only):

Sharding note: shard membership is not stable across trees. RepoE2eSequencer weights untimed files by bytes and assigns greedily. Recomputed offline (it matched the observed 66/67-file shards), the file is in shard 2/4 on main and in shard 1/4 with this PR applied. Post-fix replays therefore target shard 1/4.

Review: Codex autoreview took three passes. Accepted and fixed: claim retention on GatewayStartupCleanupError, a bounded /proc scan, and pre-transfer claim release. Rejected: an explicit-port double-claim (createOpenClawTestInstance({ port }) never claims). Final pass scoped-clean. ClawSweeper then found that the MCP App conformance fixture released its claims even when listener cleanup failed. Fixed in 19116d4: each claim is released only after its own listener closed, and the delta autoreview is scoped-clean. Verified with tsgo:test:ui, oxlint, and the MCP conformance e2e (2/2). The export-collision and eager-import/wrapper closure guards also pass (20/20).

Post-fix proof (local, at the maintainer's request). Three Testbox leases timed out after 15 minutes queued (tbx_01m3whz5jqe6jcpgbvpt4db5ct, tbx_01m3wk190dry6gfvpxj2yp60y3, tbx_01m3wm85emj57xgbst8gnw3wvz), so the proof ran on a 32-core macOS host at load ~20–28, at head b8314c249832:

  • Static: all check:changed lanes pass, run explicitly: tsgo:core, tsgo:core:test, tsgo:test:root, tsgo:test:ui, oxlint core and test-root, import cycles, deadcode exports, and the line-cap, assertion-safety, and timeout-race ratchets. Two lanes fail only on inherited main state this branch predates, both already fixed on main: the stale max-lines baseline entry for chat.abort-persistence.test.ts (fixed in ccbd3b5) and the agents-other tsgo root budget at 726/720 (fixed in chore(ci): finish grouping session-lifecycle agent tests in the agents-sessions type graph #162930). This PR adds no test files.
  • Changed tests: all 11 changed unit-config files pass, including the regression and the instance and acquisition suites. All 16 changed Gateway e2e files pass with prebuilt dist (42/42 tests, including plugin-cron-registry-owner). All 4 changed UI e2e files pass (19/19).
  • Focused: gateway-cold-agent-abort passed 24/24 (3 concurrent lanes × 8).
  • Owning shard: pnpm test:e2e:gateway --shard=1/4 ran ×3 with OPENCLAW_E2E_WORKERS=2 and scripts/sandbox-setup.sh. gateway-cold-agent-abort passed in all 3 replays (11.2 s, 13.1 s, 8.8 s). The replays were not fully clean; every failing file is unrelated and reproduces without this PR:
    • src/agents/model-fallback.reply-entry.e2e.test.ts (6 tests, expected +0 to be 1 provider attempts) fails identically when run alone on the unfixed base and on this head. It imports nothing this PR touches.
    • The test/gateway.multi.e2e.test.ts wall-clock test fails alone on the unfixed base (1 failed / 2 passed) and passes alone on this head (3/3). It is a pre-existing load-sensitive flake.
    • Replay 1 only: cli-json-stdout.hooks (a slow SQLite transaction warning on stderr under load) and gateway-repeated-request-recovery (gateway request deadline exceeded, which also failed on the unfixed Testbox baseline).

Separately, vision-channel-offload and conversation-route-ownership in shard 2/4 fail on main because the qa-channel plugin cannot load packages/normalization-core/src/record-coerce.js from src/plugin-sdk/qa-channel-protocol.ts (ERR_MODULE_NOT_FOUND). That needs its own fix.

…ness

A post-start `gateway closed during connect (1006)` carried no evidence of
which process answered readiness or what the owned child was doing.

The test instance now records the responder's reported uptime per readiness
probe and exposes a bounded `diagnose()` snapshot (child pid/exit state and
age, last readiness probe, Linux LISTEN-socket owners of the port under a 1s
scan budget, and the child log tail). The shared acquisition close error names
the handshake stage (socket opened, connect request sent).
gateway-cold-agent-abort attaches the snapshot to a connect failure before
cleanup retires the child. Assertions are unchanged.
gateway-cold-agent-abort intermittently failed with
`gateway closed during connect (1006)` about 260 ms into the test: far too
early for its own cold Gateway child to have answered readiness.

Root cause: OpenClawTestInstance claims its port block and releases its
reservation listener right before spawning the child. In-process Gateway
fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its
claim before returning, and then called startGatewayServer(). The production
listener retries EADDRINUSE every 500 ms, so a fixture that probed the same
candidate just before the instance claimed it kept retrying against the
reservation and took the port at the handoff. The instance's /readyz probe was
then answered by that foreign in-process Gateway, and the client hit it while
it was closing (1006) or got a token mismatch while it was alive.

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (next to
startClaimedGateway) returns a held claim, and every caller keeps it until the
Gateway or server bound to that port has closed: startClaimedGateway for
in-process servers, startGatewayWithClient({ portClaim }), or an explicit
release after close, including same-port restarts and a guard for claims not
yet handed to a starting Gateway. The documented contract that shared port
claims cover in-process listener lifetimes now holds. Kernel-assigned (port 0)
allocations stay out of scope; on Linux they come from the ephemeral range the
claimed pool excludes.

Regression: an instance whose first candidate is an in-process Gateway E2E
port must allocate a different port; it fails on the probe-only helper.
@clawsweeper

clawsweeper Bot commented Oct 1, 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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 1:35 AM ET / 05:35 UTC (Revision 4).

ClawSweeper review

What this changes

The PR retains shared test-port claims until their listeners close and adds diagnostics when a Gateway test connection fails after readiness.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release retain the probe-only allocation path. The latest head resolves the previous cleanup finding, and no additional blocking defect was found.

Priority: P2
Reviewed head: 19116d4ee465936b2721d6bd6d326cc3e87b1c91

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused ownership repair with relevant real Gateway evidence and the previous blocker resolved.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied macOS results exercise the changed fixture through real Gateway child startup and WebSocket connections, including 24 concurrent focused passes; current-head MCP conformance results supplement the cleanup correction. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied macOS results exercise the changed fixture through real Gateway child startup and WebSocket connections, including 24 concurrent focused passes; current-head MCP conformance results supplement the cleanup correction. No stored-data contract changes.
Evidence reviewed 10 items Introduced change reviewed: Read the pinned merge-base-to-head diff, keeping introduced work separate from base-branch drift. The changes are confined to test fixtures, test support, diagnostics, and runner documentation.
Existing ownership contract reused: The new allocation helper returns the existing shared port claim. The existing startup wrapper releases it after successful server closure and retains it when startup reports incomplete rollback.
Previous blocker resolved: The captured previous review identified unconditional claim release after swallowed cleanup failures. Current cleanup records each outcome and releases Gateway, sandbox, and asset claims only when their associated teardown succeeds. Failed Gateway startup or shutdown prevents release of the Gateway and sandbox claims.
Findings None None.
Security None None.

How this fits together

Gateway test fixtures launch isolated servers and connect clients over local HTTP and WebSocket transports. Shared port ownership prevents concurrent fixtures from connecting to the wrong server during startup.

flowchart TD
  A[Concurrent test fixtures] --> B[Shared port claims]
  B --> C[Gateway listener startup]
  C --> D[Readiness and client connection]
  D --> E[Test results and diagnostics]
  C --> F[Listener cleanup]
  F --> G{Cleanup succeeded?}
  G -->|Yes| B
  G -->|No| H[Retain port claim]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1, Tests +263. Total +262 across 32 files.

View PR surface stats
Area Files Added Removed Net
Source 2 5 6 -1
Tests 30 663 400 +263
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 32 668 406 +262

Review metrics

None.

Technical review

Best possible solution:

Use the shared claim owner throughout fixture startup, restarts, and verified listener teardown, with bounded diagnostics for any recurrence.

Do we have a high-confidence way to reproduce the issue?

Yes, the source establishes the collision path: probe-only allocation releases ownership before a listener that retries EADDRINUSE starts. The PR supplies deterministic reproduction evidence; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, repairing fixture ownership through the existing shared claim owner addresses the cause without adding a product readiness protocol or weakening assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b21e522e2ad1.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied macOS results exercise the changed fixture through real Gateway child startup and WebSocket connections, including 24 concurrent focused passes; current-head MCP conformance results supplement the cleanup correction. No stored-data contract changes.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a bounded test-fixture race that intermittently disrupts Gateway validation without changing product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied macOS results exercise the changed fixture through real Gateway child startup and WebSocket connections, including 24 concurrent focused passes; current-head MCP conformance results supplement the cleanup correction. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied macOS results exercise the changed fixture through real Gateway child startup and WebSocket connections, including 24 concurrent focused passes; current-head MCP conformance results supplement the cleanup correction. No stored-data contract changes.

Evidence

What I checked:

  • Introduced change reviewed: Read the pinned merge-base-to-head diff, keeping introduced work separate from base-branch drift. The changes are confined to test fixtures, test support, diagnostics, and runner documentation. (19116d4ee465)
  • Existing ownership contract reused: The new allocation helper returns the existing shared port claim. The existing startup wrapper releases it after successful server closure and retains it when startup reports incomplete rollback. (src/gateway/test-helpers.listener.ts:16, 19116d4ee465)
  • Previous blocker resolved: The captured previous review identified unconditional claim release after swallowed cleanup failures. Current cleanup records each outcome and releases Gateway, sandbox, and asset claims only when their associated teardown succeeds. Failed Gateway startup or shutdown prevents release of the Gateway and sandbox claims. (ui/src/e2e/mcp-app-conformance.e2e.test.ts:274, 19116d4ee465)
  • Current-main necessity: Fetched main still exports getGatewayE2ePortBlock as a call to the probe-only allocator. Its listener module contains the reusable claim-owning startup wrapper but lacks the new held-claim allocation helper. (src/gateway/test-helpers.e2e.ts:49, b21e522e2ad1)
  • Latest-release check: The GitHub contents API for v2026.9.7 confirms that the release still exports the same probe-only helper; this PR's central cutover is not present there. (src/gateway/test-helpers.e2e.ts:49, c074824a27c9)
  • Regression and real Gateway evidence: The captured PR body reports deterministic reproduction using the production listener and a real in-process Gateway, a red/green port-allocation regression, and after-fix runs against real Gateway children on macOS: 24/24 concurrent focused runs and successful cold-agent-abort cases in three shard replays at b8314c2. It separately reports MCP conformance 2/2 and targeted checks after the cleanup correction at the current head. The unrelated shard failures are disclosed rather than claimed fixed. (test/gateway-cold-agent-abort.e2e.test.ts:97, 19116d4ee465)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • joshavant: 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-01T21:22:20.018Z sha b8314c2 :: blocked before merge. :: [P2] Retain port claims when listener cleanup fails
  • reviewed 2026-10-01T21:30:17.674Z sha b8314c2 :: blocked before merge. :: [P2] Retain port claims when listener cleanup fails
  • reviewed 2026-10-02T01:05:14.280Z sha b8314c2 :: blocked before merge. :: [P2] Retain port claims when listener cleanup fails

@steipete
steipete marked this pull request as ready for review October 2, 2026 00:59
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 2, 2026
The MCP App conformance fixture released all three of its port claims after
cleanup steps that record and swallow failures. A failed Gateway close, MCP
runtime disposal, or asset-server close could therefore free a port whose
listener was still bound, reopening the handoff collision this branch closes.

Each claim is now released only after its own listener's teardown succeeded:
the Gateway claim after Gateway close, the sandbox claim after Gateway close and
MCP startup/disposal, and the asset claim after the asset server closed or when
it never started. Incomplete cleanup keeps the port claimed, matching
startClaimedGateway.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@steipete
steipete merged commit 8095d77 into main Oct 2, 2026
161 of 165 checks passed
@steipete
steipete deleted the fix/gateway-e2e-connect-1006 branch October 2, 2026 06:04
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Landed as 8095d77 with a pinned-head squash merge (head 19116d4ee465) past one inherited red.

Inherited failure: checks-node-changed-10 failed in test/e2e/qa-lab/runtime/gateway-provider-review-product-proof.e2e.test.ts with "dispatches the exact acknowledged steer…" (expected { status: 'error' } to match { status: 'ok' } at line 502). It was selected because the file imports the test-instance helper this PR touched, but the failure is not caused by this PR:

  • On main b21e522e2ad1 alone, the CI merge base and without this PR, the file fails 3/3 with the identical assertion at the same line. Merging this head on top changes nothing (3/3 identical).
  • It passed in the Gateway e2e shard 2/4 replays on this PR's original base 98e86147, so it regressed on main in between. That needs its own root-cause fix.

Also before merge: ClawSweeper revision 4 on this exact head reports Ready with no remaining items. The cleanup finding from revision 3 was fixed in 19116d4, and the delta autoreview is scoped-clean. All other checks passed. The export-collision and eager-import/wrapper closure guards pass locally. The earlier checks-ui (1/3) Bun GC retention failure in ui/src/pages/usage/usage-page-details.test.ts did not recur on this head and is unrelated (no UI page code touched).

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…akes the instance port (openclaw#163003)

gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
RomneyDa added a commit that referenced this pull request Oct 6, 2026
* ci(release): install Chromium for A-K live tests (#163178)

(cherry picked from commit 9ce1498)

* ci(release): pin reachable live provider models (#163177)

(cherry picked from commit 0fa2ddd)

* test(opencode): refresh free live tool model (#163470)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit cd7c2d2)

* test: synchronize Telegram recorder failure admission

Gate the synthetic control timeline on the recorder's durable failure receipt so slow filesystem publication cannot overtake the intended failure precondition. Preserve every assertion and align the touched fixture with the existing lint rules.

(cherry picked from commit 0dfb96f)

* fix(ui): reconcile end after layout correction (#166261)

(cherry picked from commit 51f772a)

* fix(ci): forward live video provider credentials (#164317)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d0ce76b)

* fix(security): backport MCP dependency advisory fix

(cherry picked from commit c39d9b0)

* fix(test): make live qualification waits event driven

* fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003)

gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
(cherry picked from commit 8095d77)

---------

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* ci(release): install Chromium for A-K live tests (#163178)

(cherry picked from commit 9ce1498)

* ci(release): pin reachable live provider models (#163177)

(cherry picked from commit 0fa2ddd)

* test(opencode): refresh free live tool model (#163470)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit cd7c2d2)

* test: synchronize Telegram recorder failure admission

Gate the synthetic control timeline on the recorder's durable failure receipt so slow filesystem publication cannot overtake the intended failure precondition. Preserve every assertion and align the touched fixture with the existing lint rules.

(cherry picked from commit 0dfb96f)

* fix(ui): reconcile end after layout correction (#166261)

(cherry picked from commit 51f772a)

* fix(ci): forward live video provider credentials (#164317)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d0ce76b)

* fix(security): backport MCP dependency advisory fix

(cherry picked from commit c39d9b0)

* fix(test): make live qualification waits event driven

* fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003)

gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
(cherry picked from commit 8095d77)

---------

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>

(cherry picked from commit 8aa6d7c)

Release adaptation: Select only live-shard evidence handling for disabled llama.cpp, Meta, and Mistral URL/key prerequisites. Re-home regression cases in the stable evidence helper; no workflow credentials, dependencies, or fixture ownership changes.

Companion audit: Historical release bundle is not on pinned main and #166341 has no pinned-main PR mentions. Recorded backports for Chromium, provider routes, workflow secrets, MCP versions, UI and Gateway fixtures are unrelated to the evidence slice; no additional commit.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime 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: XL 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