Skip to content

fix(codex): let owners install plugins from discovered marketplaces - #122389

Merged
Kimiyu-186 merged 3 commits into
mainfrom
codex/dynamic-plugin-marketplaces-owner-install
Aug 12, 2026
Merged

Kimiyu-186 merged 3 commits into
mainfrom
codex/dynamic-plugin-marketplaces-owner-install

Conversation

@Kimiyu-186

@Kimiyu-186 Kimiyu-186 commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Codex-mode OpenClaw users cannot use plugins from repository, bundled/runtime, shared, personal, or enterprise marketplaces when those marketplaces are already available to their Codex account. Previously, native plugin configuration accepted only the curated and workspace-directory marketplace names, so valid plugins from other sources were rejected or lost their connector ownership when a conversation resumed.

Why This Change Was Made

Discover marketplaces through Codex's own app-server catalog, scoped to the bound workspace, including supplemental workspace, shared, and personal catalogs. An authenticated owner or operator.admin must explicitly install and authorize each plugin@marketplace; the owner-scoped agent discovery tool is read-only, and ordinary turns cannot install plugins, enable plugins, or add marketplace sources.

Preserve existing curated aliases, automatic recovery, migration, per-plugin destructive-action policies, and account/runtime cache isolation. Codex remains responsible for marketplace source restrictions, workspace administration policy, installation, and connector authorization. Remote plugins that require Codex's installation-confirmation interstitial, or whose upstream confirmation requirement is unknown, are directed to Codex instead of bypassing that protocol requirement. This widens the existing marketplace-name field to Codex's validated identifier format without adding an OpenClaw-specific marketplace allowlist, source trust model, or installation policy. It does not change defaults, enable allow_all_plugins, or introduce a hook-isolation boundary.

User Impact

Owners can ask which plugins Codex can already see, inspect /codex plugins available, and authorize one plugin with /codex plugins install security-review@company-tools. Already-authorized connector apps become available to later Codex conversations without repeat installation approval, while existing curated/workspace plugins, Computer Use, migration, and connector sign-in restrictions continue to work.

Evidence

  • 28 focused Codex extension suites and 1,117 tests passed, covering marketplace identity collisions, canonical curated wire aliases, owner/admin authorization, model read-only discovery, gateway versus paired-node workspace isolation, unsafe catalog text, qualified/unqualified catalog de-duplication, restrictive catalog-policy merging, required remote installation-confirmation interstitials, previously installed plugin authorization, opaque remote install selectors, marketplace-scoped cache isolation, legacy configuration keys containing @, administrator-disabled plugin ownership across curated and enterprise marketplaces, fail-closed account-wide admission, session restoration, connector ownership, migration, Computer Use, MCP, hooks, and approval bridges.
  • Production and test TypeScript checks passed: node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo and node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo.
  • Changed-file oxlint, oxfmt --check, git diff --check, and repository autoreview/secret scanning were run locally.
  • Verified the public Codex upstream contract at commit 410c22b30e71:
  • Upgrade compatibility is covered by the existing curated/workspace configuration, activation, migration, Computer Use, connector policy, and session-restoration suites plus new marketplace-identity regressions. No database schema, backfill, or migration format is added: existing marketplace-name validators and the existing serialized plugin-policy identity are widened without changing their storage shape.
  • Installation is an intentional owner/operator.admin capability: models receive read-only discovery, unavailable/admin-disabled plugins are rejected, Codex remains the source/workspace/install-policy authority, remote confirmation-required or unknown-confirmation installations fail closed, and installed plugin skills, apps, MCP servers, and hooks remain within the explicitly documented owner trust decision.
  • AI-assisted; independently reviewed and validated before opening this draft.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: codex size: XL maintainer Maintainer-authored PR labels Aug 12, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 4:26 PM ET / 20:26 UTC.

ClawSweeper review

What this changes

The PR lets an owner or operator admin discover Codex marketplace plugins and explicitly install or authorize one for later Codex conversations.

Merge readiness

⛔ Blocked by patch quality or review findings - 6 items remain

Keep open. Current main still limits native Codex plugin policy to curated and workspace-directory marketplaces; this PR adds a distinct owner-managed capability, but needs product sponsorship, direct upstream-contract inspection, and inspectable current-head runtime proof before merge.

Priority: P2
Reviewed head: bb3fef26c3be5573f0d8306a87e34a853b7abeba
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 7 items Current-main behavior: Current configuration accepts only openai-curated and workspace-directory marketplace names.
Current runtime boundary: Current activation handles curated plugins and requires workspace-directory plugins to be installed outside OpenClaw.
Proposed owner boundary: The branch re-queries the catalog, rejects unavailable entries, uses catalog-provided selectors, and persists authorization only after the command path succeeds.
Findings None None.
Security Needs attention Verify Codex install-selector enforcement: The command forwards catalog-provided marketplace paths or remote IDs to Codex, so the pinned app-server policy and exact selector validation must be reviewed before approving this trust expansion.

How this fits together

The Codex extension turns OpenClaw commands and agent tools into Codex app-server catalog and runtime calls. Its stored plugin policy determines which plugin apps, MCP servers, and capabilities can enter a native Codex thread.

flowchart LR
A[Owner or admin] --> B[Codex plugin command]
B --> C[Codex marketplace catalog]
C --> D[Install or authorization decision]
D --> E[Stored plugin policy]
E --> F[Native Codex thread]
F --> G[Plugin apps and MCP servers]
Loading

Decision needed

Question Recommendation
Should OpenClaw expose owner-managed installation and authorization of any Codex-discovered marketplace plugin, including its skills, apps, MCP servers, and hooks? Sponsor owner-managed marketplace installs: Keep the scoped command and require direct Codex-contract review plus current-head runtime proof before merge.

Why: This is a deliberate expansion beyond the established curated/workspace contract; code review cannot choose the permanent operator trust boundary.

Before merge

  • Resolve security concern: Verify Codex install-selector enforcement - The command forwards catalog-provided marketplace paths or remote IDs to Codex, so the pinned app-server policy and exact selector validation must be reviewed before approving this trust expansion.
  • Resolve merge risk (P1) - The command turns an owner decision into admission of plugin-provided skills, apps, MCP servers, and hooks; the exact Codex marketplace-policy and install-selector contract remains unverified locally.
  • Resolve merge risk (P1) - The branch widens a persisted marketplace identity field and is behind current main, so upgrade behavior and proof should be refreshed against the merge result.
  • Resolve merge risk (P1) - The feature adds net 1,112 runtime/config lines; the expanded capability needs explicit owner acceptance and a compact real-runtime trace to justify that surface.
  • Improve patch quality - Resolve the security review concern or explain why the changed path is safe.

Findings

  • [medium] Verify Codex install-selector enforcement — extensions/codex/src/command-plugins-management.ts:374
Agent review details

Security

Needs attention: No implementation-local exploit was established, but the security boundary depends on an upstream Codex contract that could not be directly inspected.

PR surface

Source +1211, Tests +2164, Docs +51. Total +3426 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 18 1315 104 +1211
Tests 13 2316 152 +2164
Docs 5 142 91 +51
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 3773 347 +3426

Review metrics

Metric Value Why it matters
Config contract 1 marketplace validator widened; 0 new top-level settings Existing serialized Codex plugin policy can now retain marketplace identities that current main rejects.
Runtime versus tests runtime/config +1216/-104 (net +1112); tests/support +2415/-152; docs +142/-91 The capability is substantially larger than a narrow bug fix, so ownership, proof, and maintenance cost deserve explicit review.

Stored data model

Persistent data-model change detected: database schema: extensions/codex/src/app-server/session-binding.test.ts, migration/backfill/repair: docs/plugins/codex-harness-reference.md, persistent cache schema: extensions/codex/src/app-server/plugin-inventory.marketplaces.test.ts, persistent cache schema: extensions/codex/src/app-server/plugin-metadata-cache.test.ts, persistent cache schema: extensions/codex/src/command-handlers.ts, serialized state: extensions/codex/src/app-server/plugin-inventory.ts, and 11 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Validate before merge (recommended)
    Attach a redacted current-head runtime trace and independently verify the pinned Codex source contract for marketplace policy and remote/local install selectors.
  2. Pause the expanded trust surface
    Keep the existing marketplace boundary until an owner explicitly accepts the broader plugin-install capability.

Technical review

Best possible solution:

If sponsored, retain the plugin-local owner command, keep Codex as the sole marketplace-policy authority, and merge only after direct upstream-contract review plus redacted current-head discovery, authorization, denial, and admission proof.

Do we have a high-confidence way to reproduce the issue?

Not applicable as an established-behavior bug: current source intentionally supports only two marketplace identities, while the PR proposes a new owner-managed capability. The claimed staging result is not yet backed by an inspectable artifact.

Is this the best way to solve the issue?

Unclear: the extension owns this behavior and the design keeps Codex authoritative, but maintainers must decide whether the expanded trusted installation workflow is the right product boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 88d6b571b09b.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded owner-facing Codex capability expansion rather than an urgent broken default path.
  • merge-risk: 🚨 compatibility: The PR changes persisted marketplace identity validation and runtime admission for existing plugin policy.
  • merge-risk: 🚨 auth-provider: Discovery and connector availability are scoped to the authenticated Codex account and workspace.
  • merge-risk: 🚨 security-boundary: An explicit owner command can admit plugin-provided apps, MCP servers, hooks, and skills into a Codex thread.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

Security concerns:

  • [medium] Verify Codex install-selector enforcement — extensions/codex/src/command-plugins-management.ts:374
    The command forwards catalog-provided marketplace paths or remote IDs to Codex, so the pinned app-server policy and exact selector validation must be reviewed before approving this trust expansion.
    Confidence: 0.85

What I checked:

Likely related people:

  • Amp: Available shallow history attributes the current Codex plugin-management implementation to this author. (role: recent area contributor; confidence: medium; commits: 54734a3f0caa; files: extensions/codex/src/command-plugins-management.ts, extensions/codex/src/app-server/plugin-inventory.ts)
  • steipete: Authored the Codex app-server configuration split that owns the marketplace identity contract. (role: adjacent configuration owner; confidence: medium; commits: 4f1b5da9d820; files: extensions/codex/src/app-server/config-contracts.ts, extensions/codex/src/app-server/config-parsing.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-12T03:14:20.228Z sha 8554173 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-12T07:10:23.055Z sha 8554173 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-12T19:17:42.487Z sha 52b5e32 :: found issues before merge. :: [P3] Clarify already-installed plugin authorization

@Kimiyu-186

Kimiyu-186 commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I checked the complete PR head and the public Codex source directly; the missing sibling checkout and partial-clone failures in the review environment are evidence-collection limitations rather than findings in the change.

Upstream installation and authorization contract

The authoritative public Codex implementation, pinned to 410c22b30e71, establishes the boundaries this PR relies on:

The PR does not add a competing marketplace trust policy or bypass these upstream checks. Its deterministic owner/admin command re-queries the account-scoped catalog, uses only the catalog-provided local marketplace path or opaque remote plugin ID, rejects unavailable entries, and fails closed for required or unknown remote confirmation. Already-installed plugins can be authorized without attempting a second installation. The model-facing discovery tool cannot install or enable anything.

Compatibility and owner boundary

There is no database-schema change, backfill, or new persistent cache format. This change widens the existing marketplace-name validators and preserves the existing serialized plugin-policy shape; curated wire aliases, historical configuration keys, workspace-directory plugins, existing migration/recovery behavior, connector ownership, Computer Use, and session restoration are explicitly covered by the regression suites.

I ran 28 Codex extension suites / 1,117 passing tests, both production and test TypeScript checks, and changed-file lint/format/secret checks. Coverage includes marketplace identity collisions, scoped account/runtime caches, disabled marketplace entries, owner/admin authorization, ordinary-user denial, read-only model discovery, remote confirmation rejection, opaque remote IDs, already-installed plugin authorization, existing curated/workspace configurations, MCP, hooks, and approval bridges.

Installing plugin-provided skills, apps, MCP servers, and hooks is intentionally an explicit owner/operator.admin trust decision. Defaults are unchanged; the PR does not enable allow_all_plugins, let the model add marketplace sources, or auto-install newly discovered non-curated plugins. Maintainer signoff on exposing this owner-managed installation command is still the appropriate product decision.

I also added the pinned upstream references and compatibility details to the PR description. A selected-tenant runtime deployment will be added when an authorized owner can run it.

@clawsweeper re-review

Current-head deployment and regression proof (2026-08-12)

I addressed the remaining documentation finding at current head bb3fef26c3b by distinguishing successful new installation from Codex-confirmed authorization of an already-installed and enabled plugin. git diff --check and the repository formatter both pass.

An owner-scoped staging developer deployment ran the exact PR runtime changes backported onto the currently supported OpenClaw baseline and Codex app-server 0.146.0; the strict version guard and existing SQLite schema remained unchanged. The gateway and all sidecars became healthy. An authenticated operator.admin client successfully listed 2,792 discovered plugins and authorized an already-installed plugin through /codex plugins install; an otherwise identical operator.write client was denied.

Most importantly, the same non-mutating native-thread inventory input for an actually installed appsec@openai-monorepo plugin was replayed through both running images:

  • Current production Security Claw: zero admitted plugin records and zero MCP servers.
  • PR staging image: one admitted installed/enabled AppSec plugin, no diagnostics, no activation/install request, and all three declared MCP servers: boxes, security-drift-monitor, and secbot.

This directly reproduces the production non-curated marketplace authorization defect and proves the PR fixes the architectural owner without modifying either tenant configuration.

I also independently inspected the sibling Codex checkout at 410c22b30e71265cb5a0cfe69f5e80391393b946: codex-rs/core-plugins/src/marketplace_policy.rs:81-142 enforces managed source/name/root restrictions; codex-rs/core-plugins/src/manager.rs:1455-1484 validates that policy before local installation; and codex-rs/app-server/src/request_processors/plugins.rs:1471-1495,1561-1608 requires exactly one trusted selector, enforces workspace policy, validates opaque remote identities against authoritative details, and rejects administrator-disabled plugins. Remote installations with required or unknown interstitial metadata still fail closed in OpenClaw.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Kimiyu-186
Kimiyu-186 marked this pull request as ready for review August 12, 2026 18:24
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@Kimiyu-186
Kimiyu-186 enabled auto-merge (squash) August 12, 2026 20:28
@Kimiyu-186
Kimiyu-186 merged commit e1b8150 into main Aug 12, 2026
121 checks passed
@Kimiyu-186
Kimiyu-186 deleted the codex/dynamic-plugin-marketplaces-owner-install branch August 12, 2026 20:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 13, 2026
…penclaw#122389)

* fix(codex): allow owner-approved marketplace plugins

* fix(codex): preserve marketplace validation and remove unused exports

* docs(codex): clarify already-installed plugin authorization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant