Repository navigation
fix(plugins): loading no longer crashes on malformed build metadata - #117639
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 6:33 PM ET / 22:33 UTC. ClawSweeper reviewWhat this changesThe PR makes plugin registry records ignore malformed non-string Merge readinessKeep this PR open for normal merge review: current main still calls Priority: P2 Review scores
Verification
How this fits togetherPlugin discovery reads third-party package metadata and turns manifest-backed candidates into registry records used by plugin inspection and runtime activation. That record-building step feeds both lightweight metadata loading and the path that imports a plugin at runtime. flowchart LR
A[Third-party plugin package.json] --> B[Plugin discovery]
B --> C[Manifest-backed candidate]
C --> D[Shared plugin record builder]
D --> E[Plugin registry]
E --> F[CLI plugin inspection]
E --> G[Runtime plugin activation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +46. Total +51 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the shared-boundary normalization and regression test so malformed third-party package metadata is treated as absent without changing the documented valid-string metadata contract. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a high-confidence path: a numeric Is this the best way to solve the issue? Yes. Normalizing at the shared manifest-record builder is the narrowest maintainable repair because both loader modes consume that record and the repository already provides this exact canonical optional-string contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b84d7e3d5476. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer verification on exact contributor head
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where plugin loading could crash when a plugin package contained a non-string
openclaw.build.openclawVersionvalue.Why This Change Was Made
Manifest-backed plugin records now read build provenance through the canonical optional-string normalizer. Valid strings remain trimmed, while empty or malformed values are treated as absent. The shared record builder covers both runtime and CLI plugin loaders without changing the documented package metadata contract.
User Impact
Malformed third-party plugin build metadata no longer aborts plugin registry construction. The affected metadata is ignored and normal plugin diagnostics can continue.
Evidence
TypeError: ...openclawVersion?.trim is not a function../node_modules/.bin/oxfmt --check --threads=1 src/plugins/loader-shared.ts src/plugins/loader-shared.test.tsgit diff --check upstream/main...HEADnode scripts/docs-list.jsgpt-5.6-sol, high): clean, no accepted/actionable findings.ECANCELEDafter the no-output watchdog. The added regression remains for CI execution; no full local suite was run.Real loader proof
Executed against the CI-built
dist-runtime-buildartifact for exact PR head6bf72ad9a239155315c11f56dd64f2a4ec5f76cf(artifact digestsha256:46323ad6dadd7be00082ba71b0c7a68e39ead4ecd418a83541f6b3e298ece60e).$PROOF_ROOTbelow is an isolated temporary directory; paths are redacted.The on-disk plugin fixture contained malformed numeric build provenance:
The CLI metadata loader completed normally and omitted the malformed provenance:
The runtime loader also imported the plugin and completed normally:
Both commands exited
0. This exercises the publicplugins inspectcommand through both loader modes: the malformed metadata no longer crashes registry construction, and the plugin reaches the normal loaded state.AI Assistance
AI-assisted with Codex. I reviewed the implementation and understand the change.