Skip to content

feat: add opper launch claude-desktop#5

Merged
joch merged 16 commits into
mainfrom
claude-desktop-support
May 5, 2026
Merged

feat: add opper launch claude-desktop#5
joch merged 16 commits into
mainfrom
claude-desktop-support

Conversation

@joch
Copy link
Copy Markdown
Member

@joch joch commented May 5, 2026

Summary

Adds opper launch claude-desktop — routes Claude Desktop's built-in chat (Cowork) and Code surfaces through Opper by writing the documented third-party-inference profile (deploymentMode: \"3p\") at ~/Library/Application Support/Claude-3p/ (macOS) or %LOCALAPPDATA%\\Claude-3p\\ (Windows). Mirrors ollama launch claude-desktop. macOS quits & reopens the app via osascript/open -a so the change takes effect immediately; Windows uses Get-Process / CloseMainWindow / Start-Process. Linux returns "not installed" (Anthropic doesn't ship a Linux build).

Picker default is pinned to anthropic/claude-opus-4-7 via inferenceModels (Claude Desktop's documented field — first entry is the default). The user's --model override flows through as the picker default at spawn time, mirroring how ANTHROPIC_MODEL works for Claude Code.

Also adds opper agents uninstall <name> — non-interactive companion to opper launch <name> that calls adapter.unconfigure(). Works for every adapter, not just claude-desktop.

Behaviour

  • Idempotent. Re-running opper launch claude-desktop upserts our _meta.json entry by UUID — no duplicates.
  • Non-destructive. All user-owned siblings are preserved. mcpServers, preferences, other 3p _meta.json entries, enterpriseConfig, etc. are untouched.
  • TCC-aware. If macOS denies the "opper would like to control Claude" automation prompt, surfaces a clear hint to grant access in System Settings → Privacy & Security → Automation.
  • Bounded. 5-second quit timeout; if Claude won't quit, errors out cleanly instead of hanging.
  • Reversible. opper agents uninstall claude-desktop flips deploymentMode back to \"1p\", removes the Opper entry from _meta.json, blanks gateway fields in our profile JSON. Two inert files remain in Claude-3p/configLibrary/ (functionally identical to a vanilla install).

Test plan

  • 247 unit tests pass (npm test); typecheck clean
  • Manual macOS smoke test: launch → use Claude Desktop → uninstall → re-launch round-trip works
  • Spec compliance and code quality reviewed task-by-task; final cross-cutting review identified Windows-glob coverage, arg-guard error code, and TCC hint as gaps — all three fixed in 0312976
  • Cross-platform: Windows code paths exist but aren't exercised in CI (no Windows runner); covered by manual smoke test if/when needed

Files

  • New: `src/agents/claude-desktop.ts`, `test/agents/claude-desktop.test.ts`
  • New: `opper agents uninstall ` subcommand (`src/commands/agents.ts` + `src/cli/agents.ts`)
  • New: spec `docs/superpowers/specs/2026-05-05-claude-desktop-launch.md` and plan `docs/superpowers/plans/2026-05-05-claude-desktop-launch.md`
  • Updated: `README.md` to document `claude-desktop`, `openclaw` (was missing), and `agents uninstall`

joch added 15 commits May 5, 2026 13:32
Captures the brainstormed design for `opper launch claude-desktop`:
adapter that writes Claude Desktop's third-party-inference profile to
point at the Opper compat gateway, plus a new `opper agents uninstall
<name>` non-interactive uninstall surface to mirror `opper launch <name>`.
Step-by-step TDD plan for the spec at
docs/superpowers/specs/2026-05-05-claude-desktop-launch.md.
The README's agent table and launch examples were missing two adapters
that already shipped (openclaw) and one that ships with this branch
(claude-desktop). Also adds the new `opper agents uninstall <name>`
non-interactive uninstall surface.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4985a96828

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/claude-desktop.ts Outdated
Comment thread src/agents/claude-desktop.ts Outdated
Two issues raised by the codex PR review:

P1 — `writeJson` wrote Claude Desktop's profile files with default mode
(world-readable post-umask). One of those files stores
`inferenceGatewayApiKey`, which on multi-user machines could leak the
gateway token to other local users. Set `mode: 0o600` on every write —
matches the precedent in `openclaw.ts`.

P2 — `openClaude()` ignored `run()`'s exit code, so `spawn()` returned 0
even if `open -a Claude` / `Start-Process` failed. Now we check the
result and throw `OpperError` with the subprocess stderr so the user
gets an actionable message.
@joch
Copy link
Copy Markdown
Member Author

joch commented May 5, 2026

@codex review — addressed both findings in 2d4a364.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joch joch merged commit c18d6fb into main May 5, 2026
4 checks passed
@joch joch deleted the claude-desktop-support branch May 5, 2026 13:32
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.

1 participant