Repository navigation
Conversation
Prepare catalog capture tokens through the native worker owner and retain original cleanup through failed preparation and shutdown. Bind token admission to the creator directory and preserve request-captured catalog provenance, environment, and worker lifetime. Related: #144592
Keep domain resets concurrent, then drain the shared native source after its domain owners settle. Run final resource cleanup even after domain failures and preserve both error groups. Keep the public singleton resolver unchanged through a core-only final cleanup registration. Related: #144592
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 1, 2026, 1:09 AM ET / 05:09 UTC (Revision 15). ClawSweeper reviewWhat this changesMoves model-catalog plugin capture preparation into native workers and retains worker, token, and file ownership through cancellation, failed cleanup, and shutdown. Merge readiness⛔ Blocked before merge - 2 items remain Keep open and paused: the author explicitly withdrew this head from landing after reviewing its cost. The capture-token migration remains wanted and is absent from current main; the recorded proof and resolved retry finding remain valid. Priority: P2 Review scores
Verification
How this fits togetherModel-catalog discovery loads captured plugin code in workers to produce model lists and authentication facts. Capture ownership keeps those files available until readers finish and permits cleanup only after their original resources settle. flowchart TD
A[Catalog or authentication request] --> B[Catalog pool]
B --> C[Capture preparation]
C --> D[Native token owner]
C --> E[Catalog worker]
E --> F[Validated model and authentication facts]
E --> G[Retirement and cleanup]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +2587, Tests +3280, Other +4. Total +5871 across 59 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the proven cleanup guarantees through a small extension of the existing read-only worker session, without adding filesystem freshness work to successful catalog tasks. Do we have a high-confidence way to reproduce the issue? Not applicable to the refactor as a whole. The recorded real-worker regression establishes the previously reviewed close-retry defect and recovery; this read-only review did not execute it. Is this the best way to solve the issue? No for this implementation shape: the author’s measured cost review supports a narrower extension of the existing read-only worker session while retaining the same ownership guarantees. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 64ba9a7f52ea. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
Preserve canonical native shutdown and capture error reporting within the reviewed native capture owners. Keep current wrapper inventory and test setup changes. Prior proof remains bound to its recorded source; current main runtime inputs require receiving qualification. Related: #144592
Preserve canonical invocation paths, catalog recovery assertions, and reduced diagnostics alongside retained token coverage. Remove the unused Cron watcher import and helper left by the canonical inline replacement.
Compose the canonical package-size repair without replacing catalog ownership changes. Preserve the reviewed wrapper inventory union and remove the orphan comment from the retired Cron helper.
|
Not landing this head; converting to draft. An independent size/benefit review measured the main-thread effect against the cost:
That trade is the wrong direction for this campaign, which now targets minimal production growth. The capture-token migration and cleanup guarantees remain wanted; the planned replacement is a narrow cut through the existing read-only worker session, estimated at +450-700 lines, scheduled after hotter main-thread paths. |
|
Retiring the withdrawn implementation. Its comparison showed unchanged main-thread SQLite call counts while adding substantial production machinery and per-task filesystem work; any remaining capture-token change should use the narrower existing worker path. Closed in a sweep of stale maintainer PRs (no activity for 7+ days). Reopen with a current reproduction if this still matters. |
Related: #144592
What Problem This Solves
Model catalog discovery must retain its native worker and captured plugin files until their original readers and cleanup operations have finished. Failed preparation, cancellation, or shutdown must not release that ownership early or silently lose a cleanup failure.
User Impact
Catalog requests keep their public inputs and results. Capture setup runs through the existing native resource owner, while cancellation and cleanup retain the original directory and token until release is established. There is no configuration, schema, or public SDK change.
Why This Change Was Made
The catalog pool, capture owner, and native transport now carry the same staging-token ownership through preparation, use, and cleanup. Capture cleanup is registered before asynchronous preparation. The capture owner forwards its already-observed directory identity into admission; it does not treat a later pathname observation as the creator identity. Failed cleanup remains attached to its original resources.
Global shutdown joins domain cleanup before shared native cleanup through the existing singleton registry, preserving failures from both phases. Metadata retirement joins capture maintenance and final capture release before the infrastructure drain. Worker modules load when capture preparation needs them, preserving the existing startup boundary.
The affected fixtures follow those same owners: workload counts observe actual catalog workers, temporary-root cleanup first drains native resources, and the real-Gateway UI fixture admits and verifies production Gateway ownership. The latter clears both inherited test markers; otherwise startup discovery can fail the existing offline-maintenance guard and cause a later extra provider acquisition. Assertions and deadlines remain intact.
Current signed head
35d1c1c70fb3incorporates canonical main and the sealed-recovery package fix from #161919. Canonical invocation-path handling and #161956's foreground catalog fallback contract are preserved. The now-unused Cron watcher wrapper was already removed on main; this composition also removes its orphaned comment. Setup, namespace, and broader asynchronous SDK migrations remain subsequent work.Evidence
The directory-identity guard has a candidate-only refusal check before native capture or file creation and a normal catalog positive. No original directory-replacement reproduction is claimed.
Package and CI Qualification
The latest review’s native-close retry defect is corrected in
c531b1d605c3: the wrapper clears only the failed attempt after reporting it, so a later explicit close reaches existing native retirement again. The original source error remains sticky and concurrent closes stay joined. The new real-worker case fails at the intended retry boundary on the old code; the corrected case and two existing cleanup-retry siblings pass in 38.3 seconds. Full selected checks (including production and 27 test type graphs) and fresh independent review pass. The original directory is unchanged throughout this injected owner-refusal/stop-failure test.The normal Linux package on prior head
e60386e94fc7built successfully. This package and upgrade evidence remains bound to that artifact; the later two-file correction changes only the failed-close retry branch and its regression, qualified separately above. Its exact tarball contains 329,435,363 unpacked bytes, 6,108,957 below the unchanged 320 MiB limit. All six selected compiled catalog cases and the qualified active-memory import profile passed. The earlier package-size failure is preserved in the evidence; #161919's canonical repair is included here.The exact prepared-tarball validator passed in 608.1 seconds. The unchanged published 2026.9.4 custom-plugin-siblings/manual-restart cell then completed successfully on the same tarball and source; its wrapper command took 180.6 seconds. Source and tarball identity were checked before and after the cell. The lease is completed. The final detailed scenario files could not be retrieved before lease expiration, so that result is supported by the retained source-bound driver and successful wrapper completion, not a separately downloaded per-assertion report.
The initial driver invoked the broader
pnpm release:checkwrapper, which unnecessarily rebuilt and failed source preflight on native locale drift and an accidental canonical SDK export. A subsequent installed-cell setup refused an incorrect source-carrier identity before running the scenario. Both failures remain recorded; the successful recovery reused the exact artifact through the maintained prepared-tarball checker and corrected only the caller-carrier binding. No source-release success, cap increase, or ignored check is inferred.CI run 36781546265 on prior head
c531b1d605c3failed in Gateway cleanup and embedded Stop. The delayed-abort fixture held the child writer FIFO while waiting for termination publication that needed the same FIFO; canonical79f0e9bf1271moves the hold to the actual aborted-marker write after termination. The Stop defect was real: the recorded first-parent control passed while the tested merge failed, and post-commit session-generation publication was refused before capacity release. Canonical5ad2c6b4b44ckeeps staged capture synchronous and holds the existing session publication admission through persistence acknowledgment and publication. Neither failure is classified as inherited.Current head
35d1c1c70fb3receives both canonical fixes. Its 58 authored postimages are identical to the reviewed prior head; the sole remaining file is the mechanical wrapper-inventory union. The actual receiving run passes 46 distinct cases: delayed-abort 10, embedded Stop 12, registry worker 21, and wrapper closure 3. Core types pass. The existing ordinary Bun capture case also passes on this composition (104.6 seconds including preparation); this is one positive path, not a resolution of the historical observer failure. The former auto-merge intent was explicitly retired before replacing the head. New exact-head CI and native admission remain required.Historical CI run 36761405925 is not green. The accidental SDK export is independently reproduced on its recorded main baseline and fixed by canonical #162015 (
ba80dfbee5a4). The Windows SIGINT failure has exact sixteen-input applicability to its owner's reproduced baseline defect and canonical #161990 (05d3c90776e0). It appeared before cancellation in a job whose Node step remained cancelled; it is retained as a real observed failure, not passing or harmless cancelled coverage. Native admission must preserve those facts and enforced review gates.A prior normal build reported a UI gzip overage in advisory mode; its source-input comparison was not a measured baseline budget pass. The separate historical macOS Bun read-only token observer failure remains unresolved and overlaps the token owner used here; it is not an established production catalog failure or a canonical-baseline waiver. Bun remains a supported opt-in runtime. On corrected
c531b1d605c3, the existing ordinary catalog/capture case passes under the pinned macOS Bun 1.4.2 through the maintained runner: token-backed capture exists, sweeping preserves it while live, closure removes it, and all observed worker descendants join. The test body took 3.752 seconds (Vitest 17.05 seconds); one case passed with no skips. Two nonfatal Bun directory warnings are retained. The selected SQLite image was not emitted, so this does not identify its library or resolve historical 3850; no Bun-wide pass is claimed. The installed upgrade scenario covers plugin loading and Doctor compatibility, not failed native-capture reclamation or completion of the entire asynchronous SQLite migration.