From 20b7bf73a1f2ec174e439f58b96577772573c498 Mon Sep 17 00:00:00 2001 From: Catapult291 <200960228+Catapult291@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:44:34 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=E6=B5=81=E5=86=85?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BA=8B=E4=BB=B6=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=A0=81=E6=98=A0=E5=B0=84=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 说明 CC 通过 SSE error 事件上报失败时,代理优先采用消息 前缀或 error.statusCode,并按 CC_STATUS_MAP 映射。 --- README.md | 2 ++ README_zh.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 34247b4..700267d 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,8 @@ Upstream CC status mapping (`CC_STATUS_MAP`; anything unlisted becomes `502 upst The machine-readable classification from the upstream error body (`error.code`, e.g. `BAD_REQUEST` / `USAGE_EXCEEDED`) is passed through as `error.code`. +CC reports failures inside the response stream rather than always using an HTTP status: `{"type":"error","error":{...,"statusCode":N,"isRetryable":B}}`. The proxy takes that status (a leading `` in the message wins over it, matching the CLI) and maps it the same way as an HTTP-level error; for example, an upstream-declared 400 / 429 reaches the client with its own status instead of being collapsed into a blanket 502. + ## Model List The proxy returns a live model list via `GET /v1/models`. Below are common models for reference; the actual list depends on the live API response — see [Command Code Pricing](https://commandcode.ai/docs/resources/pricing-limits) for plan details. diff --git a/README_zh.md b/README_zh.md index efca161..4bf7cb7 100644 --- a/README_zh.md +++ b/README_zh.md @@ -356,6 +356,8 @@ curl http://127.0.0.1:3050/v1/responses \ 上游错误体里的机器可读分类(`error.code`,如 `BAD_REQUEST` / `USAGE_EXCEEDED`)会透传到下游错误体的 `error.code`。 +CC 把失败放在响应流里上报,而不是总用 HTTP 状态返回:`{"type":"error","error":{...,"statusCode":N,"isRetryable":B}}`。代理会取这个状态(消息里的 `` 前缀优先,与 CLI 一致),按与 HTTP 层错误相同的方式映射;例如上游声明的 400 / 429 会带着自己的状态到达客户端,而不是一律折叠成 502。 + ## 模型列表 代理访问 `GET /v1/models` 会返回实时模型列表。以下为常见模型参考,完整列表以实际接口返回为准——各模型套餐可参考 [Command Code Pricing](https://commandcode.ai/docs/resources/pricing-limits)。