Repository navigation
feat(opencode): migrate OpenCode Manager to OpenCode 2 - #359
Conversation
Port the backend lifecycle, generated plugins, event aggregation, schedules, worktrees, provider credentials, MCP, config handling, the frontend chat model, and the ocm CLI to OpenCode 2. Adopt @opencode/client 2.0.15 as the single typed V2 API contract, require OpenCode 2.0.0 or newer (pinned 2.0.15), and delete every V1-only code path.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 36510015 | Triggered | Generic Password | 7351d5f | backend/test/services/opencode-sandbox-plugin.test.ts | View secret |
| 37573527 | Triggered | Generic Password | 7351d5f | backend/test/services/opencode-single-server.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
Important Review skippedToo many files! This PR contains 381 files, which is 231 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (381)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…shims Route config/skill/AGENTS.md changes through the OpenCode location reload API instead of a full server restart, stop auto-resuming interrupted sessions, remove the restart coordinator and v1 MCP/version shims, and pin support to OpenCode >=2.0.15 <3.0.0. Adds integration-ready retries, service-mode launch, ocm-cli repo proxy, and new frontend form/MCP helpers.
…ll, proxy, and session flows - extract shared semver and model-ref utilities, reuse across version checks - share the OpenCode release download script across Docker, entrypoint, dev setup - unify install/upgrade failure recovery and guard externally managed OPENCODE_BIN - scope the repo proxy location rewrite and surface ocm proxy errors - rework frontend session projection, permission lookup, and cache invalidation
Problem
OpenCode Manager ran on the OpenCode 1.x API surface. OpenCode 2 changes three things that reach every part of the manager: a new plugin API (
{ id, setup(ctx) }), a new/api/*server contract with a different session, message, and event model, and different install and config behavior (the server password is always required,config.jsonis no longer read, and binaries are published atopencode.ai/files/bininstead of GitHub releases). The V1 client, generated plugins, event aggregation, and config handling no longer work against a V2 server.Fix
@opencode/[email protected]as the single typed V2 contract inshared, remove every@opencode-ai/*dependency, and require OpenCode 2.0.0 or newer (pinned 2.0.15). A 1.x binary is a non-recoverable startup error with an install hint.opencode.ai/files/bin; the Docker image, entrypoint, version picker, and dev setup follow.OPENCODE_SERVER_USERNAMEandOPENCODE_PUBLIC_URL./api/info, location-scoped requests viax-opencode-directory, event aggregation and reconnect replay, native restart resume, schedules, git worktrees, provider credentials and OAuth through V2 integrations, and MCP OAuth as a thin relay.{ id, setup(ctx) }modules installed inopencode/plugins/; the sandbox plugin moves toshellhooks and the manager tool moves to the V2 tool API with a JSON Schema input.openCodeApifacade and a V2 session transcript projector; add V2 prompt, command, shell, interrupt, revert, and compact, plus permissions and forms and models/providers/agents; remove LSP and the todo pipeline.ocmCLI to attach viaopencode --serverthrough a repo-scoped proxy and to move sessions with V2 export/import.opencode.json/opencode.jsonconly and fold a legacyconfig.jsonautomatically.Testing
pnpm typecheck: exit 0.pnpm lint: exit 0 (40 pre-existingno-explicit-anywarnings inbackend/src/routes/repos.test.ts).pnpm test: CLI 239, backend 2337, frontend 1358 tests pass (262 files).