Repository navigation
fix(agents): keep gateway prepared runtimes on built plugin artifacts - #126226
vincentkoc wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 7:18 AM ET / 11:18 UTC. ClawSweeper reviewWhat this changesThe PR preserves Gateway-selected built plugin artifacts through prepared agent runtime ownership, registry reuse, and deferred plugin-tool loading. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open: current main still lacks this lifecycle fact, while the PR consistently carries it into prepared registries and deferred plugin-tool loads. No blocking code finding; land only after exact-head required CI is green and the packaged smoke is confirmed on this head. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway startup prepares agent runtime snapshots and plugin registries for later turns. Those snapshots feed deferred plugin-tool loads, which should reuse the artifact choice made at startup rather than recompiling plugin source. flowchart LR
A[Gateway startup] --> B[Prepared runtime owner]
B --> C[Built-artifact preference]
C --> D[Plugin registry and load context]
D --> E[Deferred plugin-tool load]
E --> F[Built plugin artifact]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +32, Tests +29, Other +6. Total +67 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one Gateway-owned artifact fact in the prepared runtime input and verify the final packaged Gateway-to-deferred-tool path; the distinct owner, key, registry, and context boundaries make a net-neutral absorption impractical without reopening a source-default route. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review, but current-main source lacks the propagated preference and the owner/loader path is directly traceable; the PR also supplies a packaged reproduction record. Is this the best way to solve the issue? Yes. Recording the selection at the Gateway lifecycle owner and carrying it through existing identity, registry, and load-context seams is narrower and safer than adding a new config option or a deferred-load fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4af09d4961c9. LabelsLabel 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 (1 earlier review cycle)
|
97beaa5 to
6f30d3f
Compare
|
@clawsweeper re-review Exact-head proof and the reused-generation regression fix are now on |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Dallin Romney <[email protected]> Punchcard-Session: frost-orchard-lantern-ze
6f30d3f to
e4ad933
Compare
|
@clawsweeper re-review Exact-head CI's configured-owner lookup regression is fixed on |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Related: #125595
Successor to #125957, whose contributor branch is not maintainer-editable. This keeps Dallin Romney's original diagnosis and implementation credit; the commit includes Dallin as co-author.
What Problem This Solves
Fixes an issue where Gateway-prepared agent turns could synchronously compile bundled plugin source even after Gateway startup selected built plugin artifacts. On current
main, the affected prepared-runtime path performs 82 forced source transforms and spends roughly 23-27 seconds preparing runtime plugins.Why This Change Was Made
The built-artifact choice is now an explicit literal Gateway lifecycle fact carried through prepared owner input, generation identity, initial registry loading, reused generations, and deferred load context. It is never inferred from metadata, provenance, catalogs, bindings, or global state, so standalone and direct prepared runtimes remain source-default.
This is the narrow owner-boundary repair requested by the ClawSweeper review on #125957. An exact-head local review also found that a reused Gateway plugin generation could overwrite its attached built-artifact context with a flagless run projection; the final head preserves the immutable generation-owned
truefact and adds a red/green reuse regression.User Impact
Gateway agent turns can reuse the built plugin artifacts selected at startup instead of blocking on source transforms during initial or deferred plugin loading. Source-development and standalone runtime behavior is unchanged.
No config, environment, protocol, persistent schema, storage, Plugin SDK, public API, timeout, retry, or eager-preload behavior changes.
Production LOC: +30/-2 (net +28) for the explicit lifecycle ownership boundary.
Tests and build-smoke support: +61/-22 (net +39).
Evidence
e4ad9334b4c06924a5860f49e7cdb674815cad14:prepared-model-runtime.owner-selection.test.ts: 22 tests passed, including the branch-local CI regression6f30d3f1fe3afeccd9eab8af3ccaa3de3d7977a8:diffstoolpnpm test:build:singletonpassed from the emitted6f30d3f1fe3afeccd9eab8af3ccaa3de3d7977a8artifacts.pnpm buildemitted those artifacts, then its control-plane postbuild check hit a stale linked@openclaw/aiinstall missing current exports. The packaged proof used the built workspace package in an ignored local resolution overlay; shared dependencies and source were not modified.blacksmith-testboxtbx_01m0cc3gnjcfcc3ajk68ar6qqmpnpm buildandpnpm test:build:singletonpassed after thef92e9367e8c79e55041728d9f8c21f18fcaf7d3emanaged-cache repairnode scripts/check-changed.mjspassed all guards, formatting, boundaries, dead-code checks, and core production typecheck, then captured the unrelated existing Control UI test-type error atui/src/pages/chat/route-loader.ts:712(literalSessionKey). This PR does not modify that surface.git diff --checkpassed.The branch-local CI failure on
6f30d3f1fe3afeccd9eab8af3ccaa3de3d7977a8was caused by a fully specified configured-owner reader omitting the Gateway-owned artifact preference bit. The resolver required exact identity before reaching its existing configured-owner wildcard match, while acquisition correctly rebound the same input. The final head lets only an absent artifact preference reach that configured-owner match; explicit artifact identities and standalone owners remain exact.Base proof was completed on
f92e9367e8c79e55041728d9f8c21f18fcaf7d3e. Latermaindrift throughcb5c061cb36adoes not overlap the reviewed prepared-model-runtime or artifact-selection owner files, so the exact-head proof was preserved without a drift-only rebase.Punchcard-Session: frost-orchard-lantern-ze