Repository navigation
fix(plugins): name the selected driver when a plugin id is not offered - #1404
Conversation
Selecting occ-plugin:diffs while the Installation selects codex-plugin (or a Codex app under occ-plugin) answered 400 'The supplied plugin policies are invalid.' with no hint. Unknown plugin IDs now name the selected Plugin Driver and say an Installation selects one Driver. Other policy errors are unchanged.
… nits) A Codex selection with toolDefaults.reviewer under occ-plugin reported the unsupported reviewer instead of the plugin the Driver does not offer. Resolve the ID first, cover a Codex ID without the marketplace suffix, and say in the reference that Codex admission checks only the prefix and marketplace.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 5, 2026, 2:25 PM ET / 18:25 UTC. ClawSweeper reviewWhat this changesThe PR makes rejected plugin selections name the Installation’s selected Plugin Driver, prioritizes plugin-ID errors over unsupported policy fields, and adds regression coverage and reference documentation. Merge readiness✅ Ready for maintainer review Keep open for maintainer triage: current main still lacks the clearer diagnostic, and the patch has no identified correctness or security blocker. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw Control Plane validates Agent plugin selections through the Installation’s selected Plugin Driver before saving or admitting a deployment. Validation failures become HTTP error responses for console, CLI, and API callers. flowchart TD
A[Agent plugin selections] --> C[Selected Plugin Driver]
B[Installation configuration] --> C
C --> D[Validate ID and policy]
D --> E[Reject invalid selection]
E --> F[HTTP 400 with Driver guidance]
D --> G[Save or admit deployment]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep plugin-ID diagnostics in the existing Driver validation and HTTP error path while preserving current admission decisions. Do we have a high-confidence way to reproduce the issue? Yes, from source: submitting occ-plugin:diffs while codex-plugin is selected reaches the generic validation error on current main. No live reproduction was executed during this review. Is this the best way to solve the issue? Yes. Tagging the existing ID failures and mapping them through the existing error owner is a narrow repair that preserves rejection behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f882c6ebb4a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Problem
Dogfood finding D108, seen again in round 22. While the Installation selects
codex-plugin, the plugins-configure.md CLI example on a dedicated Codex Agent ("occ-plugin:diffs") answers400 INVALID_REQUEST: The supplied plugin policies are invalid.The message names neither the plugin nor the selected Driver. An Installation selects one Plugin Driver, so the same thing happens on update or deploy after a Driver switch.Change
PluginPolicyValidationErrorgains anunknownPluginfield. Its message names the selected Plugin Driver ID, which comes from trusted Installation configuration and never from the request, and says an Installation selects one Driver.policyField: "pluginId". It now resolves the plugin ID before any policy field check, so a Codex selection withtoolDefaults.reviewerunderocc-pluginreports the ID mismatch, not the reviewer field.BundledPluginDriverBase.validatemaps that field to the new error. Deployment admission uses the same path.Other policy errors keep their current messages.
Verification
node --test tests/conformance/plugin-driver.test.mjs: 29/29 pass, including the new test.node --test --test-name-pattern '[Pp]lugin' tests/integration/occ-api.test.mjs: 5/5.tsc --build, eslint and prettier on the touched files; docs word count and docs-site link check.dd934c39bbefore the change.Risks
Low. This changes only the message text of a 400 that was already returned. No admission decision changes: the moved ID check runs on input that was already rejected later in the same loop. Clients matching the old generic text for unknown IDs would see the new one; no test or console code does.
Conflict gate (no new conflicts)
git merge-tree --write-treeof each open PR touching these files, againstorigin/mainand against this head:drivers/plugin/index.ts2 → 2packages/occ/src/errors.ts1 → 1drivers/plugin/index.ts1 → 1,agent-plugins.md1 → 1