fix(desktop): preserve custom OAuth route on first Claude turn - #3289
fix(desktop): preserve custom OAuth route on first Claude turn#3289nothingyuancando wants to merge 4 commits into
Conversation
Signed-off-by: nothingyuancando <1579035512@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37b3e55d31
ℹ️ 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".
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts | 新增每会话路由证明的签发、恒时验证、实例替换保护及代理级内部头剥离配置。 |
| packages/maker-core/src/agents/claude-code/index.ts | 本地会话启动时取得路由证明,并在正常关闭、启动失败和失效 handle 清理路径撤销注册。 |
| packages/maker-core/src/agents/claude-code/env-builder.ts | 将主进程提供的路由证明安全地组装进本地 Claude Code 子进程环境。 |
| packages/anthropic-compat-proxy/src/server.ts | 在统一上游请求构造阶段删除配置的内部 headers,覆盖 JSON、非 JSON及恢复重试。 |
| packages/anthropic-compat-proxy/src/types.ts | 扩展代理选项以声明所有转发请求都必须删除的内部 headers。 |
| packages/maker-core/src/agents/claude-code/tests/forward-loop-crash-teardown.test.ts | 验证启动失败、流循环崩溃及自然终止时路由证明均被正确撤销。 |
Sequence Diagram
sequenceDiagram
participant Host as Desktop 主进程
participant Agent as Claude Code 会话
participant Proxy as 本地兼容代理
participant Provider as 自定义 OAuth Provider
Host->>Host: 签发 session id + 短期 token
Host->>Agent: 通过环境变量注入内部请求头
Agent->>Proxy: 首个请求(尚无 SDK session id)
Proxy->>Proxy: 验证 token 并解析 Cindy session 路由
Proxy->>Proxy: 删除内部 session/token 头
Proxy->>Provider: 使用选定 provider 的上游与凭证转发
Host->>Host: 会话关闭、启动失败或崩溃时撤销注册
Reviews (4): Last reviewed commit: "fix(maker-core): revoke proxy auth on st..." | Re-trigger Greptile
|
@nothingyuancando 👋 这个 PR 还有 3 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
这条 PR 触发了维护者确认(架构)。它在 maker-core 的 AgentDeps、Claude Code 环境变量和 Desktop 本地代理之间加了一套新的会话路由证明,不只是单文件 bugfix。 请维护者在 PR 上 Approve 放行;若要改,请 Request Changes。讨论 issue:#3292 |
Signed-off-by: nothingyuancando <1579035512@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38193d2f35
ℹ️ 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".
Signed-off-by: nothingyuancando <1579035512@qq.com>
Signed-off-by: nothingyuancando <1579035512@qq.com>
这次改了什么
摘要
修复 Claude Code 新会话首个 turn 尚未产生 SDK session id 时,显式选择的自定义 OAuth 供应商可能回落到 XD 网关的问题。
变更类型
fix缺陷修复范围
UI 变化
怎么验证的
自动验证
手工验证
不涉及:需要真实 Kimi OAuth 的 Windows 环境,已用代理路由回归覆盖首轮无 SDK id 的时序。
未执行的验证
Windows + Kimi Code OAuth 真实请求未执行;该环境需要用户账号与系统代理。
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)