makecindy / makecindy/cindy

feat: 支持将 OpenCode 作为 Agent 引擎接入

Open
#1,313 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

### 使用场景 / Use case

OpenCode(anomalyco/opencode,MIT,19.2 万 star)是当前社区使用最广的开源编码 agent,许多开发者已把它作为日常主力工具。目前 Cindy 已支持 Codex / Claude Code(PR #1265 在推进 Pi agent),但还不支持 OpenCode。希望能在 Cindy 中像选其他 agent 一样直接创建 OpenCode 会话,复用统一的会话树、用量、权限审查与远程协同能力。

### 当前问题 / Current limitation

- Agent 运行时 VendorKey 只支持 claude 和 codex(agent-binaries/types.ts:13),无法注册 OpenCode。
- 当前仅有模型供应商层面的 OpenCode Go 预设(#527),不能创建 OpenCode 会话、管理授权或统计用量。
- 无法将 OpenCode 会话接入 Orca 协同、定时任务与多端同步。

### 期望方案 / Proposed solution

参照现有 Claude Code / Codex 的 vendor 模式(可参考 #1265 对 Pi 的接入方式)分阶段推进:
1. 核心接入:OpenCode CLI/SDK 桥接与 translator、二进制分发、会话创建/resume、基础模型路由;
2. 授权与用量:BYOM provider、用量/缓存统计、额度展示;
3. 协同与多端:Orca worker、定时任务、device-link/mobile 适配。

作为新增 agent,不影响既有行为;OpenCode 二进制缺失时跳过注册。

### 已考虑的替代方案 / Alternatives considered

1. 仅通过 OpenCode Go 模型预设使用:只能覆盖模型层,无 agent 级会话与用量能力;
2. 自定义 provider + API Key:同样是模型层,拿不到会话树/fork/resume 等能力;
3. 自行在终端操作 OpenCode:偏离 Cindy 统一管理 agent 的定位。

Contributor guide

Open the contributing guide

Research direction

Read agent-binaries/types.ts and compare the existing Claude Code/Codex vendor paths with PR #1265's Pi integration. Map the requested phases—CLI/SDK bridge, translator, distribution, sessions, routing, authorization, usage, and collaboration—to existing entry points. Done means OpenCode can be selected as an agent with the requested capabilities, while missing binaries skip registration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai-infra-agents
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.