Commit Graph
8336 Commits
Author SHA1 Message Date
shaw e391d5fa38 Merge remote-tracking branch 'gh/main' into fix-8822 2026-11-16 17:03:37 +08:00
shaw b46b3cbabc test(handler): follow normalizeCodexUntrustedContext rename from #8769
#8769 renamed normalizeCodexPageContext to normalizeCodexUntrustedContext;
the call-output gate test still referenced the old name, so go vet -tags unit
failed once both changes were on main.
2026-11-16 17:03:29 +08:00
shaw fb07aaee23 Merge remote-tracking branch 'gh/main' into fix-8816 2026-11-16 17:02:10 +08:00
Anankke 413f1cb08a fix(openai): keep xAI server-side search out of rebuilt buffered tool calls
A buffered request on a Grok account rebuilds an empty terminal output from the done items and renders its custom_tool_call items as tool_use or tool_calls.
An item that apicompat.IsServerSideSearchCall accepts is a search xAI ran itself, so it is no longer rendered as a client tool call.
The item stays in the output, so Grok SearchCount still counts it, and stop_reason and finish_reason follow the remaining content.
A new test covers an empty terminal on /v1/messages and /v1/chat/completions, with and without a client tool next to the search.
2026-11-16 00:43:36 -08:00
Anankke 7f1ecfaa2d fix(openai): follow the streaming path for rebuilt buffered items
A rebuilt output skips a web search that is not completed, gives an empty custom tool input as {} and keeps a reasoning signature that only the added event carries.
Deltas without an output_index join their item by item_id or as the newest open item of their kind, and deltas that came before the item was added belong to it.
Items that share an output_index or have none keep their own events: an item of another kind, a done item that is already closed and a different call_id each get their own slot.
2026-11-16 00:41:51 -08:00
Anankke 5279823757 fix(openai): complete buffered item parts by their own index
A message or reasoning item with several parts lost or doubled text when its done item left only some of them empty and the terminal output was empty.
Observe now keeps the deltas per content_index or summary_index, apart for output_text, refusal, summary_text and reasoning_text.
buildMessage and buildReasoning fill only the blank part whose own index has deltas and keep the parts with text and their order as the done item has them.
Deltas of an index the done item has no part for follow its parts.
2026-11-16 00:41:51 -08:00
Anankke 49ef5f6909 fix(openai): render custom tool calls only from rebuilt buffered output
A custom_tool_call in an output the upstream delivered is not a client tool call; 250deb70e5 rendered it on that path too, which turns xAI server-side searches into tool_use.
ResponsesResponse.RenderCustomToolCalls is set only when the buffered reader rebuilds an empty output, so a delivered output behaves as before the rework.
A reasoning done item that carries both a summary and raw reasoning_text content now takes its text from the deltas again, as the streaming path shows it.
2026-11-16 00:41:51 -08:00
Anankke fbe8c39a90 fix(apicompat): keep tool_use input a JSON object in buffered responses
A tool call whose arguments were not a JSON object (truncated by max_output_tokens, empty, or the free-form input of a custom_tool_call) made json.Marshal fail, so /v1/messages answered 200 with an empty body.
ResponsesToAnthropic now keeps an object as it is, uses {} for a function_call with anything else, and wraps a custom_tool_call input as {"input": ...}, the shape extractCustomToolCallInput reads back.
Both converters now render custom_tool_call items, which were dropped when the terminal output carried them.
The streaming converter is unchanged: it forwards the argument deltas as the upstream sent them.
2026-11-16 00:41:51 -08:00
Anankke 00b09b892d fix(openai): rebuild empty buffered terminal output from done items
An empty terminal output was rebuilt from merged deltas, so reasoning lost its per-item signature and segmentation, and message and tool order followed the accumulator instead of output_index.
The buffered reader now records every output item and rebuilds the terminal output from the output_item.done items in output_index order, taking deltas only for a field a done item left empty or for an item that never got a done event.
Items merge by item id, so items sharing an output_index stay apart and a repeated item replaces its earlier copy; response.cancelled terminals are filled too.
A non-empty terminal output is untouched. A new test compares /v1/messages and /v1/chat/completions with the streaming path on shapes taken from real Codex streams.
2026-11-16 00:41:51 -08:00
Anankke f72ef07097 fix(openai): keep hosted output items in buffered compat responses
Non-streaming /v1/messages and /v1/chat/completions force an upstream stream and read it with readOpenAICompatBufferedTerminal, and the Codex OAuth backend ends that stream with an empty terminal output.
The delta accumulator rebuilds only reasoning, message and function calls, so web_search_call, image_generation_call and other hosted items were dropped and /v1/messages lost its server_tool_use and web_search_tool_result blocks.
The reader now collects the output_item.done items of every type the accumulator does not produce and adds them to an empty terminal output, after the leading reasoning item and ahead of the message and function calls.
The accumulator's own items stay exactly as it builds them, so reasoning text, function call arguments and custom tool calls are unchanged, and a non-empty terminal output is untouched.
2026-11-16 00:41:40 -08:00
Anankke 70ad8365d9 fix(grok): keep xAI server-side search calls out of tool calls
On xAI upstreams a custom_tool_call whose call_id starts with xs_ or as_ is an xAI server-side search call, as the xAI tool usage docs define the prefixes.
The Messages and Chat Completions stream converters and the buffered accumulator no longer return such items as tool_use or tool calls, and stop_reason and finish_reason follow the remaining content.
Grok SearchCount counts each such item once; client custom tools and non-xAI upstreams are unchanged.
2026-11-16 00:40:53 -08:00
Wesley Liddick d70676756f Merge pull request #8840 from r266-tech/codex/channel-bedrock-compat-toggle
fix(channels): persist Bedrock compatibility as a boolean
2026-11-16 16:35:31 +08:00
Wesley Liddick 6b7cbc63be Merge pull request #8837 from Daiyangcheng/fix/seedance-scheduler-capability-projection
fix(scheduler): keep openai_capabilities in the scheduler metadata projection so Seedance accounts stay schedulable
2026-11-16 16:35:23 +08:00
Wesley Liddick 46b8792658 Merge pull request #8828 from little-greenbean/fix/gemini-parallel-tool-calls
fix(gemini): separate same-name parallel tool calls in streams
2026-11-16 16:35:14 +08:00
Wesley Liddick 4f3f916317 Merge pull request #8826 from william-drakemond/fix/compat-empty-stream-release-sticky
fix(antigravity): keepalive 后空流释放会话粘性账号 / Release the sticky account after a committed empty compat stream
2026-11-16 16:35:06 +08:00
Wesley Liddick f2eaed31c3 Merge pull request #8825 from r266-tech/codex/deepseek-explicit-pricing-overrides
fix(pricing): honor explicit DeepSeek token price overrides
2026-11-16 16:34:58 +08:00
Wesley Liddick 992ac63308 Merge pull request #8814 from qsy4/fix/openai-compat-stream-account-side-effects
fix(openai): apply account side effects to stream errors after output on compat paths
2026-11-16 16:34:50 +08:00
Wesley Liddick 101c2462dd Merge pull request #8813 from qsy4/fix/openai-sse-keepalive-before-first-output
fix(openai): forward upstream keepalive events before first output
2026-11-16 16:34:42 +08:00
Wesley Liddick 1ca302abf3 Merge pull request #8811 from Anankke/fix/messages-bridge-pre-content-failover
fix(openai): fail over Messages bridge errors before first content
2026-11-16 16:34:33 +08:00
Wesley Liddick 9750f8e039 Merge pull request #8808 from r266-tech/codex/first-output-spool-fallback
fix(openai): fall back to memory when first-output spool creation fails
2026-11-16 16:34:25 +08:00
Wesley Liddick 568db32f22 Merge pull request #8806 from feeeei/fix/usage-account-filter-actual-cost
fix(usage): 按账户筛选时模型与端点分布的实际扣费不再替换为账号成本
2026-11-16 16:34:16 +08:00
Wesley Liddick 119b04f945 Merge pull request #8800 from Anankke/fix/upstream-tcp-keepalive
fix(upstream): detect dead upstream connections in about 30s
2026-11-16 16:34:08 +08:00
Wesley Liddick 857ab95081 Merge pull request #8798 from Anankke/fix/pricing-startup-nonblocking
fix(pricing): check remote hash in background at startup
2026-11-16 16:34:00 +08:00
Wesley Liddick 470c02b399 Merge pull request #8796 from Anankke/fix/composite-route-public-model-response
fix(gateway): restore public model in composite-routed responses
2026-11-16 16:33:53 +08:00
Wesley Liddick 97957edd9e Merge pull request #8790 from Anankke/fix/websearch-account-mode-platforms
fix(websearch): honor account mode on every channel-toggle platform
2026-11-16 16:33:45 +08:00
Wesley Liddick 63751ea4de Merge pull request #8788 from Anankke/fix/count-tokens-passthrough-duplicate-headers
fix(gateway): stop duplicating headers on count_tokens passthrough
2026-11-16 16:33:38 +08:00
Wesley Liddick 1d585c94fd Merge pull request #8786 from Anankke/fix/chat-completions-metadata-user-id
fix(gateway): keep client metadata.user_id in Chat Completions to Anthropic
2026-11-16 16:33:30 +08:00
Wesley Liddick 4cebc098c3 Merge pull request #8779 from lishuangqiang/fix/anthropic-fable-model-limit-recovery
fix(ratelimit): lift Anthropic Fable model limit when the 7d_oi window recovers
2026-11-16 16:33:22 +08:00
Wesley Liddick c7df3b693f Merge pull request #8775 from Henglie/fix/web-no-store-settings-html
fix(web): stop caching settings-injected HTML
2026-11-16 16:33:15 +08:00
Wesley Liddick d31a87a4e2 Merge pull request #8769 from Undertone0809/codex/fix-codex-http-context
fix(openai): normalize additional Codex context on HTTP Responses
2026-11-16 16:33:07 +08:00
Wesley Liddick 56848016c5 Merge pull request #8763 from wc4440222/fix/kimi-monthly-quota
fix(kimi): 解析新套餐月度额度并清理缺席窗口快照
2026-11-16 16:32:59 +08:00
Wesley Liddick 4763569af2 Merge pull request #8761 from CooCoode/fix/8760-cc-responses-strict-default
fix(apicompat): default json_schema strict=false when converting CC to Responses
2026-11-16 16:32:51 +08:00
Wesley Liddick 202740441d Merge pull request #8759 from r266-tech/codex/gemini-schema-array-items
fix(antigravity): match schema items to the selected type
2026-11-16 16:32:44 +08:00
Wesley Liddick 3b5310c5d5 Merge pull request #8757 from Anandb71/arbor/sonnet-4-5-retirement
fix(claude): default account tests to claude-sonnet-4-6
2026-11-16 16:32:36 +08:00
Wesley Liddick e16a349ebb Merge pull request #8754 from r266-tech/codex/preserve-additional-tools-id
fix(codex): preserve and normalize additional_tools IDs
2026-11-16 16:32:27 +08:00
Wesley Liddick 8a585c9141 Merge pull request #8745 from wozhenbang2004/fix/anthropic-compat-observation-8714
fix(gateway): record Anthropic response models in compatibility routes
2026-11-16 16:32:19 +08:00
Wesley Liddick 6247d33eb6 Merge pull request #8743 from r266-tech/codex/fix-peak-rate-usage-test
test(billing): make peak-rate usage tests independent of wall clock
2026-11-16 16:32:11 +08:00
Wesley Liddick 6fd905f30d Merge pull request #8742 from r266-tech/codex/per-turn-control-beta
fix(gateway): preserve message output config with per-turn beta
2026-11-16 16:32:02 +08:00
Wesley Liddick e54a186548 Merge pull request #8741 from r266-tech/codex/native-anthropic-error-endpoint
fix(gateway): record native Anthropic endpoints on error paths
2026-11-16 16:31:55 +08:00
Wesley Liddick 0563176a5d Merge pull request #8740 from r266-tech/codex/gemini-usage-refetch
fix(accounts): keep Gemini usage bars visible during refetch
2026-11-16 16:31:47 +08:00
Wesley Liddick c782537eef Merge pull request #8739 from r266-tech/codex/anthropic-compat-effort-policy
fix(gateway): enforce effort policies on Anthropic compatibility routes
2026-11-16 16:31:39 +08:00
Wesley Liddick d7ae0544e8 Merge pull request #8738 from r266-tech/codex/reactive-cn-quota-snapshots
fix(cn-quota): refresh usage cells with account snapshots
2026-11-16 16:31:31 +08:00
Wesley Liddick 5146728d2f Merge pull request #8737 from r266-tech/codex/claude-rotated-token-retry
fix(claude): recover requests after concurrent token rotation
2026-11-16 16:31:22 +08:00
Wesley Liddick 472ea57525 Merge pull request #8736 from wozhenbang2004/fix/whitelist-wildcard-8710
fix(accounts): reject wildcard model whitelist entries
2026-11-16 16:31:14 +08:00
Wesley Liddick eb25511c71 Merge pull request #8735 from Hato626/perf/oauth-input-metadata-cleanup
perf(openai): avoid repeated full-body copies during OAuth metadata cleanup
2026-11-16 16:31:06 +08:00
Wesley Liddick c6d9d48f9a Merge pull request #8729 from r266-tech/codex/snapshot-transient-expiry
fix(scheduler): recover snapshot accounts after cooldown expiry
2026-11-16 16:30:58 +08:00
Wesley Liddick a38ffc3050 Merge pull request #8728 from r266-tech/codex/chat-fallback-response-observation
fix(usage): retain response models through Chat fallbacks
2026-11-16 16:30:49 +08:00
Wesley Liddick 32e4283894 Merge pull request #8727 from r266-tech/codex/native-anthropic-response-observation
fix(usage): retain native Anthropic response observations
2026-11-16 16:30:41 +08:00
Wesley Liddick 51e76a46c1 Merge pull request #8726 from r266-tech/codex/sticky-writeback-after-disconnect
fix(gateway): retain sticky writes after client disconnects
2026-11-16 16:30:34 +08:00
Wesley Liddick 90eb1744d4 Merge pull request #8723 from cyhhao/fix/keep-weekly-usage-on-5h-rollover
fix(anthropic): keep weekly usage readings across 5h rollovers
2026-11-16 16:30:26 +08:00