Skip to content

test(gateway): isolate catalog publication from scheduled startup - #149020

Merged
vincentkoc merged 2 commits into
mainfrom
fix/models-publication-startup-isolation-91009
Sep 15, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/models-publication-startup-isolation-91009

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The model-catalog publication integration test can fail its global root-work assertion while unrelated scheduled startup work is still running.

User Impact

No user-visible behavior changes. This isolates a manual-RPC test from automatic startup work; production code is unchanged.

Why This Change Was Made

An instrumented run of the original packed CI job observed the catalog reader settle after 1 ms and both catalog/connect roots disappear by 51 ms. A runtime:cron-start root remained through the unchanged 1,000 ms poll and drained during normal server cleanup.

The fixture now uses the existing inert scheduled-service handles and cancels the real post-ready timer before it admits work. Other exports, full Gateway startup, catalog publication, assertions, release order, delivery barrier, and cleanup remain real. Production disabled-cron reconciliation is preserved.

This follows #148831 and is a standalone prerequisite for #121668. It does not establish the cause of earlier uninstrumented failures. Optional follow-up: measure disabled-cron import/build/reconciliation phases separately if startup latency needs investigation.

The branch now integrates the frozen upstream cleanup in #149016. This replaces the stale CI merge that failed on duplicate registry keys; the test fix itself is unchanged.

Evidence

  • Production PR delta: 0 lines. Tests: +19 lines; the complete test body and its assertions remain unchanged.
  • Targeted formatting of the unchanged fixture passed. Fresh independent P0/P1 review of signed head 456b1f8f64c5ad6ec9fe3d836d7bee7a9a67b88e passed without findings.
  • On predecessor 6bb5453545e4412da4b9864ae5957ac2abfd4a0f, the original four-plan order passed: 12,162 tests passed, 23 skipped; 658 files passed, 3 skipped; 651.089 seconds. Node 24.20, four CPUs, and native resource admission of one plan were recorded.
  • The instrumented original 7317b7e4726890152feb299eb0cd2f16c0d178a1 target failed after 10,408 ms; the fixed 6bb5453 target passed in 4,366 ms. These are observations from different source/cache/worker conditions, not a speedup measurement or proof of the cause of earlier uninstrumented failures. Both retained the 1,000 ms poll and original assertions.
  • The changed fixture also passed in hosted CI on the earlier test merge; that run failed solely on the upstream duplicate-key lint issue.
  • On current head 456b1f8f64c5ad6ec9fe3d836d7bee7a9a67b88e, the same original four-plan order passed: 12,163 tests passed, 23 skipped; 658 files passed, 3 skipped; 771.963 seconds. The target passed in 5,065 ms. Node 24.20, four CPUs, admission of one plan, two workers, the original watchdogs, assertions, and 1,000 ms poll were retained. This was an instrumented run with fresh caches; it does not establish historical scheduling equivalence or a performance improvement.
  • The changed fixture passed in current hosted CI on merge dc39a69f9ddc23068d3b4f5a9760e76f91cbb92c. The exact-head ClawSweeper review has no findings or remaining moves. The full hosted CI run passed on attempt 1: 26 successful jobs and 20 skipped; aggregate gate 104374709705 passed. Its actual merge includes the upstream duplicate-key cleanup.

@vincentkoc vincentkoc self-assigned this Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 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 15, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 15, 2026 11:10
@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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 7:49 AM ET / 11:49 UTC (Revision 2).

ClawSweeper review

What this changes

The PR isolates the Gateway’s model-catalog integration test from scheduled startup work while preserving its real client connections, catalog assertions, and cleanup.

Merge readiness

✅ Ready for maintainer review

The PR remains useful and has no actionable correctness findings. Current main lacks this isolation, and the updated evidence addresses the previous review’s packed-order and timing requests at the recorded predecessor revision.

Priority: P3
Reviewed head: 456b1f8f64c5ad6ec9fe3d836d7bee7a9a67b88e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable test repair with preserved assertions, relevant recorded validation, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored test-only PR. Its unchanged real-Gateway fixture has recorded predecessor packed-order results; refreshed-head qualification remains pending. Inspected downloaded screenshots concern the related archive-undo PR and do not qualify this change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored test-only PR. Its unchanged real-Gateway fixture has recorded predecessor packed-order results; refreshed-head qualification remains pending. Inspected downloaded screenshots concern the related archive-undo PR and do not qualify this change.
Evidence reviewed 8 items Bounded introduced change: The complete host-pinned merge-base-to-head patch adds only the partial runtime-services mock. Reading the full test confirmed that its catalog assertions, acquisition barriers, root-work checks, and cleanup remain intact.
Existing startup isolation contract: The scheduled-service owner returns callable inert handles for minimal test gateways. Post-ready maintenance admits work only inside its timer callback, so synchronously clearing the returned timer prevents that admission without modifying production behavior.
Current main still needs the change: The fetched main revision contains the two earlier prewarm mocks but lacks the scheduled-service and post-ready-maintenance isolation introduced here.
Findings None None.
Security None None.

How this fits together

The Gateway publishes model catalogs when clients connect and handles subsequent catalog requests. This integration test verifies session and account selection while unrelated startup services can also register background work.

flowchart TD
  A[Test configuration] --> B[Real Gateway startup]
  B --> C[Scheduled services]
  C --> D[Inert handles and canceled timer]
  B --> E[Client connections and catalog requests]
  E --> F[Catalog snapshots and session updates]
  F --> G[Assertions and cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +19. Total +19 across 1 file.

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

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #149020
Summary: This PR owns the scheduled-startup isolation; related feature PRs depend on it but address different product problems.

Members:

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

Technical review

Best possible solution:

Keep manual catalog tests focused on real request and publication behavior, with automatic scheduling covered by its dedicated lifecycle tests.

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

No deterministic current-main reproduction was executed in this read-only review; the reported packed-order failure is consistent with startup services admitting independent work during the global drain assertion.

Is this the best way to solve the issue?

Yes. Reusing the existing inert scheduled-service path and canceling the maintenance timer isolates the intended contract without weakening assertions or changing production cron reconciliation.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is focused test isolation with no production or user-visible behavior change.
  • 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: The external-contributor proof gate does not apply to this MEMBER-authored test-only PR. Its unchanged real-Gateway fixture has recorded predecessor packed-order results; refreshed-head qualification remains pending. Inspected downloaded screenshots concern the related archive-undo PR and do not qualify this change.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-15T11:15:59.912Z sha 6bb5453 :: blocked before merge. :: none

* commit 'ba441dd2d14e1d02dca72dd341cff28c360acaa2':
  fix(ci): remove duplicate Copilot auth metadata (#149016)
  test(agents): align auth fixtures with runtime store reads (#149004)
  improve: reduce data fetched during reminder maintenance (#148996)
  fix(cron): skip availability checks when session pruning is idle (#148920)
  fix(auth): guard GitHub Copilot device flow authority (#148999)
  fix(agents): prevent early recovery aborts of foreground exec (#148959)
  fix(github-copilot): remove retired Raptor mini (#116505)
  improve(feishu): reduce preparation work for documents with tables (#148997)
  improve: reduce database work when recording participants (#148841)
  test: accept Bun error labels in plugin assertions (#148955)
  fix(models): clarify saved account health and catalog status (#148987)
@fuller-stack-dev

Copy link
Copy Markdown
Member

#85308 exact head e0155c7 hit the same global-root assertion at line 282 in job 104369104929. I am consuming #149020 as the canonical prerequisite; no duplicate fixture repair. Its original beforeimage blob f3c18595c28a is the failing fixture.

Current readback shows all checks settled (56 success, 50 skipped, one neutral), exact-head ClawSweeper ready, and merge state CLEAN at 456b1f8. @vincentkoc, please indicate any active native-landing custody so we avoid concurrent preparation. I can carry this existing PR through the maintained native LAND path if it is not already in your active landing operation, preserving your authorship and qualification evidence.

@vincentkoc
vincentkoc merged commit 178f913 into main Sep 15, 2026
113 checks passed
@vincentkoc
vincentkoc deleted the fix/models-publication-startup-isolation-91009 branch September 15, 2026 12:17
@vincentkoc

Copy link
Copy Markdown
Member 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. 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.

2 participants