Skip to content

test(gateway): consolidate startup owner coverage - #118448

Merged
steipete merged 1 commit into
mainfrom
codex/test-perf-gateway-startup-core
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-perf-gateway-startup-core

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • collapse repeated Gateway startup proofs into owner-focused fixtures while preserving the real readiness, Vault, auth-profile, ingress-auth, web-secret, quarantine, and HTTP bind boundaries
  • reduce the startup-core shard from 16 test entries to 9 and from 16 real Gateway starts to 7
  • load mock-compatible startup owner suites through shared test entries so the non-isolated runner performs six fewer complete module resets

Root cause

The startup-core shard repeatedly paid for full Gateway bootstrap and for the custom non-isolated runner's complete evaluated-module reset after each file. Several real-server cases re-proved owner mappings already covered by the SecretRef owner suites.

The removed model-runtime event-loop case was especially misleading: it started an independent HTTP server, blocked startGatewaySidecars on a Promise, and proved that Node could still answer that unrelated socket. Provider catalog and startup ordering remain covered by the prepared-model-runtime, post-attach, and startup orchestration owner suites.

Coverage retained

  • one real startup now asserts resolved ingress auth together with degraded model/media, TTS, memory, sandbox, cron, skill, and active web-search owners, including memory and sandbox consumer rejection
  • Vault provider fanout, Vault ACL attribution, cold auth-profile request rejection, and unresolved ingress auth remain separate real boundaries
  • plugin quarantine now starts once with both a broken plugin and a valid stale-main sibling
  • credential-free web fetch still reaches the real HTTP listener without provider discovery; unrelated model publication and orphan recovery use their dedicated owner fixtures
  • bootstrap publication, startup outcomes, SecretRef diagnostics/surfaces, and session migration retain all assertions as imported test-support suites

Test count changes from 167 to 157: six repeated optional-owner boots became one combined boundary, the active web-secret boot joined that boundary, the inactive-web behavior remains in the direct web-tools owner suite, two quarantine boots became one mixed boundary, and the independent-HTTP event-loop case was removed.

Performance

Paired on the same ready dependency install at base 4b50c56fecbb9b8936f2b4ab43db22f70229354c:

  • before: 360.76s Vitest / 361.33s wall, 167 passed
  • after: 143.11s Vitest / 143.83s wall, 157 passed
  • improvement: 60.3%

After rebasing onto current main, the exact 9-entry startup-core group passed 157/157 in 139.77s.

Proof

  • exact startup-core group: 157/157
  • combined startup SecretRef suite: 27/27
  • direct SecretRef owner suites: 96/96
  • targeted formatting, Oxlint, and git diff --check: clean
  • autoreview against current origin/main: clean

Core test typechecking reaches two pre-existing errors outside this change in packages/terminal-core/src/ansi.ts and ui/src/app-session-route-paths.ts; it reports no changed-file errors.

@steipete
steipete requested a review from a team as a code owner August 3, 2026 04:12
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Aug 3, 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 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The PR groups repeated Gateway startup tests under owner-focused suites, removes two redundant standalone startup cases, and reduces repeated real Gateway boots while retaining readiness, SecretRef, plugin quarantine, and HTTP-bind coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for normal maintainer handling. This is a coherent, test-only Gateway startup-shard consolidation with source-backed retained owner assertions and terminal proof in the PR body; current main still has the separate startup test entries, so the work is neither obsolete nor implemented there.

Priority: P3
Reviewed head: f92320f48bed4777d16f403bc4c7a5a3620d31e4
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-explained test-only refactor with concrete retained-boundary assertions and after-fix targeted-run evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.
Evidence reviewed 5 items Retained real owner-boundary coverage: The consolidated SecretRef startup test still starts a real Gateway, fetches /readyz, asserts readiness, checks degraded owner records and warnings, and verifies memory and sandbox consumer rejection.
Test discovery and suite ownership: The Gateway server project discovers *.test.ts files with non-isolated execution; the PR deliberately renames support-only suites away from discovery and imports them from their owning startup suites, avoiding separate module-reset runs without dropping their assertions.
Current-main comparison: Current main still contains the standalone bootstrap, outcomes, SecretRef diagnostics/surfaces, session-migration, inactive-web-secret, and model-runtime event-loop test entries; the requested consolidation is not already present on main.
Findings None None.
Security None None.

How this fits together

Gateway startup turns configuration, secrets, plugins, and post-attach services into a ready HTTP gateway. These tests exercise that boot path and verify that optional-owner failures degrade only their owning capability while required ingress authentication and readiness remain correctly enforced.

flowchart LR
  A[Gateway startup configuration] --> B[Secret and plugin preparation]
  B --> C[Startup owner decisions]
  C --> D[HTTP listener and readiness]
  C --> E[Degraded owner diagnostics]
  D --> F[Gateway startup test suites]
  E --> F
Loading

Decision needed

Question Recommendation
Should this maintainer-owned Gateway startup-test consolidation merge once the remaining current-head checks complete? Merge after current-head gates: Accept the reduced startup-test topology once the pending build and boundary checks confirm the exact head.

Why: The patch appears correct and preserves the tested boundaries, but the protected maintainer label requires explicit maintainer handling rather than automated cleanup.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; the local merge-tree is clean, but remaining current-head CI checks should complete before merge.
  • Complete next step (P2) - This protected maintainer-labeled test refactor needs normal maintainer approval and current-head CI completion, not an automated repair lane.
Agent review details

Security

None.

PR surface

Source +1, Tests -518. Total -517 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 5 4 +1
Tests 7 268 786 -518
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 273 790 -517

Review metrics

Metric Value Why it matters
Real Gateway boots 16 reduced to 7 The PR body reports fewer expensive full startup cycles while retaining owner-boundary assertions, which is the central performance claim to preserve.
Production versus test LOC production +0/-0, tests +273/-790 All changed paths are Gateway test or test-support files, so merge review should focus on retained behavioral coverage rather than runtime behavior change.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/gateway/server-startup-secret-owner-isolation.test.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one owner-focused startup suite per real Gateway boundary, retain direct assertions for readiness and owner-specific degradation, and merge after the current head passes its remaining gates.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one owner-focused startup suite per real Gateway boundary, retain direct assertions for readiness and owner-specific degradation, and merge after the current head passes its remaining gates.

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

Not applicable as a user-facing bug report. The PR body provides a high-confidence after-change test path: the exact startup-core group reports 157/157 passing, alongside the focused SecretRef owner suites.

Is this the best way to solve the issue?

Yes. Importing support-only assertion suites through the tests that own their startup boundary matches the non-isolated Gateway-server runner and avoids repeated full Gateway bootstrap without introducing a second runtime path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 128361397aa7.

Labels

Label changes:

  • add P3: This is a low-risk test-performance and test-organization improvement with no claimed production behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.
  • 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 records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.

Label justifications:

  • P3: This is a low-risk test-performance and test-organization improvement with no claimed production 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 records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records after-fix terminal proof for the exact startup-core group (157/157), focused SecretRef suites (27/27 and 96/96), and a before/after timing comparison; this directly demonstrates the test-run improvement claimed by this test-only change.

Evidence

What I checked:

Likely related people:

  • steipete: The branch commit is authored by Peter Steinberger, and the history of the central startup owner-isolation tests shows repeated recent work by the same contributor. (role: recent area contributor and PR author; confidence: high; commits: f92320f48bed, afdb4112f3, 82d1a03f25; files: src/gateway/server-startup-secret-owner-isolation.test.ts, src/gateway/server-startup-web-fetch-bind.test.ts)
  • Vito Cappello: The plugin quarantine test history includes the broken configured-plugin startup repair that this PR consolidates. (role: original plugin-quarantine repair contributor; confidence: medium; commits: cd1ab40632; files: src/gateway/server-startup-plugin-quarantine.test.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.

@steipete
steipete merged commit fd10614 into main Aug 3, 2026
145 of 156 checks passed
@steipete
steipete deleted the codex/test-perf-gateway-startup-core branch August 3, 2026 05:22
@steipete

steipete commented Aug 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 Aug 3, 2026
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: 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