Repository navigation
Conversation
|
🦞👀 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. |
c942ae5 to
1c2e746
Compare
|
Implemented and landed through 32 independent PRs. The principal feature cuts are #144252 (instance/source/resource ownership), #145484 (Gateway, CLI and UI lifecycle), #145649 (uninstall), #145710 (install writers), #145713 (batch updates), #145648 (embedded conversations), and #145917 (managed native conversations). This umbrella is now superseded by those merged changes. Final verification used main All recorded test processes/listeners closed. The final full source/build/dependency capture matched the initial capture; build fingerprint Both final PRs passed exact-head CI: embedded, 136 jobs and native, 131 jobs. Two native test-wiring failures were repaired without weakening runtime or test guards. The final CLI harness also learned the existing typed pre-admission busy contract: verify unchanged state, wait the server's retry interval, and retry that refused request once. Original failures and source-qualified receipts are retained. The final campaign is net +8,970 production lines, including the earlier −1,841-line cleanup; tests/support, generated code and tooling are counted separately. The aggressive code-size target was not achieved. Startup compatibility and the restart-free behavior are implemented and verified. |
This implementation is being split into independently landable PRs. This draft preserves the complete candidate and end-to-end evidence; the full restartless lifecycle feature is not yet landed.
Landed slices:
refactor(plugins): simplify diagnostics and state wrappers #139775 — simplify plugin diagnostics and state wrappers (−13 production LOC).
test(android): await gateway trust lifecycle publication #139807 — wait for Android trust lifecycle publication in its test (no production change).
refactor(plugins): centralize managed npm install planning #139788 — centralize managed npm install planning (−43 production LOC).
test: make suppression inventory independent of line numbers #139769 — make suppression inventory independent of line numbers (no production change).
refactor(plugins): bind registration owners once #139898 — bind registration owners once (−157 production LOC).
fix(plugins): keep tool metadata and callbacks on the same factory instance #139828 — keep tool metadata and callbacks on the same factory instance (−710 production LOC).
fix(plugins): honor provider runtime cache invalidation #139908 — honor provider runtime cache invalidation (−151 production LOC).
fix(process): wait for subprocess cleanup on cancellation #139957 — observe subprocess exit before completing forced cancellation (+9 production LOC).
refactor(plugins): centralize install recovery metadata #140002 — centralize install recovery metadata (−56 production LOC), with real CLI allowed/refused recovery proof.
refactor(plugins): share managed npm package traversal #140040 — share managed npm package traversal (−17 production LOC), preserving caller policies and native filesystem errors.
refactor(plugins): unify install config snapshot preparation #140081 — unify install config snapshot preparation (−36 production LOC), with real CLI recovery and plugins-include proof.
fix(plugins): retain service cleanup through late startup #140132 — retain service cleanup through late startup (+13 production LOC), with held-startup, ordering and exact-once cleanup proof.
refactor(plugins): stage managed npm installs before publication #140145 — prepare managed npm installs privately before publication (−545 production LOC), with five real-npm rollback, refusal, quarantine, cancellation and late-import scenarios.
refactor(plugins): derive catalog types from the Gateway protocol #140205 — derive catalog types from the canonical Gateway protocol (−20 production LOC), with exact type equality and identical emitted JavaScript.
refactor(plugins): share enablement mutation ownership #140215 — share CLI/management enablement mutations (−32 production LOC), preserving caller policy and consent order with real CLI parity.
refactor(plugins): share uninstall mutation ownership #140322 — share CLI/management uninstall ownership (−50 production LOC), with inherited Claw lease, failure recovery and fourteen real CLI parity scenarios.
fix(errors): preserve diagnostics and successful tool results #140362 — preserve cross-realm/disposal diagnostics and successful tool results when observer reporting fails (+43 production LOC), with causal Node probes and repaired restart/Codex consumer tests.
test(gateway): preserve saved config in auth reload fixture #140433 — preserve saved config in auth reload fixtures (no production change), with four causal Gateway/WebSocket cases and exact-head green CI.
test(gateway): retain saved source in reload fixtures #140453 — preserve saved source in the remaining SecretRef and Control UI reload fixtures (no production change), with two original failures, six passing Gateway cases and exact-head green CI.
fix(setup): match prepared credentials to the model provider #140461 — select the matching provider credential in the shared setup-plan owner (−12 production LOC), with causal multi-profile cases and real config-loaded provider proof.
fix(models): keep status plugin metadata isolated #140506 — keep models-status metadata inside its asynchronous scope and remove global lease restoration (−162 production LOC), with causal isolation coverage, real CLI proof and green rebased CI.
fix(plugins): isolate unreadable tool factory errors #140534 — safely report unreadable plugin factory errors while retaining healthy sibling tools (+1 production LOC), with real generated-plugin proof and green CI.
fix(ui): reconcile superseded config refreshes after mutations #140551 — reconcile superseded configuration reads after UI mutations (+97 production LOC), preserving real failures, drafts and reconnect ownership; includes paired browser proof and green CI.
fix: close prepared model runtimes before auth teardown #141280 — close prepared model runtimes and join native catalog-worker cleanup before auth teardown (+102 production LOC), with causal owner/native-worker proof, built Gateway shutdown and green CI.
These twenty-four merged PRs total −1,739 production LOC. #139891 was closed as redundant after #139820 independently fixed its session-delivery completion race. The remaining work is the coherent instance/source/resource ownership foundation, Gateway activation and RPC, then operator and agent surfaces. The separately reproduced process-group cancellation settlement race is fixed by #139957. The old A2UI hover/click test follow-up is already fixed on main by #139635.
What Problem This Solves
Operators and agents can install, enable, disable, uninstall, and reload plugins without restarting the Gateway. CLI, RPC, Control UI, and agent operations report whether a change was saved, applied, rejected, rolled back, or committed with a cleanup failure. TypeScript plugin edits can become available to running conversations without replaying completed actions.
Why This Change Was Made
One instance lifecycle now owns captured code, registrations, admitted calls, streams, and cleanup: prepare and validate replacements, fence affected instances, drain their work, publish replacements, and retire resources. Unrelated plugins retain their instances. This replaces duplicate loading, tool-scope, cache, and rollback paths; config watching and explicit reload share the same owner.
User Impact
Gateway connections stay up; affected services or channel accounts may restart internally. Control UI adds Reload and Remove. Installation supports npm, Git, and local sources, with existing consent, integrity, and enablement policy. Offline mutations save state for startup; reload requires a running Gateway. Bundled plugins can be disabled, and uninstall preserves linked source files.
Reload captures TypeScript, helpers, lazy imports, assets, and declared dependencies. Standalone files support literal local imports and asset URLs; computed inputs require a directory plugin. Plugin authors register cleanup through
api.lifecycle.onDispose. Managed facades remain replaceable across generations and reject fixed definitions, freezing, and sealing before they can pin retired code.Managed Codex conversations refresh native tool catalogs while preserving completed results; imported or supervised sessions need a new session for changed tool names or schemas. Native binary changes and compiled core code retain their build/update/restart path. Custom native module loaders require a separate process. This is a lifecycle boundary for trusted plugins, not a security sandbox. See plugin architecture.
Evidence
Historical donor validation: candidate
453d4ba6d6e1b3ebb2249c0e76ca87dc420957deon mainb3bdf3e1completed a fresh Linux build/live run successfully. All 40 lifecycle scenarios, the separate custom-loader rejection check, and five final-dispatch/authority cases passed. Gateway health-lifetime and plugin-reload recovery suites passed before the build, and all child processes joined. All 182 exported evidence files were preserved and hash-verified through native artifact/download transport. Testbox run. The donor full-branch CI is historical and is not a green-CI claim. Its Android trust-test race was repaired in #139807, and the A2UI hover/click race was independently repaired on main in #139635; each landed slice carries its own exact-head green CI.That historical donor candidate is −5 handwritten production LOC (+14,648/−14,653), +15,158 tests/support, and +903 generated against its actual base; moves are classified consistently. Split PRs carry their own scoped proof and CI. The later split candidates include additional ownership repairs and are still net-positive in aggregate; the requested overall net-negative production target has not yet been met. Final combined build/live proof remains pending. The separate instance foundation now passes fresh startup and two upgrades from official 2026.9.2: configured TypeScript plugins and a real CLI-managed JavaScript/CJS/assets installation. Those results are tied to the frozen foundation candidate under review, not the complete split feature.
The transcript integration passed 67 checks across four files after reproducing and fixing two cleanup races: shared global/selective stop could report success before cleanup completed, and a late watcher could lose its cleanup owner after failure. It preserves main's capture implementation and the feature's provider-selective restart behavior. Independent integration review completed with no findings. A further 49 catalog checks passed on the d922 predecessor.
The earlier completed Linux proof on
7fb3182c55155e223080841579a4fd4a0c16ad35also passed full build, singleton/build identity, readiness, startup profile, and 40 runtime scenarios: 13 native Codex, 21 built-Gateway/Control UI, and six discovery cases. These cover fresh linked TypeScript/npm installation, entry/helper/lazy-import/asset reload, failed-reload preservation, disable/enable/uninstall, draining, and conversation continuation. The UI maintained one connection, with zero unexpected closes, document reloads, or page errors; an unrelated service started once.Final-dispatch proof requested by ClawSweeper: five additional authority cases exercised the real Gateway dispatcher/agent runner or rejection before dispatch. Retained callbacks succeeded; unpublished, replaced, and revoked-during-await callbacks were rejected; admitted work drained after replacement. Two actual HTTP requests reached the scripted localhost provider. The host constructed the trusted registry; this proves the dispatch/revocation boundary, not installer trust selection or external authentication.
Loader compatibility boundary: an unsupported custom native-loader reload returned a visible preparation failure with
committed: falseand retained the working generation. Ordinary fresh installations and installed-code reloads passed separately. This does not establish compatibility for arbitrary custom loaders or all stable-release upgrades; representative stable-release upgrade coverage remains an explicit limitation for maintainer acceptance.Config and data-model scope: the current source audit adds no configuration schema keys/defaults, database schema/migrations, or protocol-version bump. Management RPC shapes are additive. The resolved-source write receipt is internal operation metadata, not a persisted configuration key; two existing help descriptions change. The memory settings page removes obsolete restart messaging, not vector/embedding storage. Existing storage encoding and limits remain in place.
All completed runtime phases and child processes joined. The initial artifact protocol failed; all 169 original files were recovered and hash-verified without rerun or resync. The scenarios use synthetic plugins, providers, and channel inputs; real external inference, authentication, and channel delivery are not claimed.
Before/after Control UI captures — completed 7fb318 runtime proof
These captures belong to the explicitly identified earlier build, not the newer 453d4ba runtime run.
[email protected]
Credit: @steipete.