Skip to content

fix(coding-agent): hint marketplace-qualified spec when bare plugin install fails - #3880

Merged
Yeachan-Heo merged 2 commits into
Yeachan-Heo:devfrom
yazzang-homelab:fix/plugin-install-bare-name-hint
Aug 6, 2026
Merged

fix(coding-agent): hint marketplace-qualified spec when bare plugin install fails#3880
Yeachan-Heo merged 2 commits into
Yeachan-Heo:devfrom
yazzang-homelab:fix/plugin-install-bare-name-hint

Conversation

@yazzang-homelab

Copy link
Copy Markdown
Contributor

What

gjc plugin install <bare-name> now prints the marketplace-qualified spec that would work when the npm fallback fails.

A bare spec (no @marketplace) is classified as npm by design (classifyInstallTarget rule 3). That rule is unchanged — only the failure path gained a hint, plus a new zero-dep src/cli/marketplace-hint.ts holding the two pure helpers.

Why

gjc plugin discover lists bare plugin names. Copying one into gjc plugin install resolves against npm, fails, and prints only install_failed, which names neither the cause nor the working spec.

Observed on a clean isolated HOME against the official Anthropic marketplace:

$ gjc plugin marketplace add anthropics/claude-plugins-official
✔ Added marketplace: anthropics/claude-plugins-official
$ gjc plugin discover | grep claude-md
  claude-md-management
$ gjc plugin install claude-md-management
✘ Failed to install plugin (install_failed)          # dead end
$ gjc plugin install claude-md-management@claude-plugins-official
✔ Installed claude-md-management from claude-plugins-official (1.0.0)

After the change the first form ends with Try: gjc plugin install claude-md-management@claude-plugins-official.

Only marketplace names are echoed, and only for a bare spec (no @scope, version, or path separator), so the install-failure path keeps its rule of never printing a spec or cause that can carry credentials or a home path.

Testing

  • bun test packages/coding-agent/test/marketplace/cli.test.ts — 14 pass (4 new cases: bare-name shape gate, multi-marketplace hit ordering, absent name, unreadable catalog skipped).
  • E2E from source in an isolated HOME with the official marketplace registered: bare name prints the qualified hint; definitely-not-a-plugin-xyz and @scope/nope print no hint.
  • bunx biome check clean on the touched files.
  • bun run check:types NOT completed: tsc (typescript-go) aborts with fatal error: runtime: name offset out of range on this machine at dev baseline too, i.e. before this change. Needs CI to cover the typecheck.

GJC verdict

gajae.pr-review-verdict.v1 needs-human sha256:ac7a532debd4f74bb60d4e7f7bc347ac59e9c8af reviewer:human evidence:bun test packages/coding-agent/test/marketplace/cli.test.ts (14 pass) + isolated-HOME e2e above

  • Target branch is dev
  • bun check passes — biome clean; tsgo typecheck crashes at baseline on this host, left to CI
  • Tested locally
  • CHANGELOG updated (if user-facing)
  • Verdict above matches the exact PR head, not an earlier commit

…nstall fails

`gjc plugin discover` prints bare plugin names, but a bare spec is always
classified as npm, so installing a name straight out of that listing died
with an unqualified `install_failed` and no path forward.

Lore-id: 7c2a91d5
Constraint: install failures must not echo the raw spec or cause -- only a bare name (no scope, version, or path separator) is safe to print
Rejected: resolve bare names against marketplaces | silently shadows same-named npm packages
Confidence: high
Scope-risk: narrow
Reversibility: easy
Tested: bare name offered by a registered marketplace prints the qualified spec; unknown name and scoped spec print no hint
Not-tested: multi-marketplace hint ordering against live catalogs (unit-covered with stub catalogs)
@yazzang-homelab
yazzang-homelab force-pushed the fix/plugin-install-bare-name-hint branch from ac7a532 to 39a6687 Compare August 5, 2026 23:24
@yazzang-homelab

Copy link
Copy Markdown
Contributor Author

Rebased onto current dev (11e48d5bc, #3901) — the previous head was CONFLICTING/DIRTY on the CHANGELOG ## [Unreleased] section. New head 39a668756; rebase was CHANGELOG-only, no code merges, and the diff is otherwise unchanged.

Re-verified on the new base: bun test packages/coding-agent/test/marketplace/cli.test.ts → 14 pass, 0 fail.

@Yeachan-Heo
Yeachan-Heo merged commit b6175ce into Yeachan-Heo:dev Aug 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants