Wesley Liddick
65d744d0e1
Merge pull request #4294 from caigee-cmd/fix/parallel-tool-use-ghost-delta
...
fix(apicompat): 并行 tool_use 幽灵 content_block_delta(index 错误)
2026-07-15 10:26:02 +08:00
蔡及
22e97898bb
fix: gofmt on parallel tool regression test
2026-07-15 00:59:28 +08:00
蔡及
07732a5a35
test: add regression tests for parallel tool_use ghost delta ( #4193 )
...
Three tests covering the CC→Responses→Anthropic finalize path:
- TestStreamingParallelToolUseNoGhostDelta: full end-to-end with two
parallel tool_calls, asserts every content_block_delta targets a
started block
- TestStreamingParallelToolUseSecondToolPackedArgsDone: focused test
where tool 1 streams deltas and tool 2 has packed .done args
- TestStreamingThreeParallelToolsAllPackedDone: three tools all with
packed .done, the most extreme case
All three fail on unfixed code (ghost deltas on wrong indices) and
pass after the fix.
2026-07-15 00:47:04 +08:00
蔡及
4f3b5110e2
fix: parallel tool_use ghost content_block_delta (index error)
...
resToAnthHandleFuncArgsDone used state.ContentBlockIndex directly
instead of looking up from OutputIndexToBlockIdx like
resToAnthHandleFuncArgsDelta does. When multiple tool_calls arrive
in parallel and arguments come as a packed .done (no prior delta),
the second+ tool would emit content_block_delta on an index that
was never content_block_start'ed, causing Claude Code to report
"Content block not found".
Fix: resolve block index from OutputIndexToBlockIdx, and skip the
delta if the block is already closed or the index doesn't match
the current open block.
Closes #4193
2026-07-15 00:44:09 +08:00
Heatherm Huang
b32b815e46
fix(grok): harden OAuth pool recovery
2026-07-14 14:55:30 +08:00
shaw
fa1641f05f
fix: keep namespace verbatim on WSv2 forwards and check test type assertions
...
WSv2 egress relays upstream events verbatim without the HTTP-path
namespace restore, so flattening requests that take the WSv2 branch
would surface flattened tool names the client cannot match. Resolve
the WS transport decision before flattening and skip flattening only
when the request will actually go WSv2 (passthrough accounts return
via HTTP before the WSv2 branch and still flatten).
Also check all type assertions in responses_namespace_test.go to
satisfy golangci-lint errcheck.
2026-07-14 14:48:22 +08:00
shaw
252ef8b73a
Merge origin/main into codex/fix-native-responses-namespace
...
Resolve conflict in openai_gateway_passthrough.go streaming path: keep
main's normalizeCompletedImageGenerationStatus normalization ahead of
this branch's namespace restore block, mirroring the established order
in openai_gateway_response_handling.go.
2026-07-14 14:45:04 +08:00
shaw
d41a10111d
Merge remote-tracking branch 'origin/main' into feat/grok-sso-device-oauth
...
# Conflicts:
# frontend/src/api/admin/grok.ts
2026-07-14 10:19:16 +08:00
Wesley Liddick
93f2ccf3a5
Merge pull request #4188 from superman2003/fix/grok-free-quota-429-20260713
...
feat(grok): improve free quota probing and usage display
2026-07-14 10:14:41 +08:00
bestony and multica-agent
966afd1b4b
fix: preserve instrumented client contracts
...
Co-authored-by: multica-agent <github@multica.ai >
2026-07-14 01:29:30 +08:00
bestony and multica-agent
54d228dda5
feat(admin): add opt-in server timing metrics
...
Co-authored-by: multica-agent <github@multica.ai >
2026-07-14 01:29:30 +08:00
jinfeijie bot
ad4bf5c60d
feat(grok): 支持 Web SSO 批量导入并转换为 Build OAuth
...
新增 Grok Web SSO → xAI Device Flow → Grok Build OAuth 导入链路,
支持管理员批量粘贴 SSO key 创建 OAuth 账号。
- 后端:ConvertSSOToBuild、ConvertFromSSO、POST /admin/grok/sso-to-oauth
- 批量:3 worker 并发,失败跳过并汇总 created/failed,worker panic recover
- 无 refresh_token 时写入 expires_at 并强制 auto_pause_on_expired
- 前端:SSO Cookie 导入入口、动态超时、中英文案、部分成功不关弹窗
- 测试:pkg/service/handler/前端超时单测;本地 Docker 真实 SSO e2e 通过
2026-07-14 01:09:07 +08:00
superman2003
c896cacf6d
feat(grok): improve free quota probing and usage
2026-07-13 19:49:56 +08:00
Heatherm Huang
bc5d6ecb46
fix(grok): allow third-party API base URLs
2026-07-13 15:27:57 +08:00
shaw
8315defe8e
Merge branch 'main' into feat/grok-video-edit-extension
2026-07-13 14:50:18 +08:00
Wesley Liddick
d774948e09
Merge pull request #4082 from zuelu/agent/fix-codex-additional-tools-chat-bridge
...
fix(apicompat): 支持 Codex additional_tools 到 Chat Completions 桥接
2026-07-13 14:42:16 +08:00
xingzhi
317de9c04b
fix: support namespace tools in native responses
2026-07-13 14:38:05 +08:00
Wesley Liddick
fbc3f42a22
Merge pull request #4138 from fengshao1227/fix/read-tool-args-streaming
...
fix(apicompat): Read 工具参数实时流式发送,不再依赖 .done 事件
2026-07-13 14:14:08 +08:00
Wesley Liddick
98cc641008
Merge pull request #4134 from yan9651688/fix/usage-window-pagination-local-dates
...
fix: align usage windows, pagination offsets, and local dates
2026-07-13 14:13:34 +08:00
li
b6427d4ec0
fix(apicompat): 流式 Anthropic max_tokens 映射为 incomplete + content_filter 映射为 finish_reason
2026-07-13 12:08:32 +08:00
li
a5d40c9845
fix(apicompat): Read 工具参数实时流式发送,不再依赖 .done 事件
...
Fixes #4114
2026-07-13 11:47:18 +08:00
yan9651688
3605a316af
Keep usage ranges consistent across API and dashboards
...
Expose the active weekly subscription window through /v1/usage, calculate offsets with the same normalized page size used by queries, and keep user-facing date ranges on the browser's local calendar date.
Constraint: Preserve existing response fields and avoid new dependencies
Rejected: Keep duplicate inline date formatters | a shared local-date utility prevents the same UTC regression in both views
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep Offset and Limit based on the same normalized page size
Tested: go test ./internal/pkg/pagination ./internal/handler; go vet ./internal/pkg/pagination ./internal/handler; frontend 923 tests; pnpm typecheck; pnpm lint:check; pnpm build
Not-tested: Live API request against a deployed subscription
Related: #4121
2026-07-13 11:35:46 +08:00
chenjian
909b96edd2
feat: support Grok video edits and extensions
2026-07-13 10:50:42 +08:00
zuelu
ff5c216189
fix(apicompat): bridge Codex additional tools
2026-07-12 11:33:09 +08:00
jjaw
5015b7a1c1
修复 tool_search 参数对象反序列化
2026-07-12 04:53:34 +08:00
Wesley Liddick
e316ebf528
Merge pull request #3989 from xlplbo/fix/codex-mcp-tools-bridge
...
fix(apicompat): 补齐 Codex 0.14x 工具链经 chat 回退桥的转换(custom/tool_search/namespace)
2026-07-10 22:09:25 +08:00
xlplbo and Claude Fable 5
90e9d03dec
fix(apicompat): 强制选择 tool_search 的 tool_choice 降级为指向代理的 function 选择
...
tool_search 工具未被丢弃而是降级为同名 function 代理,此前 tool_choice 过滤
把它连同其他服务端工具类型一起静默丢弃,强制工具搜索被退化为自动选择,
违反调用方明确指定的工具选择语义。改为映射到指向代理的 function 选择;
未声明 type=tool_search 时无可指向的代理,维持丢弃。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NWQyEgFKKbdve67G6qCoAU
2026-07-10 21:14:33 +08:00
xlplbo and Claude Fable 5
e2b68d1f90
fix(apicompat): tool_choice 仅转发实际存在于转换结果中的工具
...
此前只检查转换后是否还剩任意工具,不校验 tool_choice 指向的工具是否幸存:
强制选择被丢弃的服务端工具(如 web_search)或指向不存在名字时,选择项被
原样转发,chat 上游因 tool_choice 指向未声明工具而 400。改为具名选择项仅
在目标存在于转换后工具集时转发,服务端工具类选择项随工具本身丢弃;
"auto" 等字符串形式保持原样转发。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NWQyEgFKKbdve67G6qCoAU
2026-07-10 21:06:45 +08:00
xlplbo and Claude Fable 5
a2cdaa6419
fix(apicompat): 内置 tool_search 与同名工具撞名时显式拒绝请求
...
tool_search 服务端工具降级后的代理 function 不能改名(codex 的模型侧按
tool_search 这个名字调用),与客户端声明的同名 function/custom 工具无法
区分:去程产生重复声明,回程会把普通工具的调用劫持还原成 tool_search_call。
与 namespace 摊平撞名的处理一致,在请求转换阶段显式报错(网关 400);
重复声明 type=tool_search 去重后只产出一个代理,不拒绝。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NWQyEgFKKbdve67G6qCoAU
2026-07-10 21:06:26 +08:00
li
83f169e4fa
fix(apicompat): 补齐 Responses→Anthropic 流式路径的 cache_creation_input_tokens
2026-07-10 20:49:44 +08:00
xlplbo
eb4d005031
Merge remote-tracking branch 'upstream/main'
2026-07-10 20:46:38 +08:00
li
0d28f7f90d
fix(apicompat): Responses↔Anthropic 转换补齐 cache_creation_input_tokens
...
Fixes #3935
2026-07-10 20:40:45 +08:00
shaw
8a51119e39
fix(openai): pair originator with final User-Agent for codex upstream
...
上游 /backend-api/codex 的 404 gating 是配套校验:originator 必须与
User-Agent 首段(首个 '/' 前的 client 名)配套且为官方 codex 身份,
错配(如 originator=codex_cli_rs + UA=codex-tui/...)一律 404;version
头若携带须 >= 0.144.0。
修复:
- pkg/openai 新增 PairCodexClientIdentity:由最终出站 UA 推导配套
originator(含 CODEX_INTERNAL_ORIGINATOR_OVERRIDE 尾部括号组身份恢复、
精确集合大小写归一、长度/字符集校验)
- service 新增 enforceCodexIdentityHeaders 终态收口:originator 按最终
UA 重配,推导不出官方身份整体回退默认 Codex CLI 身份;version 低于
0.144.0 提升为内置版本;originator 缺失时 no-op(保护 messages bridge)
- 接入非透传/透传/WS 三条转发路径(透传与 WS 删除会把 codex-tui 等官方
UA 强改为 codex_cli_rs 造成错配的旧兜底)、用量探针(指纹缓存 UA 与硬
编码 originator 错配)、账号 responses/图像测试(opencode 错配)
- messages 兼容桥构建前显式打 bridge 标记,防止映射到非 gpt-5/codex
模型时收口误改其刻意最小化的请求形态
Fixes #3901
2026-07-10 19:11:26 +08:00
xlplbo and Claude Fable 5
f1082bb78f
fix(apicompat): namespace 摊平名撞名时显式拒绝请求
...
摊平名与顶层 function/custom 工具撞名、或跨 namespace 摊平出同名时,
chat 上游无法按 namespace 区分调用归属:此前重复声明照发上游、回程
固定命中其中一条映射,调用可能被还原到错误工具。这类请求在原生
Responses 上游合法,歧义由摊平转换制造且不可消除,改为在请求转换
阶段直接报错(网关返回 400 invalid_request_error 并点名冲突双方);
同一 (namespace, 子工具) 的重复声明去重后不拒绝。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NWQyEgFKKbdve67G6qCoAU
2026-07-10 17:38:48 +08:00
xlplbo and Claude Fable 5
7942338328
fix(apicompat): 回程还原 namespace 子工具调用,修复 Codex MCP 工具 unsupported call
...
Codex 0.14x 将 MCP 工具声明为 namespace 工具,chat 桥去程摊平为
"<namespace>__<name>" function 工具后,回程仅原样回传平铺名的
function_call 项;codex 按 namespace+name 路由查不到该名字,所有
MCP 工具调用被判为 unsupported call。
- NamespaceToolNames 构建摊平名 →(namespace, 子工具名)反查表
(摊平名超长带截断哈希,无法按字符串切分还原)
- 非流式/流式回程命中映射时还原为裸子工具名 + namespace 字段,
ResponsesOutput 新增 Namespace 字段并同步 wire 层白名单
- 回退桥入口将映射与 CustomTools/ToolSearchDeclared 一并穿入
已在测试机经 codex exec + MCP server 端到端验证。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01NWQyEgFKKbdve67G6qCoAU
2026-07-10 17:38:17 +08:00
Wesley Liddick
5260a42a0b
Merge pull request #3953 from lyon-le/feat/openai-fast-policy-user-scope
...
feat(openai): 支持用户级 Fast/Flex 策略
2026-07-10 17:31:55 +08:00
Lyonle
f2966530c5
feat(openai): 支持用户级 Fast/Flex 策略
2026-07-10 15:16:09 +08:00
superman2003
de28eba3c8
fix(openai): harden GPT-5.6 billing and usage
2026-07-10 15:13:11 +08:00
Wesley Liddick
8b96acde97
Merge pull request #3898 from Arron196/feat/gpt-5.6-cache-billing-stats
...
feat(openai): 支持 GPT-5.6 系列缓存写入计费与统计
2026-07-10 13:57:29 +08:00
xlplbo and Claude Fable 5
18e26c127c
Merge remote-tracking branch 'upstream/main'
...
解决 backend/internal/service/openai_gateway_responses_chat_fallback.go 冲突:
将本地 tool_search/custom 工具改动(customTools/toolSearch 穿参与流状态标记)
移植到上游重构后的 CC 公共管线;同步适配上游新增调用点
openai_gateway_messages_chat_fallback.go 的 ChatCompletionsResponseToResponses 签名。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01F8zMzeFAumSddraEw1FUeG
2026-07-10 09:27:48 +08:00
benjamin
4a2b10c94e
feat(openai): support GPT-5.6 cache write billing
2026-07-10 09:08:58 +08:00
CHOS1N
ad8afc8a2e
Add parallel_tool_calls compatibility mapping
...
Preserve Chat Completions parallel_tool_calls when converting requests to the Responses API, and map Responses parallel_tool_calls back when falling back to Chat Completions upstreams.
Cover both true and explicit false values so clients can disable parallel tool calls without the field being dropped by omitempty.
2026-07-09 22:52:35 +08:00
Wesley Liddick
10102807e2
Merge pull request #3869 from Birditch/feat/admin-user-role-and-token-ranking
...
feat(admin): 用户角色管理 + 用户 Token 排行
2026-07-09 19:50:01 +08:00
Birditch and Claude Opus 4.8
b062b36646
feat(admin): 用量记录页新增"用户 Token 排行"面板
...
- 在 /admin/usage 新增按用户聚合的 Token 排行表(输入/输出/缓存/总 Token、请求数、费用)
- 支持按列排序、邮箱搜索、Top N (20/50/100/200),点击行下钻到该用户
- 复用现有筛选(用户/时间/模型/分组等)与既有 KPI 卡片、逐条日志
- 后端对 /admin/dashboard/user-breakdown 做加法扩展(向后兼容):
- UserBreakdownItem 增加 input_tokens/output_tokens/cache_tokens
- 新增 sort_by(白名单排序,防注入,缺省仍按 actual_cost)
- 新增 sort_by 转发单元测试;更新 UsageView.spec 稳定桩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-09 06:04:22 -04:00
Heatherm Huang
1a0a6ea9a8
fix: stabilize Grok quota probe model
2026-07-09 17:58:31 +08:00
Wesley Liddick
addcb34e14
Merge pull request #3851 from fengshao1227/fix/responses-to-anthropic-instructions-and-developer-role
...
fix(apicompat): ResponsesToAnthropicRequest 补全 instructions 字段并映射 developer role
2026-07-09 16:34:36 +08:00
Wesley Liddick
c842c3166c
Merge pull request #3847 from heathermhuang/codex/grok-45-official-support
...
Add official Grok 4.5 support
2026-07-09 16:07:42 +08:00
li
1785509873
fix(apicompat): ResponsesToAnthropicRequest 补全 instructions 字段并映射 developer role
...
Fixes #3850
2026-07-09 15:34:10 +08:00
Wesley Liddick
dfff28ab05
Merge pull request #3843 from InCerryGit/fix/issue-3540-lenient-json-limit
...
fix(gateway): cap lenient JSON normalization
2026-07-09 14:39:55 +08:00
Heatherm Huang
cccba9a82e
Add official Grok 4.5 support
2026-07-09 14:26:10 +08:00