Skip to content

Commit e3d31bb

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3fbe9ae + 38bf39d commit e3d31bb

22 files changed

Lines changed: 710 additions & 327 deletions

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
.\zcode-proxy serve debug config.yaml
2323
```
2424
25-
每个 request 会产生 4 行 JSONL(client_in / upstream_out / upstream_in / upstream_stream_summary),按 `reqId` 配对。dump 自动脱敏 API key / JWT / proxy key,**但仍请检查一遍再粘贴**。
25+
每个 request 会产生 5 行 JSONL(client_in / upstream_out / wire_out / upstream_in / upstream_stream_summary),按 `reqId` 配对。dump 自动脱敏 API key / JWT / proxy key,**但仍请检查一遍再粘贴**。
2626
2727
- type: checkboxes
2828
id: prerequisites
@@ -181,7 +181,7 @@ body:
181181
label: 复现步骤
182182
description: 越具体越好,最好别人照着步骤能直接复现
183183
placeholder: |
184-
1. config.yaml 设置 provider: zai, plan: start-plan, auth: oauth
184+
1. config.yaml 设置 provider: zai, plan: start-plan(凭据来自 auth login)
185185
2. 启动:`bun run src/index.ts serve debug config.yaml`
186186
3. 用 Claude Code 发一个普通对话请求:……(贴请求命令或客户端配置)
187187
4. 上游返回 200,但 SSE 流到一半中断,客户端报……
@@ -213,11 +213,12 @@ body:
213213
214214
至少提供 `serve debug` 模式的日志。**强烈建议同时提供 `ZCODE_DUMP_UPSTREAM` 的 trace**,能直接看到 zcode-proxy 实际发什么 body、上游返回什么 headers / stream,定位效率提升 10 倍。
215215
216-
dump 文件每行是一个 JSON 对象,按 `reqId` 配对 4 个 phase:
216+
dump 文件每行是一个 JSON 对象,按 `reqId` 配对 5 个 phase:
217217
218218
```
219219
{"reqId":"#001","phase":"client_in",...} ← 客户端打到 zcode-proxy 的原始请求
220-
{"reqId":"#001","phase":"upstream_out",...} ← zcode-proxy 实际发给上游的(核心)
220+
{"reqId":"#001","phase":"upstream_out",...} ← 路由/签名前的出线视图
221+
{"reqId":"#001","phase":"wire_out",...} ← 实际发给上游的(路由后 URL + 签名后头,核心)
221222
{"reqId":"#001","phase":"upstream_in",...} ← 上游响应 status + headers
222223
{"reqId":"#001","phase":"upstream_stream_summary",...} ← 流总字节 + 首 4KB 抽样
223224
```
@@ -242,6 +243,7 @@ body:
242243
placeholder: |
243244
{"ts":"2026-07-31T13:00:00.000Z","reqId":"#001","phase":"client_in","method":"POST","url":"http://localhost:8080/v1/chat/completions","headers":{...},"body":{...}}
244245
{"ts":"2026-07-31T13:00:00.100Z","reqId":"#001","phase":"upstream_out","method":"POST","url":"https://api.z.ai/api/coding/paas/v4/chat/completions","headers":{...},"body":{...},"upstreamFormat":"openai","translateMode":false,"startPlan":false}
246+
{"ts":"2026-07-31T13:00:00.150Z","reqId":"#001","phase":"wire_out","url":"https://zcode.z.ai/api/v1/ultra-zai/chat/completions","signed":true,"headers":{...}}
245247
{"ts":"2026-07-31T13:00:01.000Z","reqId":"#001","phase":"upstream_in","status":200,"statusText":"OK","headers":{...},"isSSE":true,"ttfbMs":900}
246248
{"ts":"2026-07-31T13:00:05.000Z","reqId":"#001","phase":"upstream_stream_summary","status":200,"contentEncoding":null,"compressed":false,"totalBytes":12345,"tokensObserved":42,"firstBytesSample":"data: {...}\n\n"}
247249
@@ -255,15 +257,14 @@ body:
255257
id: config
256258
attributes:
257259
label: config.yaml 关键片段(脱敏)
258-
description: 只贴影响行为的字段(auth.mode / provider / plan / identity / clientIdentity 等);**API key / proxy key / JWT 必须替换为 `<redacted>`**
260+
description: 只贴影响行为的字段(auth.proxyApiKey / provider / plan / identity / clientIdentity 等);**API key / proxy key / JWT 必须替换为 `<redacted>`**
259261
render: yaml
260262
placeholder: |
261263
auth:
262-
mode: apikey # 或 oauth
264+
proxyApiKey: <redacted> # 可选;不设则客户端免密
263265
provider: zai
264266
plan: start-plan # 或 coding-plan
265267
identity:
266-
appVersion: "3.3.3"
267268
sourceTitle: cli
268269
refererOrigin: https://zcode.z.ai
269270
# clientIdentity: # 仅在用了 session affinity 时贴
@@ -275,7 +276,7 @@ body:
275276
label: 是否使用了 clientIdentity(session affinity)?
276277
description: 这会影响是否走 ordered-transport(raw TCP 保序)路径
277278
options:
278-
- 未使用(默认 off)
279+
- 未改动(默认 enforce)
279280
- observe 模式
280281
- enforce 模式(用 raw TCP)
281282
- 不确定
@@ -310,7 +311,6 @@ body:
310311
311312
⚠️ **再次检查脱敏**。提交前请确认:
312313
313-
- `auth.apiKey` / `providers.<p>.credential` → `<redacted>`
314314
- `auth.proxyApiKey` → `<redacted>`
315315
- dump 之外的客户端 raw 日志里 `Authorization: Bearer xxx` / `x-api-key: xxx` → `<redacted>`
316316
- OAuth JWT / refresh token → `<redacted>`

0 commit comments

Comments
 (0)