Skip to content

refactor(gateway): isolate Serve hello lifecycle tests - #140044

Merged
steipete merged 1 commit into
mainfrom
codex/130860-hello-fixture-20260906
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/130860-hello-fixture-20260906

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #130860, #139875.

What Problem This Solves

Adding Gateway RPCs currently requires unrelated edits to the Serve connection lifecycle tests because they duplicate the full advertised method inventory. Those edits create avoidable merge conflicts.

Why This Change Was Made

The three route exit, cleanup, and replacement cases now supply health and config.get to the handler and verify that both the original and renewed hello preserve that exact list. The dedicated server-methods-list.test.ts continues to check the complete legacy prefix and appended inventory.

User Impact

No runtime behavior changes. Existing Serve withdrawal, identity, close-code, and renewed-socket assertions remain intact.

Evidence

All 62 focused hello and method-inventory tests passed before and after the cleanup. The canonical changed-file gate passed, including the owning Gateway test typecheck, lint, and repository guards. Independent P0–P2 review found no actionable issues.

Supply a small method list to the handler and assert it in both original
and renewed hellos. Keep full advertised method inventory coverage in the
existing dedicated test, avoiding unrelated RPC additions in these three
Serve withdrawal cases.

Related to #130860 and #139875.
@steipete steipete self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 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 gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 10:39
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 6:44 AM ET / 10:44 UTC.

ClawSweeper review

What this changes

The PR gives Gateway connection lifecycle tests a small method-list fixture so unrelated RPC additions no longer require editing those tests.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, narrowly scoped cleanup with no actionable correctness findings. Current main still duplicates the method inventory in these lifecycle tests, and the dedicated inventory coverage remains intact.

Priority: P3
Reviewed head: 25c9c040e13feb113f78db9cf6929d693ac35ff1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable test cleanup with preserved lifecycle and inventory coverage and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored cleanup changes only fixtures around the existing hello and Serve lifecycle owners; the reported focused tests are appropriate supplemental validation, and no production authority change triggers additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored cleanup changes only fixtures around the existing hello and Serve lifecycle owners; the reported focused tests are appropriate supplemental validation, and no production authority change triggers additional proof.
Evidence reviewed 7 items Verified introduced change: The pinned merge-base-to-head diff only replaces the lifecycle test's full catalog dependency with a two-method fixture. Route withdrawal, close code 1012, replacement identity, and renewed socket assertions remain.
Independent inventory coverage retained: The dedicated catalog suite still checks the complete legacy prefix and exact appended method inventory. The lifecycle test separately serializes the supplied methods through real local WebSockets and checks both received hellos.
Production boundary: Hello construction copies the handler's advertised methods, while route-lifetime subscription independently closes the connection when its announced identity is withdrawn. Neither production behavior changes in this PR.
Findings None None.
Security None None.

How this fits together

The Gateway sends connected clients a hello message containing supported methods and dashboard identity. These tests exercise how Tailscale Serve route withdrawal closes an existing connection and updates the identity advertised after reconnection.

flowchart TD
  A[Small method fixture] --> B[Gateway hello]
  C[Active Serve route] --> B
  B --> D[Connected WebSocket client]
  E[Route exit cleanup or replacement] --> F[Close old connection]
  F --> G[Reconnect and verify hello]
  A --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -12. Total -12 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 16 -12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 16 -12

Review metrics

None.

Technical review

Best possible solution:

Keep exact catalog assertions in the dedicated inventory suite and retain focused connection-lifecycle assertions at the WebSocket boundary.

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

Not applicable to a runtime defect: source inspection confirms duplicated inventory assertions, and no failing behavior is claimed.

Is this the best way to solve the issue?

Yes. The small fixture preserves method transport checks while the existing dedicated suite retains the full inventory contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This test-only cleanup reduces maintenance coupling without changing runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored cleanup changes only fixtures around the existing hello and Serve lifecycle owners; the reported focused tests are appropriate supplemental validation, and no production authority change triggers additional proof.

Label justifications:

  • P3: This test-only cleanup reduces maintenance coupling without changing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored cleanup changes only fixtures around the existing hello and Serve lifecycle owners; the reported focused tests are appropriate supplemental validation, and no production authority change triggers additional proof.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff only replaces the lifecycle test's full catalog dependency with a two-method fixture. Route withdrawal, close code 1012, replacement identity, and renewed socket assertions remain. (src/gateway/server/ws-connection/connect-hello.update-scope.test.ts:287, 25c9c040e13f)
  • Independent inventory coverage retained: The dedicated catalog suite still checks the complete legacy prefix and exact appended method inventory. The lifecycle test separately serializes the supplied methods through real local WebSockets and checks both received hellos. (src/gateway/server-methods-list.test.ts:88, 25c9c040e13f)
  • Production boundary: Hello construction copies the handler's advertised methods, while route-lifetime subscription independently closes the connection when its announced identity is withdrawn. Neither production behavior changes in this PR. (src/gateway/server/ws-connection/connect-hello.ts:149, 25c9c040e13f)
  • Cleanup remains applicable on main: The fetched main revision still calls listGatewayMethods and repeats the full expected inventory inside the three Serve lifecycle cases. (src/gateway/server/ws-connection/connect-hello.update-scope.test.ts:325, b72a36a77d1b)
  • Validation and related-work context: The captured PR body reports 62 focused tests passing before and after the cleanup plus the changed-file gate. The related archive PR explicitly describes repeated catalog-tail updates while keeping this hello fixture unchanged, supporting the stated maintenance problem. These are contributor-reported results; this review did not execute tests. (25c9c040e13f)
  • Area history and routing: Current-main file history includes Peter Steinberger's canonical method-advertisement work and personal-dashboard identity work, providing routing evidence beyond authorship of this proposal. Exact source-line introduction was not established. (src/gateway/server/ws-connection/connect-hello.update-scope.test.ts, 53be9a6fe21c)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit 4ec026a into main Sep 6, 2026
169 checks passed
@steipete
steipete deleted the codex/130860-hello-fixture-20260906 branch September 6, 2026 10:50
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to ylcn91/openclaw that referenced this pull request Sep 6, 2026
* origin/main: (47 commits)
  ci: record CPU time for Node test jobs (openclaw#140054)
  test(crabbox): consolidate wrapper boundary coverage (openclaw#140058)
  fix(test): keep native filesystem access checks portable (openclaw#140047)
  fix: preserve models when OAuth preparation fails (openclaw#139951)
  feat(update): recover failed updates with bounded repair (openclaw#139495)
  refactor(plugins): share managed npm package traversal (openclaw#140040)
  chore(ui): refresh control ui locales (openclaw#140059)
  refactor(auth): share profile failure state reset (openclaw#140049)
  fix(cron): surface skipped on-exit payloads when jobs are busy (openclaw#139987)
  fix(codex): preserve exec-server WebSocket backpressure under Bun (openclaw#140048)
  fix(agents): ground exec approvals in tool results (openclaw#140043)
  refactor(policy): reuse authored policy value helpers (openclaw#140019)
  docs: keep ClawSweeper status inspection read-only (openclaw#139958)
  fix: reduce task maintenance stalls with large histories (openclaw#140038)
  fix(code-mode): identify unawaited promise output (openclaw#140028)
  fix(test): release memory search fixtures after failed phases (openclaw#140013)
  test(gateway): isolate Serve hello lifecycle fixtures (openclaw#140044)
  fix(microsoft-foundry): bound Entra token retention across accounts (openclaw#127216)
  fix(process): preserve the cause of cleanup observation failures (openclaw#140015)
  fix: clear Side chat when its parent conversation is deleted (openclaw#139974)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Supply a small method list to the handler and assert it in both original
and renewed hellos. Keep full advertised method inventory coverage in the
existing dedicated test, avoiding unrelated RPC additions in these three
Serve withdrawal cases.

Related to openclaw#130860 and openclaw#139875.
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. 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