HuntercodeT
f79b8bf96c
fix(antigravity): Gemini 原生流对 go-genai / python-genai 客户端不发 SSE 注释心跳
...
Antigravity 账号的 Gemini 原生流式路径在上游空闲超过 gateway.stream_keepalive_interval
(默认 10s)时会向下游写 ":\n\n" 作为心跳。SSE 规范允许注释行,但 Google 官方 SDK 里
go-genai 与 python-genai 都不会忽略它:
- go-genai(Antigravity CLI 在用)api_client.go iterateResponseStream 对任何非 data: 前缀的
事件直接返回 "iterateResponseStream: invalid stream chunk: :",整个流中断;
- python-genai _api_client.py 把非 data: 行当作错误 JSON 拼接后 json.loads,同样抛错。
Google 官方 API 从不下发注释行,这两个 SDK 从未处理过这种输入。js-genai 用规范的
event-stream 解析器,不受影响。
现在按下游 User-Agent / X-Goog-Api-Client 识别这两类 SDK(形如
google-genai-sdk/1.71.0 gl-go/go1.28 …、google-genai-sdk/x gl-python/3.12),命中时该路径
不再发注释心跳;其他客户端(curl、js-genai、Gemini CLI)行为不变。
生产复现:Antigravity CLI 1.2.5 经网关(sub2api 0.2.5)跑长思考请求,上游首个 chunk 超过 10s
时客户端报 "agent executor error: … iterateResponseStream: invalid stream chunk: :"。
2026-09-17 19:41:55 +08:00
cyh
e74c690ac4
fix(openai): keep transport heartbeats outside semantic output
2026-09-17 19:15:09 +08:00
Wesley Liddick
efe9aab1e4
Merge pull request #7246 from laoxiechuzheng/fix/deepseek-native-responses-tool-output-media
...
fix(deepseek): lift Responses tool output images
2026-09-17 17:02:43 +08:00
zoutao
0952ce3410
fix(apicompat): include streamed arguments in function_call_arguments.done
...
Gemini/Antigravity delivers tool arguments as one complete object, so this
converter synthesizes the Responses tool-call stream itself and therefore owns
its self-consistency. The done event was built without Arguments, leaving it ""
while the preceding delta carried the entire JSON. Clients that reconcile the
done payload against the accumulated deltas (OpenAI Responses SDK); Qoder's
reconcileToolCall) reject that mismatch as inconsistent_tool_call and abort the
turn non-retryably, so every tool call through the gateway failed.
Emit state.CurrentArgs, which closeCurrentResponsesItem already uses for the
item, restoring sum(deltas) == done.arguments == item.arguments.
Regression test asserts the delta sum equals the done payload and fails closed
when Arguments is dropped.
2026-09-17 16:54:44 +08:00
Cai
d099c06945
fix: resolve Seedance lint and gRPC security checks
2026-09-17 17:51:03 +09:00
Wesley Liddick
aeab57b9b2
Merge pull request #7256 from zhudaguaneren/fix/antigravity-attribution-429
...
fix(antigravity): 过滤 Claude attribution 元数据,修复特定请求的 429
2026-09-17 16:44:09 +08:00
Wesley Liddick
18328aed05
Merge pull request #7212 from wucm667/feat/issue-7203-redemption-pagination
...
feat(redeem): paginate user redemption history
2026-09-17 16:43:06 +08:00
Wesley Liddick
48a86ec926
Merge pull request #7224 from HypoxanthineOvO/codex/upstream-chat-role-compat
...
fix(gateway): normalize developer roles for strict native Chat upstreams
2026-09-17 16:42:31 +08:00
Wesley Liddick
b4e560824a
Merge pull request #7177 from xO-ox-ai/codex/fix-openai-response-binding-context
...
fix(openai): 客户端断开后仍持久化 Responses 续聊绑定
2026-09-17 16:42:12 +08:00
Wesley Liddick
9efc167482
Merge pull request #7195 from bitnom/fix/refresh-paused-oauth-accounts
...
fix(account): keep refreshing OAuth tokens for paused accounts
2026-09-17 16:41:54 +08:00
Wesley Liddick
c84a3d50a3
Merge pull request #7215 from xz-dev/fix/manifest-double-parse
...
fix(openai): parse Codex models manifest envelope once
2026-09-17 16:41:12 +08:00
Wesley Liddick
d52ab27def
Merge pull request #7173 from HuntercodeT/fix/gemini-native-mixed-model-listing
...
fix(gemini): discover Antigravity mappings in native model lists
2026-09-17 16:37:38 +08:00
laoxiechuzheng
acc05620cb
fix(deepseek): keep parallel Responses tool outputs contiguous
2026-09-17 15:45:56 +08:00
zhudaguaneren
be4a4990ff
fix(antigravity): strip Claude attribution metadata from system prompts
2026-09-17 11:57:53 +08:00
Cai
aba34524f1
feat: support native Seedance Ark video task API
2026-09-17 04:14:14 +09:00
laoxiechuzheng
881ab1b0c6
fix(deepseek): lift Responses tool output images
...
DeepSeek native Responses rejects Codex view_image results when function_call_output.output contains input_image parts. Move media into a following user message and keep the tool output as a string so call_id pairing remains valid.
2026-09-17 01:22:22 +08:00
HypoxanthineOvO
18bfa4bf20
fix(gateway): normalize developer roles for strict Chat upstreams
2026-09-16 16:11:43 +08:00
Xiangzhe
31f3003ff5
fix(openai): preserve manifest key validation
2026-09-16 06:15:31 +00:00
Xiangzhe
2f16e0984e
fix(openai): avoid duplicate manifest parsing
2026-09-16 06:15:25 +00:00
wucm667
a9ed218989
feat(redeem): paginate user redemption history
2026-09-16 13:19:15 +08:00
HuntercodeT
18d483c2a1
fix: 分组用量汇总不再全表扫 usage_logs
...
GET /api/v1/admin/groups/usage-summary 在有一定数据量的库上会退化成
usage_logs 全表扫。根因是 getAllGroupUsageSummaryFromRollups 里,tail CTE
的 created_at 下界 state.tail_start 由同一条 SQL 的 state CTE 算出、再用
CROSS JOIN 交给 tail:这个值对 planner 来说要到运行期才知道,既进不了
index cond,也估不准选择性,于是只能顺序扫全表再逐行过滤。
生产实测(1721 万行 usage_logs / PostgreSQL 17):
Nested Loop (actual time=28161..48334 rows=34788)
Join Filter: (ul.created_at >= state_1.tail_start)
Rows Removed by Join Filter: 17178082
-> Seq Scan on usage_logs (actual time=0.030..47567 rows=17212870)
Buffers: shared hit=12863 read=951875
Execution Time: 48720 ms
改成先读一次水位行、在 Go 侧算出 tail_start / closed_before / retained
日期,再把它们当查询参数传进来。同一套数据上:
Index Scan using idx_usage_logs_created_at on usage_logs
Index Cond: (created_at >= $7)
Execution Time: 34 ms
水位有效性的判定(恰好一行、时区名与配置一致、水位不在未来)和无效时
退化成从 epoch 全量重算的行为,与原先 SQL 里 state_values / CASE WHEN
valid 的分支逐条对应,结果口径不变。
另外读取水位的语句不加锁,不参与 #6976 那条 FOR UPDATE / FOR KEY SHARE
的阻塞链。
2026-09-16 10:11:18 +08:00
bitnom
8e34ca5e31
fix(account): keep refreshing OAuth tokens for paused accounts
...
Paused (schedulable=false) active accounts were excluded from the
background token refresh candidates, so their stored access_token
silently expired. The admin usage-window quota probe uses the stored
token verbatim (no token provider / no refresh), so the probe then gets
HTTP 401 UNAUTHENTICATED and the dashboard reports a false "needs
re-auth" for a perfectly healthy account, while Test Connection and live
traffic (which refresh on demand via the token provider) keep working.
Pause is not permanent rejection: error accounts are already excluded by
the status = 'active' filter, and accounts whose refresh genuinely fails
are rate-limited by the retry-cooldown exclusion (10-minute retry-
exhausted cooldown). Refresh success only persists credentials and never
touches schedulable, so a paused account cannot be silently un-paused.
Drop the schedulable filter and update the SQL-filter test, the
integration pagination test, and the service-level candidate fake.
2026-09-15 10:00:26 -04:00
xO-ox-ai
d7ee1ab6be
fix(openai): persist response affinity after client cancel
2026-09-15 18:44:50 +08:00
HuntercodeT
da74bf13a4
fix(gemini): discover antigravity mappings in native model lists
2026-09-15 16:50:46 +08:00
Wesley Liddick
86f93c28ee
Merge pull request #6977 from alfadb/fix/deepseek-model-name-validation
...
fix(deepseek): 未配置 model_mapping 时按官方模型名单校验,不再透传未知模型名
2026-09-15 16:20:31 +08:00
Wesley Liddick
30ed40a56a
Merge pull request #7074 from Brisbanehuang/codex/fix-codex-quota-windows
...
fix(scheduler): 按规范 5h/7d 窗口读取 Codex 配额与重置时间
2026-09-15 16:17:37 +08:00
Wesley Liddick
b8275209e8
Merge pull request #7162 from HuntercodeT/fix/antigravity-gemini-sse-separator
...
fix(antigravity): gemini 透传 SSE 事件之间不再多写一个空行(Antigravity CLI invalid stream chunk)
2026-09-15 16:17:25 +08:00
郭兰鑫 and Claude Code
1e231ee2ae
fix(antigravity): resolve golangci-lint errors in schema cleaner tests
...
- Replace unchecked single-value type assertions with comma-ok form
guarded by require.True (errcheck check-type-assertions)
- Remove trailing blank line flagged by gofmt
Co-Authored-By: Claude Code <noreply@anthropic.com >
2026-09-15 16:01:30 +08:00
Wesley Liddick
25c21aedda
Merge pull request #7129 from kk-418/fix/grok-build-responses-sequence-number
...
fix(responses): 始终在 Responses SSE 中写出 sequence_number 避免反序列化失败
2026-09-15 15:28:33 +08:00
HuntercodeT
8447bdd368
fix(antigravity): gemini 透传 SSE 事件之间不再多写一个空行
...
handleGeminiStreamingResponse 把上游每条 data 行改写成 "data: ...\n\n",
紧接着又把上游的空分隔行原样透传成第三个 "\n",下游看到的事件之间是
"\n\n\n"。google-genai 的 Go SDK(Antigravity CLI 在用)按 "\n\n" 切事件,
多出的 "\n" 粘到下一个事件开头,前缀变成 "\ndata" 而报
"iterateResponseStream: invalid stream chunk",每条流都在第二个事件中断。
空分隔行不再透传(data 分支已经写过 "\n\n"),附回归测试:两个事件
(LF 与 CRLF 各一)经过后输出必须恰好是一个空行分隔,并按 "\n\n" 切帧
逐个校验前缀。
Fixes #7161
2026-09-15 15:10:45 +08:00
haruka
6582260bc8
feat: add configurable rolling log retention
2026-09-15 14:21:15 +08:00
alfadb
a939553c87
fix(deepseek): 模型名校验不再默认兜底,未配置映射时按官方名单校验
...
- 未配置 model_mapping 的 DeepSeek 账号不再放行任意模型名,改为官方名单精确匹配
(deepseek-flash / deepseek-v4-pro / deepseek-v4-flash /
deepseek-v4-flash-vision-exp / deepseek-v4-pro-0813)
- 校验前先归一化:剥离 Claude Code 客户端上下文后缀 [1m](含重复形式)并统一小写,
使官方 Claude Code 接入写法 deepseek-flash[1m] 继续可用
- 未知模型名在调度阶段即拒绝,返回 404 model_not_found,避免透传上游后触发
per-(账号,模型) 冷却、并避免上游把不认识的模型名静默兜底成 deepseek-flash
- 出站前剥离泄漏的 [1m] 后缀,仅作用于 DeepSeek 平台
- 配置了 model_mapping 的账号语义不变(映射优先)
2026-09-15 10:42:29 +08:00
Wesley Liddick
2061508ad8
Merge pull request #7072 from Brisbanehuang/codex/fix-scheduler-metrics
...
fix(scheduler): 修复选号耗时返回值和粘性命中率重复计数
2026-09-15 08:58:58 +08:00
Wesley Liddick
fb90414c05
Merge pull request #7126 from xO-ox-ai/codex/fix-responses-lite-namespace
...
fix(openai): 保留 Responses Lite namespace 工具调用
2026-09-15 08:58:25 +08:00
Wesley Liddick
9fade3e8c2
Merge pull request #6769 from alfadb/feature/ollama-rate-limit-reset
...
feat(ollama): 根据用量窗口异步更新限流恢复时间
2026-09-15 08:57:43 +08:00
Wesley Liddick
1920a7d687
Merge pull request #7091 from SavitarC/feat/subscription-bulk-actions
...
feat: 支持订阅管理批量操作
2026-09-15 08:57:27 +08:00
Wesley Liddick
150c52b8de
Merge pull request #6689 from tunsuy/fix/antigravity-codex-web-search-mixed-tools
...
fix(antigravity): drop mixed web_search when client tools present
2026-09-15 08:54:40 +08:00
Wesley Liddick
3e4b6a09b2
Merge pull request #6925 from reed-yang/fix/recover-responses-text
...
fix(apicompat): recover Responses text from done and terminal events
2026-09-15 08:54:21 +08:00
Wesley Liddick
dd2e6b3680
Merge pull request #7076 from Shen-An/fix/antigravity-refresh-warning
...
fix(admin): surface partial Antigravity refresh warnings
2026-09-15 08:54:06 +08:00
Wesley Liddick
d4439129a7
Merge pull request #7094 from liuyuzhou666/fix/responses-chat-developer-role-mapping
...
fix(apicompat): 修复 Responses 降级 Chat Completions 时的 system 消息顺序问题
2026-09-15 08:53:50 +08:00
Wesley Liddick
1e1d15cca5
Merge pull request #7082 from ggllzz04/fix/antigravity-token-cache-isolation
...
fix(antigravity): isolate OAuth token cache key by account ID to prevent 429 collision
2026-09-15 08:53:32 +08:00
Wesley Liddick
f7e959ae5f
Merge pull request #7111 from ouchihao/codex/bug-proxy-clear-credentials
...
fix(proxy): allow explicitly clearing stored credentials
2026-09-15 08:52:58 +08:00
Wesley Liddick
008391f699
Merge pull request #7085 from r266-tech/codex/sub2api-f352188cb784
...
fix(openai): strip internal metadata from OAuth input items
2026-09-15 08:52:30 +08:00
HPnetwork
29bce46a2a
fix: keep API key accounts available for unknown models
2026-09-14 05:56:59 -04:00
xO-ox-ai
13c1d4cde2
test(openai): 覆盖 Lite 命名空间工具回传
2026-09-14 11:46:41 +08:00
cikenerd and Cursor
087987070b
fix(responses): 为 grok-build 始终写出 sequence_number
...
网关合成/重编的 Responses SSE 因 omitempty 或缺字段丢掉 sequence_number,
grok-build 会整轮反序列化失败。合成失败帧、compact 桥接和转换 wire JSON
一律写出该字段,0 也保留。
Fixes #7128
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-09-14 11:45:53 +08:00
xO-ox-ai
4bd7132ba9
fix(openai): 保留 Responses Lite namespace 调用
2026-09-14 11:35:03 +08:00
chihao.ou
28a4ea914d
fix(proxy): allow explicitly clearing stored credentials
2026-09-13 17:23:24 +08:00
MHJoy99
7511e4de59
fix(streaming): drop Anthropic ping keepalives before OpenAI conversion
...
Upstream Anthropic keepalive frames (event: ping) leaked into OpenAI
Chat Completions SSE streams, crashing strict clients (Cursor, Hermes,
OpenAI SDKs) on unexpected event types. Error events still forward.
Fixes #5203
2026-09-13 13:30:50 +06:00
liuyuzhou666
52558381c6
fix(apicompat): merge leading system messages and downgrade mid-conversation system from Responses bridge
...
The Responses to Chat Completions bridge mapped both the instructions field and role developer items to system messages. Codex always sends both, and also injects developer notices mid-conversation when switching models, so the forwarded request contained consecutive leading system messages and mid-conversation system messages. Strict Qwen-family upstreams reject this with HTTP 400 "System message must be at the beginning."
Leading system/developer messages are now merged into a single leading system message, and later system/developer messages are downgraded to user so the content is preserved without violating upstream role ordering.
2026-09-13 14:08:57 +08:00