Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Keep writing-code docs in these files only:
| `docs/DESIGN.md` | Architecture, login, routing, console, design system. |
| `docs/PLAN.md` | Current milestone checklist. |
| `docs/PROVIDERS.md` | Future account-provider design. Not a current milestone. |
| `docs/PROVIDERS_TRAE_SOLO.md` | Trae CN Solo in-process adapter survey. Not a current milestone. |

Do not add new `TODO.md`, `NOTES.md`, or extra plan files. The only extra design doc is `docs/PROVIDERS.md` (WorkBuddy / Qoder CN / future account types). User-facing install stays in `README.md` (Chinese) / `README_EN.md` (English). Local protocol facts stay in ignored `docs/capture-notes.md`. Host ops stay gitignored in `docs/PRIVATE_DEPLOYMENT.md`.
Do not add new `TODO.md`, `NOTES.md`, or extra plan files. Extra design docs are `docs/PROVIDERS.md` (WorkBuddy / Qoder CN / future account types) and `docs/PROVIDERS_TRAE_SOLO.md` (Trae CN Solo). `docs/PROVIDERS_TRAE.md` is superseded; do not implement from it. User-facing install stays in `README.md` (Chinese) / `README_EN.md` (English). Local protocol facts stay in ignored `docs/capture-notes.md`. Host ops stay gitignored in `docs/PRIVATE_DEPLOYMENT.md`.

## Do

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Write each change in both `### English` and `### 中文` under `## Unreleased`.

### English

- Add Trae CN Solo as an in-process account type (`provider=trae`, `region=cn`): browser login, credential import/export, live catalog, and OpenAI-compatible chat over `llm_utils_chat` / `solo_work_lite`, without spawning official `traecli`
- Fetch WorkBuddy Global model catalogs from `/v2/enterprises/personal/models` instead of the console OIDC page, and return catalog failures as 503 JSON so reverse proxies do not replace them with HTML
- After dropping caller system prompts, send WorkBuddy an empty leading system message so Global no longer rejects the request with `11128 first message is not system prompt`
- Show account-type skeletons in the add-account dialog until `/api/providers` returns, instead of flashing the default Qoder Global tile
Expand All @@ -15,6 +16,7 @@ Write each change in both `### English` and `### 中文` under `## Unreleased`.

### 中文

- 新增 Trae 国内 Solo 账号类型(`provider=trae`,`region=cn`):支持浏览器登录、凭证导入导出、动态模型目录,以及走 `llm_utils_chat` / `solo_work_lite` 的 OpenAI 兼容对话,不启动官方 `traecli`
- WorkBuddy 国际版模型目录改打 `/v2/enterprises/personal/models`,不再走会 500 HTML 的 console 页面;目录失败改为 503 JSON,避免反代把错误换成 HTML 整页
- 丢弃调用方系统提示词后,仍给 WorkBuddy 补一条空的 system,避免国际版 `11128 first message is not system prompt`
- 添加账号弹窗等 `/api/providers` 返回后再显示类型,加载中用骨架屏,不再先闪默认 Qoder Global
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CLI2API 是本地网关:不提供账号、额度或官方 API 服务,不做

**长期**

- 更多上游渠道(Cursor、TraeWork 等,WorkBuddy 验收后评估)
- 更多上游渠道(Cursor、Trae CN Solo 等,WorkBuddy 验收后评估;Solo 调研见 `docs/PROVIDERS_TRAE_SOLO.md`)
- 可选的提示词 / 回复留档(显式开关,默认关闭)

## 文档
Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The full checklist lives in [docs/PLAN.md](docs/PLAN.md).

**Longer term**

- More upstream channels (Cursor, TraeWork, etc.; evaluated after WorkBuddy acceptance)
- More upstream channels (Cursor, Trae CN Solo, etc.; evaluated after WorkBuddy acceptance; Solo survey in `docs/PROVIDERS_TRAE_SOLO.md`)
- Optional prompt/completion capture behind an explicit switch (off by default)

## Documentation
Expand Down
1 change: 1 addition & 0 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,4 @@ After UI edits:
| `worker/src/errors.mjs` | Error taxonomy |
| `internal/executor/chat.go` | Proxy → worker |
| `docs/PROVIDERS.md` | Multi-provider extension plan; WorkBuddy first |
| `docs/PROVIDERS_TRAE_SOLO.md` | Trae CN Solo in-process adapter survey; supersedes `docs/PROVIDERS_TRAE.md` |
17 changes: 11 additions & 6 deletions docs/PLAN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CLI2API Plan

last-updated: 2026-08-28
last-updated: 2026-08-29

Qoder-first OpenAI-compatible proxy. Cursor and other CLIs wait until the current Qoder milestone is done.

Expand Down Expand Up @@ -307,11 +307,15 @@ never block or cool down the chat path. Design facts in `docs/PROVIDERS.md`

Goal: after WorkBuddy live acceptance proves the in-process adapter extension
point, evaluate the next channels on the same axis. Cursor stays last — its
protocol is the dirtiest. TraeWork is candidate #2: pure HTTP/SSE like
WorkBuddy, no Node/WASM worker needed.
protocol is the dirtiest. Trae CN Solo is candidate #2: pure HTTP/SSE like
WorkBuddy, no Node/WASM worker needed. Design: `docs/PROVIDERS_TRAE_SOLO.md`.
Do not implement from superseded `docs/PROVIDERS_TRAE.md`. Do not spawn
official `traecli`.

- [x] Trae CN Solo protocol survey: login, `llm_utils_chat` / `solo_work_lite`, credits (`docs/PROVIDERS_TRAE_SOLO.md`)
- [ ] WorkBuddy live acceptance complete (precondition)
- [ ] TraeWork protocol survey: login flow, chat endpoint, credit/quota signals
- [x] Trae CN Solo T0–T4 in-process adapter (`internal/providers/trae/`; live T5 still needs a consumer Trae CN account)
- [ ] Trae CN Solo T5 live acceptance (`只回复OK`, catalog, failover, tools)
- [ ] Cursor provider only after Phase I canonical contract is stable

## Later
Expand All @@ -323,5 +327,6 @@ WorkBuddy, no Node/WASM worker needed.

WorkBuddy J0–J4 are implemented; remaining WorkBuddy work is live-account
acceptance, not a new design doc. Qoder CN design lives in `docs/PROVIDERS.md`.
Do not add extra plan files. Do not start Cursor until Phase L is accepted or
explicitly deferred.
Trae CN Solo design lives in `docs/PROVIDERS_TRAE_SOLO.md`. Do not add extra
plan files. Do not start Cursor until Phase L is accepted or explicitly
deferred.
3 changes: 3 additions & 0 deletions docs/PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ last-updated: 2026-08-28
status: WorkBuddy J0–J4 已落地;Qoder CN 代码完成,L6 真实账号验收未完成
routing-reference: [router-for-me/CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) `main` @ `dc3c3b1`
workbuddy-reference: [Sliverkiss/workbuddy2api](https://github.com/Sliverkiss/workbuddy2api) `master` @ `92514d8ba06413c3b620e96da3ebc38e6c7beda0`
trae-solo: [docs/PROVIDERS_TRAE_SOLO.md](./PROVIDERS_TRAE_SOLO.md)(消费级 Trae CN Solo;旧 `docs/PROVIDERS_TRAE.md` 已过期)

本文回答三件事:

Expand Down Expand Up @@ -278,6 +279,7 @@ type ProviderCapabilities struct {
| `qoder` + `global` | `child_process` | OAuth / PAT / native import | `qoder-native-v1` | worker + `@qoder-ai/qodercli` | worker in-process catalog |
| `qoder` + `cn` | `child_process` | OAuth / PAT / native import | `qoder-native-v1` | worker + `@qodercn-ai/qoderclicn` | worker in-process catalog |
| `workbuddy` | `in_process` | OAuth | `workbuddy-oauth-v1` | Go state + poll | WorkBuddy models endpoint |
| `trae` + `cn` | `in_process` | OAuth | `trae-oauth-v1` | Go callback + poll | `get_detail_param`(见 `docs/PROVIDERS_TRAE_SOLO.md`;T5 真实验收未完成) |
| future `cursor` | TBD | TBD | TBD | TBD | TBD |

### Runtime kind
Expand All @@ -286,6 +288,7 @@ type ProviderCapabilities struct {
|-----------------|---------|--------|
| `qoder` | `child_process` | WASM / AuthManager 进程全局;一 HOME 一 daemon。`region=global` 与 `region=cn` 是两套 pinned CLI,不能共享进程 |
| `workbuddy` | `in_process` | 凭证是普通 Bearer;并发安全由 per-account mutex 保护 refresh |
| `trae` | `in_process` | 消费级 CN Solo 是 HTTP/SSE + Cloud-IDE-JWT,与 WorkBuddy 同构;不要 spawn `traecli`。协议见 `docs/PROVIDERS_TRAE_SOLO.md` |
| 未来 `cursor` | 先按调研再定,大概率 `in_process` 或独立 daemon;不要假设等于 Qoder | |

不要为 WorkBuddy 启动 `worker/src/daemon.mjs`。也不要让 Qoder 账号改走 in-process HTTP——Qoder 没有稳定的明文 chat 入口可替代 WASM encode。
Expand Down
Loading
Loading