Refresh Claude marketplace cache and report setup failures honestly

Merged
JE
4mo ago
+437-49

Fixes #417.

Root cause

basecamp setup detects Claude Code, installs the agent skill, then shells out to claude plugin install basecamp@37signals. It first runs claude plugin marketplace add, but add no-ops on an already-registered marketplace — it does not refresh the cached metadata.

The transport itself was fixed upstream: basecamp/claude-plugins#7 (merged Jul 20) switched the basecamp plugin entry from the SSH github shorthand to an anonymous-HTTPS url source. But a user who registered the marketplace before that change keeps a stale cached entry declaring source: github, so claude plugin install still clones git@github.com:basecamp/basecamp-cli.git and dies with Permission denied (publickey) on machines without a GitHub SSH key.

Reproduced against a clean Claude home:

Scenariomarketplace add (what setup runs)plugin install
Clean homecaches source: urlsucceeds over HTTPS ✓
Stale cache (source: github)"already on disk" — no refreshSSH clone → fails w/o key ✗
Stale cache + marketplace updaterefreshes to source: urlsucceeds over HTTPS ✓

Separately, the wizard printed "Setup complete!" even when the plugin step failed, hiding the failure behind a single easy-to-miss ✗.

Changes

  • Refresh the marketplace cache before install. Add a best-effort claude plugin marketplace update <name> after each marketplace add on the install paths (mirroring what the Codex path already does), so a stale source: github entry is replaced with the current HTTPS source: url first. Claude's own marketplace clone already falls back SSH→HTTPS, so the refresh works without a key.
  • Honest completion reporting. wizardAgents now returns an explicit outcome that distinguishes a deliberate skip (still "complete") from a real failure ("incomplete"). When post-setup agent checks fail, showSuccess drops "Setup complete!" for an honest headline, lists each failing step with its own agent-specific remediation hint (Claude vs Codex), and points to basecamp doctor. Exit stays 0 (graceful degrade). The machine-output summary reflects the same status.

No CLI command/flag surface changes.

Tests

  • Marketplace refresh asserted on both the reinstall and fresh-install non-interactive paths (via the existing stub-claude harness).
  • Pure-helper unit tests for collectAgentIssues, statusFromOutcome, successHeadline, and the incomplete wizardSummaryLine branch — a declined setup stays complete; a real failure becomes incomplete.

bin/ci green.


Summary by cubic

Refreshes the Claude marketplace cache before plugin installs and reports setup results honestly with a bounded refresh and clear skip behavior. This avoids SSH clone failures for basecamp@37signals, catches leftover stale plugins, and gives actionable next steps.

  • Bug Fixes

    • Run claude plugin marketplace update 37signals after marketplace add before every plugin install (fresh installs and reinstalls, interactive and non-interactive).
    • Avoids stale source: github entries that forced SSH clones; installs now use HTTPS as intended.
    • Bound the marketplace refresh to 60s so a stalled clone can’t hang setup; install still proceeds if it times out.
    • Re-check surviving stale plugin entries and mark the run incomplete if cleanup fails.
    • Manual recovery hint now includes the marketplace update step so copy-paste fixes don’t reproduce the SSH failure.
    • No CLI surface changes.
  • New Features

    • Setup outcome is issue‑authoritative and based on a single post‑setup snapshot, so the headline and checklist never disagree.
    • If the user skips agent setup, the summary shows “Coding agent setup skipped” instead of red checks; a skip remains “complete”.
    • When issues remain, the banner reflects it and shows agent‑specific hints; it also points to basecamp doctor. Machine output mirrors the status and exit code stays 0.