Skip to content

fix(plugins): reject cyclic marketplace aliases at their owner - #117440

Merged
steipete merged 1 commit into
mainfrom
codex/qa400-marketplace-alias-cycle-owner
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa400-marketplace-alias-cycle-owner

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

A self-referential or cyclic entry in Claude's documented known-marketplace registry makes OpenClaw recursively reread the registry forever. Both marketplace listing and plugin installation hang; installation also retains the shared plugin-lifecycle mutation lease while the operation never settles.

Why This Change Was Made

The marketplace loader owns alias resolution. Resolve aliases iteratively against one registry snapshot, track per-call visited marketplace identities, and return a deterministic actionable cycle diagnostic. This removes recursive loading and redundant registry reads while preserving installed-local-marketplace precedence, source labels, malformed-source fallback, transport trust, cleanup, and independent root calls.

User Impact

openclaw plugins marketplace list <name>, explicit plugins install --marketplace <name>, and Claude-style <plugin>@<marketplace> installation now fail promptly with the actual alias chain instead of hanging. Existing valid marketplaces and remote-install safety rules retain their behavior.

Evidence

  • Exact immutable head: e7114c0f1f5dd26aca9194317815cf5283191b1c; parent fb9c8e74e61977835d811f2855ca2b134d549c4f.
  • Tests-first unchanged-production baseline: four bounded failures for self/two-node cycles across listing and installation.
  • Focused candidate: six cycle, independent-alias, and malformed-source regressions pass.
  • Full owner test suite: 37/37 pass, including existing remote trust, SSRF, path containment, immutable provenance, and cleanup tests.
  • Configured type-aware oxlint, oxfmt, and git diff --check all pass on the exact two changed files.
  • Real no-module-mock owner proof verifies both cycle shapes, valid installed-local precedence, repeated independent calls, unchanged registry contents, malformed-source fallback, and zero network calls.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 10:18 AM ET / 14:18 UTC.

ClawSweeper review

What this changes

The PR makes plugin marketplace alias resolution iterative, returns a deterministic cycle error instead of recursing indefinitely, and adds listing/install regressions.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-labeled PR open for normal landing review. Current main recursively follows normalized known-marketplace aliases without a termination condition; this owner-boundary repair snapshots the registry, detects cycles before local or remote work, and preserves the tested valid paths.

Priority: P2
Reviewed head: e7114c0f1f5dd26aca9194317815cf5283191b1c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-boundary fix with direct regressions and accepted runtime proof; pending CI and protected maintainer review are normal landing gates, not patch defects.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.
Evidence reviewed 6 items Current-main defect: Current main recursively invokes the marketplace loader for every normalized known alias with no visited-alias check, so a cyclic registry re-enters the same loader indefinitely.
Candidate repair and coverage: The PR snapshots the registry, tracks aliases in call-local state, returns the complete cycle chain, and covers self/two-node cycles across list and install plus local precedence, independent calls, and malformed-source fallback.
Shared execution boundary: Both listing and installation call the same loader; installation enters cleanup and install-policy handling only after marketplace loading succeeds, so detecting a cycle at this boundary prevents downstream work from starting.
Findings None None.
Security None None.

How this fits together

The plugin marketplace resolver turns CLI marketplace names and Claude registry aliases into a local marketplace manifest or a remote clone. Marketplace list and install commands consume that result, with installation then applying the existing plugin install-policy checks.

flowchart LR
  A[Marketplace CLI input] --> B[Marketplace resolver]
  C[Known marketplace registry] --> B
  B --> D{Alias cycle?}
  D -->|Yes| E[Actionable error]
  D -->|No| F[Local manifest or remote clone]
  F --> G[Marketplace list]
  F --> H[Plugin installation policy]
Loading

Before merge

  • Resolve merge risk (P1) - This PR is behind current main and CI was still running at review time; land only after the exact head is cleanly merged against the current base and required checks finish green.
  • Complete next step (P2) - The maintainer label requires explicit maintainer handling; no discrete code defect is suitable for an automated repair lane.
Agent review details

Security

None.

PR surface

Source +12, Tests +162. Total +174 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 23 11 +12
Tests 1 162 0 +162
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 185 11 +174

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/plugins/marketplace.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Refresh current-head merge proof (recommended)
    Allow landing after the clean merge result and pending exact-head checks confirm that valid existing marketplace aliases still resolve normally.
  2. Pause if validation regresses
    Hold the PR rather than accepting a resolver behavior change if rebasing exposes a failing alias, local-install-location, or remote-trust regression.

Technical review

Best possible solution:

Keep one iterative, snapshot-based alias resolver in src/plugins/marketplace.ts, retain the cycle and parity regressions, and merge after current-head CI and the protected maintainer review gate pass.

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

Yes, by source inspection: current main recursively reloads a normalized registry alias with no visited set, and the PR’s bounded self-cycle and two-node fixtures directly exercise list and install paths. This read-only review did not run the tests because they create temporary test artifacts.

Is this the best way to solve the issue?

Yes. Alias traversal belongs in the shared marketplace loader, so snapshot-based iterative detection fixes both callers without introducing a timeout, fallback, or command-specific workaround.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: A malformed external marketplace registry entry can hang marketplace list and install operations, but the defect is confined to that optional plugin workflow.
  • add merge-risk: 🚨 compatibility: The resolver chooses among existing alias, installed-local, malformed-source fallback, and remote marketplace inputs.
  • add merge-risk: 🚨 availability: A defect in this common resolver can block both marketplace list and installation commands.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.

Label justifications:

  • P2: A malformed external marketplace registry entry can hang marketplace list and install operations, but the defect is confined to that optional plugin workflow.
  • merge-risk: 🚨 compatibility: The resolver chooses among existing alias, installed-local, malformed-source fallback, and remote marketplace inputs.
  • merge-risk: 🚨 availability: A defect in this common resolver can block both marketplace list and installation commands.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents a no-module-mock owner run across the changed runtime paths, and the exact-head Real behavior proof check succeeded; redact-sensitive terminal or log proof remains appropriate for this non-visual behavior.

Evidence

What I checked:

  • Current-main defect: Current main recursively invokes the marketplace loader for every normalized known alias with no visited-alias check, so a cyclic registry re-enters the same loader indefinitely. (src/plugins/marketplace.ts:675, a172857acc75)
  • Candidate repair and coverage: The PR snapshots the registry, tracks aliases in call-local state, returns the complete cycle chain, and covers self/two-node cycles across list and install plus local precedence, independent calls, and malformed-source fallback. (src/plugins/marketplace.ts:675, e7114c0f1f5d)
  • Shared execution boundary: Both listing and installation call the same loader; installation enters cleanup and install-policy handling only after marketplace loading succeeds, so detecting a cycle at this boundary prevents downstream work from starting. (src/plugins/marketplace.ts:1199, a172857acc75)
  • Feature provenance: Current-main blame attributes the resolver block to Peter Steinberger in the marketplace refactor commit; this PR is a focused follow-up in the same owner module. (src/plugins/marketplace.ts:675, edfeec49e7a7)
  • Current-base and release status: The PR head is not contained in current main while its parent is; current main has no later changes in the two affected paths after that parent. The fix is unmerged and therefore absent from the stated latest release. (src/plugins/marketplace.ts:675, e7114c0f1f5d)
  • Proof status: The PR body records a no-module-mock owner run, and the exact-head Real behavior proof check succeeded; broader CI was still running at review time. (src/plugins/marketplace.test.ts:573, e7114c0f1f5d)

Likely related people:

  • steipete: Current-main blame attributes the relevant resolver block to Peter Steinberger, and this focused follow-up uses the same owner boundary. (role: current resolver contributor; confidence: high; commits: edfeec49e7a7, e7114c0f1f5d; files: src/plugins/marketplace.ts, src/plugins/marketplace.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the remaining exact-head checks and refresh the review only if the base or merge result changes materially.

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.

@steipete
steipete merged commit 87be38e into main Aug 1, 2026
130 of 143 checks passed
@steipete
steipete deleted the codex/qa400-marketplace-alias-cycle-owner branch August 1, 2026 14:46
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

wingwkyuen pushed a commit to tcgoidc/openclaw that referenced this pull request Aug 1, 2026
…up-ownership-20260801

* origin/main:
  fix(gateway): trim audit.list exact-match filter ids (openclaw#110847)
  fix: harden plugin import-boundary guards and remove dead scanner (openclaw#117386)
  fix(ci): keep PTY tests observable and wait for completed turns (openclaw#117405)
  fix(plugins): resolve marketplace aliases without recursive cycles (openclaw#117440)
  fix: break command recovery import cycle (openclaw#116947)
  fix: clear offscreen command recovery
  fix: fence command recovery ownership
  fix: scope failed command recovery
  fix(plugins): fail closed on ambiguous uninstall targets (openclaw#117406)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
…up-ownership-20260801

* origin/main:
  fix(gateway): trim audit.list exact-match filter ids (openclaw#110847)
  fix: harden plugin import-boundary guards and remove dead scanner (openclaw#117386)
  fix(ci): keep PTY tests observable and wait for completed turns (openclaw#117405)
  fix(plugins): resolve marketplace aliases without recursive cycles (openclaw#117440)
  fix: break command recovery import cycle (openclaw#116947)
  fix: clear offscreen command recovery
  fix: fence command recovery ownership
  fix: scope failed command recovery
  fix(plugins): fail closed on ambiguous uninstall targets (openclaw#117406)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant