Repository navigation
fix(plugins): keep development runs on checkout plugins - #132201
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 9:10 PM ET / August 29, 2026, 01:10 UTC. ClawSweeper reviewWhat this changesThe branch makes checkout development runners prefer the checkout’s bundled plugin over a tracked global duplicate, retains bundled provenance for aliases of the same physical plugin, and carries the selector through Gateway watch. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for explicit maintainer handling. The current main snapshot still has the pre-fix candidate de-duplication and lacks the runner and tmux selector propagation; the PR supplies a focused, net-negative owner-boundary repair with no blocking code findings. Priority: P2 Review scores
Verification
How this fits togetherPlugin discovery collects bundled, configured, and installed plugin candidates, then manifest selection chooses the active source before the runtime applies its existing trust gate. Development runners provide the checkout selector so local development resolves the intended bundled plugin. flowchart LR
A[Development runner] --> B[Checkout selector]
B --> C[Plugin discovery]
D[Bundled and global plugins] --> C
C --> E[Manifest selection]
E --> F[Runtime plugin loader]
F --> G[Existing trust gate]
Decision needed
Why: The patch deliberately changes which plugin source wins and therefore affects an existing trust-sensitive compatibility boundary, even though the trust gate itself is unchanged. Before merge
Agent review detailsSecurityNone. PR surfaceSource -78, Tests +254, Docs +20, Other +3. Total +199 across 22 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the scoped manifest-first selection repair while retaining physical-root containment and the existing untrusted behavior for different local copies. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the fetched main code lacks compiled-tree recognition, selector-aware snapshot invalidation, and runner propagation; the added focused tests encode those concrete cases. Is this the best way to solve the issue? Yes. Moving precedence into manifest selection and making runtime loading consume only manifest winners removes the duplicated ranking rather than adding a trust bypass. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 831e2de0a367. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
eac4f8f to
a52c1cf
Compare
|
Addressed the Gateway-watch finding and its Rank-up move in c56a438. The existing Both extended command tests failed before the fix; all 229 watch/run-node and discovery/manifest tests pass afterward. The generated command was also executed through a real shell and a dedicated real tmux socket with stale server/session values. Both child stages reproduced the wrong value before, then received the explicit checkout or an unset selector after. Only a harmless recorder child ran; no Gateway or operator service was touched, and the owned tmux server was removed. Scoped lint/format, script erasability/types, all core-test typecheck shards, wrapper checks and fresh isolated Codex autoreview (configured P0 threshold) passed. The aggregate local gate exposed the existing 724/720 UI shard count on the rebased base, already corrected by #132193; no limit or assertion was weakened. The previous Linux-fixture correction and #132181 docs correction are retained. Production is +68/-144 (net -76), tests/support +316/-61, docs +20/-0. CI for this exact head and the required gate completed successfully; the repository watcher reports GREEN with no pending checks. The PR body retains the original real provider/restart evidence and all proof-media URLs. No redundant re-review request is needed for this requested finding fix. |
|
Merged via squash.
|
Closes #132171
What Problem This Solves
Fixes an issue where developers running OpenClaw from a checkout could hit
openSyncKeyedStore is only available for trusted pluginsbecause a tracked global plugin copy won over the checkout's compiled plugin. Aliasing the exact same bundled entry through a configured path could also discard its provenance. The isolated live reproduction produced the reported Codex/global-origin error in the Control UI.Why This Change Was Made
Development selection belongs to the loader, not a capability bypass. The source runner now supplies the existing checkout selector; the shared host-root containment check covers source,
dist/extensions, anddist-runtime/extensions; physical aliases retain independently established bundled provenance while preserving explicit path priority. Cache identity and persisted-index validation account for the selector. Manifest selection is the single duplicate-precedence owner; the redundant runtime ranking is deleted.The runtime state trust gate is unchanged. No new config or environment option, dependency, SQLite schema/format, or protocol surface is added. Arbitrary links, local archives,
npm-pack:artifacts, official-looking names, and allowlists do not gain trusted capabilities. Explicit overrides to different code retain their existing priority and trust policy; active metadata remains immutable until its existing reload boundary.User Impact
Checkout development uses the intended local plugin build without requiring an npm publication or weakening production trust. Built output stays preferred, source-only plugins remain available, and the docs now describe the actual development and override behavior.
Release-note context: repair development plugin provenance so local Codex chat and other guarded plugin-state consumers are not accidentally routed through an untrusted global shadow. Reported and directed by @steipete; AI-assisted implementation and independent Codex review.
Evidence
Live before/after, real Gateway and provider: fresh isolated home/config/state and a non-operator port; a separate physical copied Codex package recorded through the canonical install-record owner created the tracked global shadow. The frozen pre-fix runtime reproduced the exact state-access denial. The repaired runner's
plugins inspect codex --jsonselected<checkout>/dist/extensions/codex/index.jswithorigin: bundled. A real API-backedopenai/gpt-5.6-lunachat returnedDEV_TRUST_OK, created one durable native binding, and after Gateway restart returned the distinctDEV_TRUST_RESTART_OKon the same native thread. No operator Gateway or state was changed.The live Gateway ran through the documented built entry with
OPENCLAW_DEV_SOURCE_ROOTafter the source runner's selection was verified separately. This separated build from execution after two source-backed proof commands raced to rebuild the dirty checkout; that setup failure was corrected before the successful recording. No provider/channel mock, fabricated response, state-trust override, or test-only bundle-root bypass was used in the live flow.Focused verification:
Independent final rerun: 51 passed. Broader owner/sibling runs passed: launcher/discovery/manifest/bundled roots (341), snapshot/control-plane/lifecycle (80), loader/SDK/state/hooks/ingress/metadata (374; one existing Windows-only skip). Counts overlap and are not a unique total. The initial unmodified-production regression run failed five boundary cases; the source-runner default-selector regression also failed before repair. Explicit override order and stale snapshot cases caught intermediate errors and pass on the final implementation.
Passed core, core-test and script typechecking; lint/format; plugin and metadata boundaries; database-first/schema guards; and runtime import cycles (zero). An initial test fixture type annotation and two test-only lint findings were corrected before the successful final gate.
Full uncached build passed, including all 147 SDK exports and the Control UI (11m 6.8s). The exact repository-pinned pnpm 11.22.0 entrypoint was invoked directly because the host's pnpm shim pointed at a missing file. No ineffective dynamic import warning. Both changed MDX pages parsed; 6,965 internal links checked with zero broken links.
git diff --checkand fresh structured Codex autoreview passed; no accepted/actionable findings.Size: production +68/−144, net −76; tests/test support +316/−61; docs +20/−0. The additions preserve explicit selection independently of provenance, fence physical root escapes, and make cached selection reflect the existing process selector. Removing the duplicate ranking more than offsets them.
Provenance: the source-only development preference was introduced by direct commit
ae800e160d065f4922706a036911d2ffa2c04908(2026-05-30 UTC, author and committer @shakkernerd); it omitted the already-supported compiled layouts. This is an incomplete existing selection flow, not a new Codex authentication restriction. The screenshot alone does not establish its original instance's undisclosed source path; the isolated reproduction establishes the defects repaired here.Known adjacent observation: the first recovered reply left the earlier historical error banner visible in the already-open chat; a reload/restart cleared it and the next turn remained healthy. This separate UI error-state lifecycle was handed to the ongoing composer investigation, not hidden or claimed fixed by this loader change. The recording preserves that intermediate state. General declarative/self-hosted plugin trust (#92516) remains outside this repair.
Rebase and CI follow-up: rebased onto
a49da4208bc85b6af5b82e87cf495f38de9a042bto resolve the actual base conflict. The only conflict wasdocs/plugins/architecture.md; the landed correction from #132181, including the source-snapshot trust paragraph, is preserved with our additional alias/runner paragraph. The corrected manifest page is unchanged from that base. The original 17 modified code/test files remain byte-identical to the reviewed and live-tested implementation. Incoming base changes to native cleanup/public-surface loading were inspected separately and passed 126 focused tests (one existing Windows-only skip). The rebased runner/discovery/snapshot/state rerun passed 134 tests; both changed MDX pages, formatting, 6,970 internal links, andgit diff --checkpassed.The first exact-head CI run exposed an existing Linux node integration fixture that symlinked its plugin outside its temporary bundled root. The approved physical-containment check rejected that fixture. The test-only follow-up copies the real plugin inside a temporary checkout directory, where normal workspace dependencies remain resolvable; all command, capability, and pairing assertions are retained. The original test failed locally, the corrected test passes, and scoped lint/format plus fresh Codex autoreview pass. Production code is unchanged; no trust bypass, timeout increase, or assertion weakening was added. The corrected fixture passed CI on that head. No full-build repeat was needed for docs reconciliation and a test fixture correction.
Gateway-watch follow-up: the latest ClawSweeper finding and Rank-up move exposed a missing handoff of the existing
OPENCLAW_DEV_SOURCE_ROOT. Commitc56a438869bd3111efb8fe88725a4a33d2969bf2adds it to the existing tmux clear-then-assign environment list, preserving an explicit caller selection and clearing stale server/session selection when omitted. Both extended command tests failed before the change. All 229 targeted watch/run-node and discovery/manifest tests now pass. Real-shell and isolated real-tmux runs of the generated command failed both cases before and passed both afterward, including both child stages. The harmless recorder child never invoked a Gateway or operator service; the isolated tmux server was cleaned up.Fresh isolated Codex autoreview is clean at the configured P0 threshold. Scoped lint/format, script erasability, script typechecking, all core-test typecheck shards, wrapper-shadowing and command-boundary checks passed. The local aggregate changed-file gate hit a pre-existing UI shard-size failure (724 roots against 720), independently present in the rebased base; #132193 already fixes it on main by splitting the shard without changing the limit. The remaining local checks were run directly and passed. No new runtime seam, configuration, trust exception, build artifact or unrelated shard change was added. Exact-head CI and the required gate passed for
c56a438869bd3111efb8fe88725a4a33d2969bf2; the repository watcher completed GREEN with no pending checks. The original provider/restart proof remains applicable because runtime code is unchanged.Visual proof
Before: the actual global-origin trust denial in the isolated live chat.
After: two real Codex replies, including successful native-thread resumption after Gateway restart with the same state and global shadow still present.
Recording: pre-fix failure → first recovered reply (with the historical UI-banner observation above) → healthy restart/resume.
dev-trust-recovery-and-restart.mp4