Skip to content

test(gateway): align E2E handshake timeout - #117791

Merged
Takhoffman merged 1 commit into
mainfrom
fix/ci-sqlite-flip-handshake
Aug 2, 2026
Merged

Takhoffman merged 1 commit into
mainfrom
fix/ci-sqlite-flip-handshake

Conversation

@Takhoffman

Copy link
Copy Markdown
Contributor

Summary

  • align the shared Gateway E2E helper's WebSocket opening-handshake deadline with its configured overall connection timeout
  • allow callers to override the pre-auth handshake timeout explicitly
  • give the heavyweight SQLite sessions/transcripts flip proof a 60-second connection budget without changing production defaults

Fixes #117790

Verification

  • pnpm exec oxlint --type-aware src/gateway/test-helpers.e2e.ts test/helpers/sqlite-sessions-transcripts-flip-proof.ts
  • pnpm exec vitest run packages/gateway-client/src/client.handshake.test.ts test/helpers/openclaw-test-instance.test.ts (6 passed)
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts (1 passed, 143.76s)
  • pnpm exec oxfmt --check src/gateway/test-helpers.e2e.ts test/helpers/sqlite-sessions-transcripts-flip-proof.ts
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 2, 2026
@Takhoffman
Takhoffman force-pushed the fix/ci-sqlite-flip-handshake branch from cb43705 to 56f5d3c Compare August 2, 2026 04:04
@Takhoffman Takhoffman self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 12:09 AM ET / 04:09 UTC.

ClawSweeper review

What this changes

The branch makes the Gateway E2E helper pass its caller’s connection budget to the client’s pre-auth WebSocket handshake timeout and raises the SQLite sessions/transcripts flip-proof connection budget from 20 to 60 seconds.

Merge readiness

✅ Ready for maintainer review

The patch correctly closes the test-helper timeout gap described in the linked report, but this fresh PR has a maintainer label and should remain open for explicit maintainer handling rather than cleanup closure.

Priority: P3
Reviewed head: 56f5d3c93212db9344c7d9d726bbb4c7412a2251

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, contract-aligned test reliability repair with concrete E2E and handshake validation reported in the PR body.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.
Evidence reviewed 6 items Current timeout mismatch: The shared helper applies timeoutMs only to its outer connection timer, while forwarding only explicitly supplied challenge and request timeouts to GatewayClient; therefore a longer helper budget does not alter the client pre-auth timeout on current main.
Client contract: GatewayClientOptions exposes preauthHandshakeTimeoutMs; the client feeds it into challenge-timeout resolution and separately bounds the WebSocket opening handshake, so forwarding the test helper budget targets the actual earlier timeout boundary.
Changed proof path: The branch changes only the shared test helper and the five SQLite flip-proof client connections, preserving the 20-second request timeout while making their connection/handshake budget 60 seconds.
Findings None None.
Security None None.

How this fits together

The SQLite flip-proof starts a real Gateway test instance and connects several test clients through the shared Gateway E2E helper. That helper sets the client’s connection behavior before the proof exercises session and transcript lifecycle operations.

flowchart LR
  A[SQLite flip-proof] --> B[Gateway test instance]
  B --> C[Shared E2E helper]
  C --> D[Gateway client]
  D --> E[WebSocket opening handshake]
  E --> F[Session and transcript proof]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests 0. Total +2 across 2 files.

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

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #117790
Summary: This PR is the concrete candidate fix for the linked Gateway E2E timeout mismatch report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Merge the narrow helper-to-client timeout alignment after the required maintainer review; keep production Gateway defaults unchanged and retain the focused client handshake and SQLite proof coverage.

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

Yes — current source shows that timeoutMs governs the helper’s outer timer while the client’s pre-auth handshake retains its separate default unless explicitly forwarded. The PR’s stated exact SQLite E2E run is the focused validation path, although this read-only review did not execute it.

Is this the best way to solve the issue?

Yes — forwarding the existing overall test connection budget into the existing client pre-auth timeout is the narrowest owner-boundary repair, and the 60-second override is limited to the heavyweight proof clients rather than production defaults.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 862339134a9b.

Labels

Label changes:

  • add P3: This is a small internal test-reliability repair with no claimed production-default or user-facing behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.
  • 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 PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.

Label justifications:

  • P3: This is a small internal test-reliability repair with no claimed production-default or user-facing behavior change.
  • 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 PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports a passing run of the exact SQLite sessions/transcripts E2E proof after the timeout change, plus focused Gateway client and helper tests; this is a real ephemeral-Gateway runtime path rather than a unit mock alone.

Evidence

What I checked:

  • Current timeout mismatch: The shared helper applies timeoutMs only to its outer connection timer, while forwarding only explicitly supplied challenge and request timeouts to GatewayClient; therefore a longer helper budget does not alter the client pre-auth timeout on current main. (src/gateway/test-helpers.e2e.ts:54, 862339134a9b)
  • Client contract: GatewayClientOptions exposes preauthHandshakeTimeoutMs; the client feeds it into challenge-timeout resolution and separately bounds the WebSocket opening handshake, so forwarding the test helper budget targets the actual earlier timeout boundary. (packages/gateway-client/src/client.ts:305, 862339134a9b)
  • Changed proof path: The branch changes only the shared test helper and the five SQLite flip-proof client connections, preserving the 20-second request timeout while making their connection/handshake budget 60 seconds. (test/helpers/sqlite-sessions-transcripts-flip-proof.ts:367, 56f5d3c93212)
  • Existing regression coverage: The gateway-client handshake test deliberately holds a local socket open and verifies the configured opening-handshake timeout, while the PR reports the exact SQLite E2E lane passing after the change. (packages/gateway-client/src/client.handshake.test.ts:60, 862339134a9b)
  • Feature provenance: The current helper, client implementation, and SQLite flip proof were introduced together by the same current-main commit, which makes its author the strongest routing candidate for this test boundary. (src/gateway/test-helpers.e2e.ts:93, 34348d8af3c5)
  • Repository and live-context limitation: The checkout is clean and at the supplied main SHA. Local GitHub archive lookup and live GitHub reads were unavailable because gitcrawl was not installed and DNS could not resolve GitHub, so the review relies on the provided PR context plus local source and Git history. (862339134a9b)

Likely related people:

  • steipete: Peter Steinberger authored the current-main commit that added the Gateway client implementation, shared E2E helper, and SQLite sessions/transcripts flip proof together. (role: introduced current test boundary; confidence: high; commits: 34348d8af3c5; files: src/gateway/test-helpers.e2e.ts, packages/gateway-client/src/client.ts, test/helpers/sqlite-sessions-transcripts-flip-proof.ts)

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.

@Takhoffman

Copy link
Copy Markdown
Contributor Author

Land-ready verification completed for exact head 56f5d3c93212db9344c7d9d726bbb4c7412a2251.

Root cause: the shared Gateway E2E helper's timeoutMs bounded only its outer promise while GatewayClient retained an earlier default 15-second WebSocket opening-handshake deadline. The fix aligns the helper-owned connection budget with that existing pre-auth timeout boundary, preserves explicit overrides, and confines the 60-second budget to the five heavyweight SQLite proof connections. Production defaults are unchanged.

Verification:

  • pnpm exec oxlint --type-aware src/gateway/test-helpers.e2e.ts test/helpers/sqlite-sessions-transcripts-flip-proof.ts
  • pnpm exec vitest run packages/gateway-client/src/client.handshake.test.ts test/helpers/openclaw-test-instance.test.ts — 6 passed
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts — 1 passed in 143.76s
  • pnpm exec oxfmt --check src/gateway/test-helpers.e2e.ts test/helpers/sqlite-sessions-transcripts-flip-proof.ts
  • Hosted CI run 30731731887: check-sqlite-session-flip-proof passed; one unrelated compact-shard event-loop timing flake passed its single-job rerun
  • Exact-head ClawSweeper: no findings or before-merge items
  • Exact-head Copilot gpt-5.6-luna MAX read-only review: READY, zero findings
  • Canonical scripts/pr review-validate-artifacts 117791: READY FOR /prepare-pr, zero findings
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 117791: hosted gates passed, prepared head equals reviewed head

Known proof gaps: none for the changed test-harness surface.

@Takhoffman
Takhoffman merged commit 0d50887 into main Aug 2, 2026
189 of 196 checks passed
@Takhoffman
Takhoffman deleted the fix/ci-sqlite-flip-handshake branch August 2, 2026 04:49
@Takhoffman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

CI: align gateway E2E connect timeout with WebSocket handshake deadline

1 participant