fix(claude): keep custom Grok requests on their selected provider - #5307
Merged
MagicLizi merged 4 commits intoOct 1, 2026
Merged
Conversation
Signed-off-by: PraiseZhu <zhuzan@xd.com>
Signed-off-by: PraiseZhu <zhuzan@xd.com>
|
Signed-off-by: PraiseZhu <zhuzan@xd.com>
Signed-off-by: PraiseZhu <zhuzan@xd.com>
Contributor
|
你好,本 PR 命中维护者确认门,正在等待维护者确认后再继续自动审查与合并:
具体确认请求见讨论 issue:#5339 确认方式:请维护者直接在本 PR 上 Approve;需要修改则 Request Changes,你改完后由维护者重新 Approve。维护者确认完成前,自动流程不会合并本 PR。 |
Contributor
Author
|
已核对 PR 当前 HEAD |
Contributor
|
合了。会话身份预绑定把「自定义供应商 Grok 首发误进 xAI OAuth」这个时序坑钉死了,未接受 fork 不落目的 ID、取消回滚源会话的边界处理和回归覆盖得很扎实,真实 CLI 的路由 E2E 也确实跑通了——谢谢。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这次改了什么
摘要
Claude Code 新会话首次请求可能早于 SDK 会话 ID 回填。此时本地代理无法识别用户选择的自定义供应商,裸
grok-4.6会进入 xAI OAuth bridge,并在没有对应授权时本地返回 502。在本地 SDK 启动前预先指定原生请求 UUID,让活跃 Session 和 CLI 请求从一开始使用相同请求 ID。请求路由通过
requestSessionId识别当前 CLI;可恢复 ID 保留在handle.id,未接受的 fork 始终保持源 ID。初始 Maker 保存和 SDK init 都不再提前持久化目的 ID;输入进入队列成功后才同步提交一次。普通 resume 保留原 ID,其他引擎通过可选字段回落保持原契约。fork 启动失败或输入接受前取消时,恢复源 ID、宿主记录和重试位置;目录授权保持完整源会话 fork,rewind 保持原消息锚点。成功接受输入后才解除本轮回滚。
变更类型
fix缺陷修复范围
UI 变化
不涉及。
怎么验证的
自动验证
新增 E2E 只在显式提供
CINDY_TEST_CLAUDE_BINARY时执行,使用临时 HOME、配置目录和 fixture key,不访问开发者授权。独立 Sonnet 5.5(
anthropic/claude-sonnet-5-5 / high / xd)对dd5fe2dfc的冻结增量终审通过:Greptile 评论4147782975的“未接受输入就持久化 fork ID”P1 已关闭,未发现新的 P0/P1。审核没有重跑上述测试。手工验证
未替换或重启正在运行的 Cindy。真实 CLI 的 HTTP 链路由自动 E2E 验证。
未执行的验证
git show origin/main:<文件> | eslint --stdin复核:原生 Agent 的 3 项、rewind 测试的 13 项与主干完全一致;本次新增 E2E 和其他修改测试的 ESLint 通过。风险
风险分类
影响与回滚
提交前检查
git commit -s)