Commit Graph
8336 Commits
Author SHA1 Message Date
Brisbanehuang 03aa05fd9f feat(accounts): 按账号自动同步上游分组名称与备注 2026-11-21 07:02:53 -08:00
Brisbanehuang a95c9e2631 feat(accounts): 支持从上游分组同步账号名称与备注 2026-11-21 06:03:52 -08:00
github-actions[bot] 328db26f45 chore: sync VERSION to 0.2.24 [skip ci] 2026-11-20 09:20:06 +00:00
Wesley Liddick 5c2982a81b Merge commit from fork
fix(gateway): reject request bodies whose duplicate fields disagree
v0.2.24
2026-11-20 16:57:02 +08:00
Wesley Liddick 62cebadf54 Merge pull request #8886 from SipengXie2024/fix/images-sse-usage-single-line
fix(openai): keep relayed image usage on a single SSE data line
2026-11-20 15:59:27 +08:00
Wesley Liddick eb9143956f Merge pull request #8979 from SipengXie2024/fix/antigravity-quota-forward-endpoint
fix(antigravity): query quota from the account's forward endpoint
2026-11-20 15:54:52 +08:00
Wesley Liddick 1eea0d750a Merge pull request #8976 from yan9651688/feat/model-plaza-copy-model-id
feat(model-plaza): add copy button for model IDs
2026-11-20 15:54:49 +08:00
Wesley Liddick 242556f973 Merge pull request #8973 from william-drakemond/pr/antigravity-bare429-request-scoped
fix(antigravity): 一个请求的裸 429 最多冷却一个账号 / A bare 429 cools at most one account per request
2026-11-20 15:54:45 +08:00
Wesley Liddick cdf3af4b84 Merge pull request #8972 from r266-tech/codex/typesafe-apply-account-model-mapping
fix(typesafe): apply account model mapping to System One
2026-11-20 15:54:41 +08:00
Wesley Liddick 58659ec579 Merge pull request #8968 from wucm667/fix/issue-8967-image-timeout-failover
fix(openai): fail over upstream request timeouts
2026-11-20 15:54:38 +08:00
Wesley Liddick ba5ddded9c Merge pull request #8963 from Daiyangcheng/fix/responses-stop-passthrough
fix(gateway): preserve stop sequences and Kimi tool definitions across protocol conversions
2026-11-20 15:54:34 +08:00
Wesley Liddick c03fc529b8 Merge pull request #8962 from wucm667/fix/issue-8957-grok-edit-input
fix(grok): accept five edit sources and preserve validation errors
2026-11-20 15:54:31 +08:00
Wesley Liddick 55898028ad Merge pull request #8946 from r266-tech/codex/gemini-upstream-comment-frames
fix(antigravity): preserve upstream Gemini SSE comment frames
2026-11-20 15:54:28 +08:00
Wesley Liddick 50dc3141e7 Merge pull request #8943 from alfadb/fix/deepseek-thinking-passback
fix(gateway): 补齐 DeepSeek Anthropic 工具续接历史缺失的 thinking 块
2026-11-20 15:54:24 +08:00
Wesley Liddick 1134f5dffb Merge pull request #8937 from TeacherLi07/fix/ops-duration-weighted-token-rate
fix(ops): 按累计请求耗时计算模型平均 Tokens/秒
2026-11-20 15:54:21 +08:00
Wesley Liddick 320695ae72 Merge pull request #8932 from superman2003/fix/codex-catalog-audio-input
fix(codex): preserve native audio input capabilities
2026-11-20 15:54:17 +08:00
Wesley Liddick fe1f2b6d76 Merge pull request #8931 from superman2003/fix/responses-requested-effort
fix(usage): record per-turn Responses reasoning effort
2026-11-20 15:54:14 +08:00
Wesley Liddick a641897402 Merge pull request #8929 from superman2003/fix/codex-standalone-context-names
fix(openai): preserve VS Code IDE context in HTTP Responses
2026-11-20 15:54:10 +08:00
Wesley Liddick 16b67d9afd Merge pull request #8923 from iam1maker/fix/gemini-final-turn-trailing-parts
fix(gemini): keep trailing parts out of the final tool-result turn
2026-11-20 15:54:07 +08:00
Wesley Liddick a912d13e62 Merge pull request #8918 from XYZ0901/codex/fix-admin-user-default-platform-quotas
fix(admin): 后台创建用户初始化默认平台限额
2026-11-20 15:54:02 +08:00
Wesley Liddick 69237d2ebd Merge pull request #8911 from Echways/fix/anthropic-account-test-temperature
fix(accounts): omit temperature from account tests for models that reject it
2026-11-20 15:53:58 +08:00
Wesley Liddick 2f49048cb8 Merge pull request #8902 from Ming-Sir-69/feat/refresh-button-risk-hint
feat(frontend): warn on frequent manual token refreshes
2026-11-20 15:53:55 +08:00
Wesley Liddick 88ff563f73 Merge pull request #8900 from stevelee477/feat/claude-window-cost-estimate
feat(accounts): estimate Claude OAuth and setup-token window costs
2026-11-20 15:53:52 +08:00
Wesley Liddick 6eb32ab445 Merge pull request #8899 from r266-tech/codex/bulk-passthrough-model-filter-opt-in
fix(accounts): preserve model filters during bulk passthrough edits
2026-11-20 15:53:48 +08:00
Wesley Liddick fe2d953f52 Merge pull request #8893 from SipengXie2024/fix/openai-oauth-skip-claude-models
fix(openai): skip foreign-vendor models on ChatGPT OAuth accounts, passthrough included
2026-11-20 15:53:45 +08:00
Wesley Liddick 490af330d7 Merge pull request #8883 from wucm667/fix/issue-8880-anthropic-model-metadata
fix(anthropic): expose metadata-backed long-context models
2026-11-20 15:53:42 +08:00
Wesley Liddick fb7d8fc7b9 Merge pull request #8875 from zhx8702/fix/openai-body-copy-reduction
fix(openai): stop pinning large request bodies after the handler
2026-11-20 15:53:38 +08:00
Wesley Liddick 356cdccbe8 Merge pull request #8872 from lishuangqiang/perf/tool-schema-sanitizer
perf(openai): stop walking every request body in the tool-schema sanitizer
2026-11-20 15:53:35 +08:00
Wesley Liddick 67b2df8d91 Merge pull request #8870 from lishuangqiang/perf/openai-namespace-strip-copies
perf(openai): stop copying the whole input array when stripping namespaces
2026-11-20 15:53:32 +08:00
Wesley Liddick a437224cd2 Merge pull request #8868 from lishuangqiang/perf/gateway-request-single-scan
perf(gateway): parse the request body once instead of eight times
2026-11-20 15:53:28 +08:00
Wesley Liddick 50c802c518 Merge pull request #8866 from lishuangqiang/perf/image-intent-prefilter
perf(openai): stop re-validating the same body when classifying image intent
2026-11-20 15:53:24 +08:00
Wesley Liddick 9cf9921eb4 Merge pull request #8864 from Anankke/fix/grok-search-billing-usage
fix(grok): bill search calls from xAI usage success counts
2026-11-20 15:53:21 +08:00
Wesley Liddick 998d1c8e2e Merge pull request #8862 from lishuangqiang/perf/cache-control-ttl-short-circuit
perf(gateway): skip the cache_control TTL walk when no 1h breakpoint exists
2026-11-20 15:53:17 +08:00
Wesley Liddick 3ad84e1333 Merge pull request #8859 from Anankke/fix/composite-route-thinking-adapt
fix(composite): adapt thinking to the Claude 5.5 model a route rewrites to
2026-11-20 15:53:14 +08:00
Wesley Liddick 29d9fe2ad0 Merge pull request #8858 from wucm667/fix/issue-8854-passive-usage-refresh
fix(accounts): refresh Claude and Gemini usage snapshots
2026-11-20 15:53:10 +08:00
Wesley Liddick 84a293056a Merge pull request #8845 from r266-tech/codex/scheduler-compact-account-groups
perf(scheduler): omit expanded groups from account cache
2026-11-20 15:53:07 +08:00
Wesley Liddick 600e1e1888 Merge pull request #8820 from Anankke/fix/buffered-hosted-output-items
fix(openai): rebuild empty buffered output from done items
2026-11-20 15:53:03 +08:00
Wesley Liddick 135aff88e1 Merge pull request #8804 from Anankke/fix/messages-bridge-native-tool-search
fix(apicompat): map ToolSearch to native tool_search for Codex OAuth
2026-11-20 15:52:59 +08:00
Wesley Liddick d36670a041 Merge pull request #8803 from Anankke/feat/web-search-sources-bridge
feat(apicompat): return web_search sources in web_search_tool_result blocks
2026-11-20 15:52:56 +08:00
Wesley Liddick fb60f04173 Merge pull request #8801 from Anankke/feat/websearch-exa-provider
feat(websearch): add Exa as a web search emulation provider
2026-11-20 15:52:53 +08:00
Wesley Liddick 3027001928 Merge pull request #8794 from Anankke/feat/compaction-cache-ttl-5m
feat(gateway): write Claude Code compaction requests at 5m cache TTL
2026-11-20 15:52:50 +08:00
Wesley Liddick c38a534be9 Merge pull request #8671 from xuemk/fix/openai-oauth-token-rotation-persistence
fix(openai): protect rotated oauth credentials from enrichment timeout and race conditions
2026-11-20 15:52:46 +08:00
Wesley Liddick 16b53b60a8 Merge pull request #8982 from Wei-Shaw/fix/openai-alpha-search-403-account-penalty
fix(openai): stop alpha/search tool-level 403s from benching OAuth accounts
2026-11-20 14:34:17 +08:00
shaw fe5e7fa404 fix(openai): stop alpha/search tool-level 403s from benching OAuth accounts
A Codex literature search (gpt-6.2-astra with literature_search_query)
on a plan without that capability gets 403
{"detail":"Literature search is unavailable."} from /alpha/search. The
alpha/search side-effect gate only exempted 401/404/405, so the 403 went
through the generic OpenAI 403 path: the first hit cools the account for
10 minutes and three hits within 3 hours mark it errored until an admin
clears it. 403 is also a failover status, so one request replays across
the pool. In production, one request paused all 9 OAuth accounts within
4 seconds.

On alpha/search (and the PAT Responses fallback), a 403 now writes account
state only when it is an account or workspace access-state error
(deactivated, disabled, ...). Every other 403 is the search tool refusing
the request: the request still fails over, since another account's plan
may allow it, but no account is cooled, counted or errored.
2026-11-20 14:22:44 +08:00
shaw a436766de3 fix(gateway): satisfy errcheck in duplicate-field scanner
Build the conflict path by appending to a byte slice instead of ignoring
strings.Builder write results, and discard builder results explicitly in
tests. golangci-lint v2.14.0 (CI version) reports 0 issues.

Refs: GHSA-p3r4-jcm3-2hph
2026-11-20 13:55:58 +08:00
SipengXie2024 7ded9ffb46 fix(antigravity): query quota from the account's forward endpoint 2026-11-20 04:25:09 +00:00
shaw 88d5a20b73 fix(gateway): reject multipart parts with an RFC 2231 extended field name
Go's mime parser prefers name*= over name=, so a part declared as
name="model"; name*=UTF-8''prompt is read as prompt by the gateway (no
model candidate reaches the group allowlist) but as model by an upstream
that ignores extended parameters. Reject parts whose Content-Disposition
carries name*, name*0 or name*0*. filename* stays allowed: it is the
standard way to send a non-ASCII file name.

Refs: GHSA-p3r4-jcm3-2hph
2026-11-20 11:40:25 +08:00
shaw 263a13f160 fix(gateway): close second-round audit findings on the duplicate scanner
A re-audit of ce86c1b30 found, and running code confirmed:

- scanJSONString re-scanned to the closing quote after every escape, so
  scanning was quadratic in escapes (200k "\n": 0.56 s; a 10 MB code-like
  body: 24 s). It now visits each quote once and counts the backslashes
  before it: 6 us and 0.7 ms for the same bodies.
- A multipart body with a JSON preamble (RFC 2046; skipped by Go's
  multipart reader) took the JSON branch only, bypassing both the group
  allowlist and the multipart duplicate check. A multipart Content-Type
  now always runs the multipart check, FromBodyCandidates merges JSON and
  multipart candidates, and a body that is both JSON and a form with parts
  is rejected as ambiguous. The JSON scan stops after the first top-level
  value, matching gjson, so binary file parts are never tokenised.
- LooksLikeJSON now skips every byte <= 0x20 before the first value, as
  gjson does.
- Freeform key spaces gained variables, headers, dependentRequired,
  dependencies and labels, matched on the decoded name. metadata is no
  longer freeform: Antigravity binds metadata.user_id case-insensitively
  while sticky sessions read it with gjson.
- Multipart also rejects file parts named model/session, parts without a
  parsable name, and parts carrying two Content-Disposition headers, and
  counts file and text parts with the same name together.
- WebSocket: passthrough forwards session.update and every other client
  event verbatim, and dedicated parsing reads fields from the raw frame
  before any re-encode. Both now reject a frame with repeated fields
  before reading it.
- The linear-compare limit rises to 32 to cut map churn for mid-sized
  objects.

Tests that relied on duplicates passing now assert rejection: a dedicated
WS recovery test that sent two previous_response_id keys, and WS
allowlist cases whose close reason comes from the earlier duplicate check.

Refs: GHSA-p3r4-jcm3-2hph
2026-11-20 11:32:05 +08:00
shaw ce86c1b306 fix(gateway): close bypasses found in the duplicate-field audit
An independent audit of the conflicting-field fix found, and running code
confirmed, the following. Each is fixed here.

- A JSON body labelled multipart/form-data skipped the check: the JSON
  branch was chosen from the Content-Type header, but JSON handlers never
  look at it. ConflictingField and FromBodyCandidates now detect JSON by
  content. The same header-only branch, and a UTF-8 BOM prefix (stripped by
  the handlers' lenient reader), also let a body bypass the group model
  allowlist on main; both are closed.
- Identical duplicates passed and the gateway's own sjson rewrites then
  split them: reasoning-effort downgrade, model mapping and the fast-policy
  service_tier delete only touch the first occurrence. Every repeated member
  is now rejected, whatever its value. Multipart rejects repeated scalar
  fields (model, n, size, ...) except list fields (name[], image,
  image[...], image_url).
- Nested case variants bound case-insensitively by struct-based protocol
  conversions ({"reasoning":{"effort":"low","Effort":"xhigh"}}). Members
  are now folded at every depth, except inside user-defined key spaces
  (JSON Schema properties/$defs, tool arguments, metadata, ...), where id
  and ID are distinct and only exact repeats are rejected.
- The recursive walker cost depth x size (1 MB at depth 9990: 1.6 s) and
  stored every key as a string (~16x the body). It is replaced by one
  linear byte scan with an explicit stack that compares 64-bit hashes
  (random per-process seed) of the decoded, folded names: 0.6 ms for the
  same body, ~3.7 GB/s on a Claude Code-shaped body. Subtrees deeper than
  10000 levels are bracket-counted, so later same-level members are still
  checked.
- text_max_body_size no longer bounded what group middleware buffered:
  the route-level limit ran after them. The limit is now chosen per route
  at group level.
- Body read failures in gateway middleware answered in the OpenAI shape
  with a different message than the handlers. They now use the entry
  protocol's shape and the handler's "limit is N" message. Rejections
  are recorded as ingress reason conflicting_request_fields.
- The middleware strips a leading BOM and restores the body, so composite
  routing and handlers parse the bytes that were checked.

Refs: GHSA-p3r4-jcm3-2hph
2026-11-20 10:50:32 +08:00
shaw d270d6434f fix(gateway): reject conflicting duplicates in nested objects too
The first pass checked top-level members and the session object only.
Nested fields drive billing and policy as well: reasoning.effort selects
the reasoning-effort billing multiplier and the group effort ceiling, yet
gjson reads the first occurrence, sjson downgrades only the first, and
map re-encoding keeps the last. {"reasoning":{"effort":"low",
"effort":"xhigh"}} therefore passed admission as low and could be served
as xhigh.

ConflictingField now also walks every nested object, including array
elements, and reports the first member that repeats with a different raw
value by path (reasoning.effort, messages[1].role). Nested names are
compared exactly after unescaping, without case folding, because user
data such as tool JSON Schemas may legitimately carry both id and ID.
Identical duplicates still pass. The walk stops below encoding/json's
10000-level limit and only allocates a path string on conflict
(~660 MB/s, 9 allocs for a 225 KB Claude Code-shaped body).

Responses WebSocket frames now apply the full ConflictingField rule
instead of comparing model candidates only, so service_tier and nested
reasoning.effort conflicts close the connection as on HTTP.

Refs: GHSA-p3r4-jcm3-2hph
2026-11-20 10:06:24 +08:00