Repository navigation
Conversation
…nding stack traces
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1077292ff2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| [ErrorCodes.AUTH_PROVISIONING_REQUIRED]: ErrorCode.AUTH_PROVISIONING_REQUIRED, | ||
| [ErrorCodes.AUTH_TOKEN_MISSING]: ErrorCode.AUTH_TOKEN_MISSING, | ||
| [ErrorCodes.AUTH_MODEL_NOT_RESOLVED]: ErrorCode.AUTH_MODEL_NOT_RESOLVED, |
There was a problem hiding this comment.
Add a changeset for the user-visible server fixes
These mappings change visible behavior for CLI, web, and remote-control users by replacing generic internal errors with actionable auth codes, while the envelope change removes a previously returned field, yet this commit adds no .changeset entry. Add a patch changeset for @moonshot-ai/kimi-code describing the user-facing fix so it appears in the release notes.
AGENTS.md reference: AGENTS.md:L88-L89
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
changeset 文字需要先确认再提交,建议的文字写在 PR 描述的 Checklist 里,确认后补上。
Requirement or Bug
HTTP 错误响应有三个问题:
stack,生产环境也是。Remote Control 和局域网客户端因此能看到本机的文件路径,而没有任何客户端读这个字段。auth.*):文档和客户端约定的是 40110 / 40111 / 40113。客户端的登录与模型门禁就是按这几个码弹出对应引导的。session.tower_mode_invalid)。40002(REQUEST_MALFORMED)和40416(TOOL_CALL_NOT_FOUND)定义了,但服务端从未返回。Bug Reproduction Steps
POST /api/v1/sessions/{id}:btw):返回50001,错误信封里带着完整调用栈。tower_mode:返回50001,服务端日志里出现一条session request failed的 error。Root Cause
errEnvelope把stack作为信封字段,四十来个调用点都把err.stack传了进去。KIMI_TO_PROTOCOL映射表里没有auth.*和session.tower_mode_invalid,未映射的错误按兜底规则变成INTERNAL_ERROR。Code Changes
--debug-endpoints,只绑 loopback、需要 bearer)仍然返回stack,开发排查不受影响。details加入公开名单,客户端按provider_id区分「登录」还是「配置供应商」,按model_id区分「选模型」。40112(凭证被拒绝)引擎里没有抛出点,这次不加映射。auth.login_required没有文档约定的码,保持现状。server-api.md(中英)的错误码分段表补上40935;profile 路由的错误表声明TOWER_MODE_INVALID,OpenAPI 描述里也有这个响应。Behavior Changes and Affected Users
stackstack50001,无details40110/40111/40113,带details50001,记 error 日志40935,msg不变40002、40416契约文件:
protocol/envelope.ts(去掉stack)与protocol/error-codes.ts。消费者是 code-app 的 desktop / web:不读stack,认证码和details正是它的chatGate期望的形状。apiSurface快照没有变化。测试:
test/transport-errors.test.ts:新增 Tower 与三种认证错误的映射、认证错误保留details、公开信封不带stack而 debug 信封带、兜底错误不带stack。test/sessions.test.ts:Tower 不可用时由50001改为断言40935。test/rpc.test.ts的「debug RPC 返回调用栈」保持通过。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset. 待确认的 changeset:Stop including server stack traces in error responses, and report missing provider, credential, and model setup with their dedicated error codes.gen-docsskill, or this PR needs no doc update.