Commit Graph

4629 Commits

Author SHA1 Message Date
Supra4E8C
7b4c64b006 fix(auth): preserve disabled credential refresh backoff 2026-11-01 02:52:02 +08:00
Supra4E8C
95f125ffd0 fix(auth): skip automatic Codex refresh without renewal credentials 2026-11-01 02:52:02 +08:00
sususu
250d598175 perf(antigravity): make selectGroupResponses O(N+M) and deduplicate systemInstruction sanitize v8.0.49 2026-10-31 21:09:56 +08:00
sususu
234217d081 fix(antigravity): discard excess functionResponse parts per turn in fixCLIToolResponse (#7137) 2026-10-31 21:07:50 +08:00
Luis Pater
f42f58719d fix(antigravity): strip empty part objects from Gemini systemInstruction.parts
- Remove empty JSON part objects from request.systemInstruction.parts in ConvertGeminiRequestToAntigravity after system_instruction key normalization so upstream Cloud Code Assist does not fail Part.data oneof deserialization with HTTP 400.
- Delete request.systemInstruction when all of its parts are empty objects while preserving zero-copy pass-through when all parts are non-empty.

Closes: #7136
2026-10-31 20:20:21 +08:00
Luis Pater
a8dbebabdf feat(pluginhost): allow plugins to register multiple OAuth login entries
- Add Capabilities.AuthProviders and MultiAuthProvider (Identifiers() []string) in sdk/pluginapi, bump sdk/pluginabi.SchemaVersion to 10, and forward AuthProviders in sdk/pluginhost
- Extend internal/pluginhost to register, expose, and route multiple OAuth login identifiers per plugin across StartLogin, PollLogin, RefreshAuth, ParseAuths, and ExchangeCallback, while preserving per-credential oauth_provider/portal attribution for shared credential providers
- Expose oauth_providers alongside primary oauth_provider in RegisteredPluginInfo and GET /v0/management/plugins, and support target-credential re-login (StartOAuthV8) across sibling portals

Closes: #7126
2026-10-31 20:20:16 +08:00
sususu
4c46f0aaa5 fix(gemini): strip empty part objects from systemInstruction (#7136) 2026-10-31 20:10:48 +08:00
Luis Pater
cc4b9949e7 feat(claude): add opt-in visible Codex commentary with preserved replay
- Add `client.claude.show-codex-commentary` config and propagate the request-scoped display policy through HTTP and WebSocket Codex executors.
- Mirror public Codex `commentary` messages into visible Claude text blocks alongside the `cpa:commentary:v1` thinking marker in streaming and non-streaming responses without altering genuine reasoning or token accounting.
- Deduplicate only the exact adjacent mirrored commentary text block during Claude-to-Codex request replay when enabled.

Closes: #7129
2026-10-31 10:04:12 +08:00
Luis Pater
dbb706215a fix(codex): expand recognized CPA compaction capsules before forwarding to OpenAI
- Expand recognized CPA compaction capsules into developer context messages across Codex HTTP, compact, WebSocket, duplex steering, and token-counting paths while preserving native OpenAI compaction items.
- Reject corrupted CPA compaction capsules with HTTP 400 instead of forwarding unverifiable ciphertext to upstream.

Closes: #7118
v8.0.48
2026-10-30 22:33:02 +08:00
sususu
068fe153ef fix(antigravity): preserve Claude tool-result error semantics 2026-10-30 18:54:53 +08:00
Dylan
81de4b9c48 fix(gemini): preserve Claude tool-result error semantics (#6838) 2026-10-30 18:42:27 +08:00
Luis Pater
bc81923ba6 feat(pluginhost): allow model registrars to publish models for multiple providers
- Add ProviderModels, Registrations, MultiProviderModels, and SchemaVersionMultiProviderModels so a single plugin can register model catalogs across multiple providers while preserving single-provider compatibility.
- Track per-plugin provider sets and multi-provider model registrations in the plugin host for catalog aggregation, per-auth model discovery matching, and targeted unload cleanup.

Closes: #7115
2026-10-30 14:38:48 +08:00
Luis Pater
67beb7a6c0 Merge pull request #7109 from eaxeax/fix/cooldown-state-relative-auth-dir
fix(auth): write the cooldown state next to the auth file when auth-dir is relative
2026-10-30 10:14:23 +08:00
Luis Pater
12d97cfe19 fix(translator): translate mid-conversation Claude tool_addition blocks
- Emit Responses additional_tools items for mid-conversation tool_addition blocks in ConvertClaudeRequestToCodex while preserving top-level tools and tool-result adjacency.
- Include inline tool_addition definitions in Codex short-name bidirectional maps and merge them into top-level tools for OpenAI Chat Completions requests.
- Add regression tests covering inline tool definitions, tool references, deferred tool-result ordering, long MCP tool name round-tripping, and JSON escape handling.

Closes: #7112
2026-10-30 08:30:40 +08:00
Luis Pater
514d09f746 feat(codex): guide recovery when automatic credential renewal becomes impossible
- Classify terminal Codex refresh grant failures (`refresh_token_reused`, `refresh_token_expired`, `refresh_token_invalidated`, `token_revoked`, `invalid_client`, `invalid_grant`, and HTTP 401) as non-retryable, track rejected outer and SIWC refresh tokens independently, and defer retry checks until `access_token` expiry while keeping valid access tokens available for inference.
- Expose structured renewal states, recovery stages, sanitized refresh diagnostics, targeted account-matching OAuth re-authentication (`POST /v8/management/oauth/auth-url`), and pinned inference verification (`POST /v8/management/credentials/verify`) across Management API v8 and the TUI.
- Add unit and workflow regression tests covering terminal vs. transient refresh handling, per-partition SIWC/outer isolation, incomplete stream rejection, quota cooldown preservation, and secret redaction.

Closes: #5783
2026-10-30 07:06:33 +08:00
Luis Pater
f013eb662a fix(openai): keep incomplete streams without [DONE] out of credential cooldown
- Mark locally synthesized missing-[DONE] stream errors as stream-truncated in OpenAICompatExecutor so auth cooldown and cross-credential replay are skipped while preserving the 502 error.
- Add regression tests verifying that incomplete HTTP 200 OpenAI-compatible streams do not cool down credentials or exhaust the pool into auth_unavailable.

Closes: #5283
2026-10-30 02:29:35 +08:00
pusheaxpopebx
43068c8642 fix(auth): write the cooldown state next to the auth file when auth-dir is relative
With a relative auth-dir the file synthesizer records an auth file as
"<auth-dir>/<name>.json" (filepath.Join(ctx.AuthDir, name)), while
stateRelativePath stripped the auth dir only from absolute paths. The store,
rooted at the auth dir, then wrote "<auth-dir>/<auth-dir>/<name>.cds".
2026-10-29 21:06:56 +03:00
Dylan
8dfb45d2c6 Merge pull request #7106 from router-for-me/fix/responses-ws-deferred-logging
fix(logging): prevent deferred request retention on Responses WebSockets
2026-10-30 00:42:44 +08:00
Dylan
4cb98e3ccd fix(logging): prevent deferred request retention on Responses WebSockets
Keep the error-only upstream request capture policy on the connection
context, before model routing and upstream execution begin. Check it before
accessing pooled Gin state so delayed plugin callbacks retain the policy
even after cancellation or Gin context reuse.

Preserve ordinary HTTP error capture, failed upgrade handling, and full
request logging. Cover large repeated requests, late callbacks, real
WebSocket logging, and Codex duplex routing with regression tests.

Related: #6960
2026-10-29 23:25:54 +08:00
Chén Mù
d30edd7f1e Merge pull request #7102 from router-for-me/aistudio
fix(home): restrict websocket access in home mode
2026-10-29 19:42:56 +08:00
hkfires
265ca17983 Merge pull request #7095: reassemble AI Studio SSE frames 2026-10-29 19:29:28 +08:00
sususu98
eabcb1b76f Merge pull request #7074 from sususu98/feat/structured-usage-7054
feat(usage): capture structured upstream usage details across Anthropic, xAI, OpenAI/Codex, and Gemini
2026-10-29 18:38:59 +08:00
sususu
82deffb9ca fix(usage): preserve output_item.done tool counts and multiline SSE usage 2026-10-29 15:57:38 +08:00
hkfires
a6b4477b4f fix(home): restrict websocket access in home mode
Skip registering the AI Studio websocket gateway in Home
mode since it is not supported there, and force websocket
authentication in the Home runtime config.
2026-10-29 15:48:45 +08:00
sususu
97dd3a4a2f fix(usage): preserve stream failure usage, multipart image params, and provisional zero search counters 2026-10-29 15:16:53 +08:00
sususu
d5eb4ca1d5 perf(usage): optimize stream usage observation and large payload parsing 2026-10-29 14:44:33 +08:00
sususu
bd5ec5310a feat(usage): capture structured Gemini, Vertex, AI Studio, and Antigravity usage 2026-10-29 14:44:33 +08:00
sususu
01551f5f6b feat(usage): capture structured OpenAI and Codex usage across responses, chat, and images 2026-10-29 14:42:21 +08:00
sususu
24840fddf8 feat(usage): capture structured xAI usage across chat, responses, and media 2026-10-29 14:40:08 +08:00
sususu
89e472f325 feat(usage): capture structured Anthropic Messages upstream usage details 2026-10-29 14:39:43 +08:00
Kayokoi
498170a49c fix(aistudio): add relay SSE frame reassembly helper 2026-10-29 12:34:51 +08:00
Kayokoi
7df437c822 fix(aistudio): buffer fragmented relay SSE frames 2026-10-29 12:32:47 +08:00
sususu98
56efc81fa5 Merge pull request #7092 from sususu98/fix/slow-test-disconnect
Fix WebSocket disconnect test and Devin diagnostics
2026-10-29 09:58:15 +08:00
sususu
02ee313962 fix(devin): classify JSON control character errors 2026-10-29 09:46:47 +08:00
sususu
fa42f390c1 test(openai): assert websocket disconnect error event 2026-10-29 09:36:31 +08:00
Luis Pater
90c447d3a8 fix(responses): use tsc_ item id prefix for Gemini tool search calls
- Update the Gemini OpenAI Responses tool search call item ID prefix from ts_ to tsc_ so replayed search items pass Codex upstream validation after switching models.
- Normalize legacy ts_ and unprefixed tool_search_call item IDs in SanitizeCodexInputItemIDs on outbound Codex requests while preserving call_id and avoiding ID collisions.

Closes: #7084
v8.0.47
2026-10-29 07:03:21 +08:00
Luis Pater
3f2b8f2815 Merge pull request #7082 from nia-teams-admin/docs/add-nia-live-demo
docs(readme): add Nia Live Demo to "Who is with us?"
2026-10-29 03:25:06 +08:00
Nia Teams
535110e109 docs(readme): add Nia Live Demo to "Who is with us?" 2026-10-28 15:09:37 +00:00
Luis Pater
0fe38224e5 feat(pluginhost): support raw request body byte-range patching
Existing request interceptors wrap the full request body in a JSON RPC envelope with Base64 encoding and skip subsequent duplex WebSocket business frames, causing ~3.33x memory and CPU amplification when rewriting small fields such as Codex `<timezone>` and `<current_date>` in large contexts.

- Add schema v8 raw request body patch methods (`request.patch_body_before` and `request.patch_body_after`) and capabilities (`request_interceptor_patch_body_before/after`, `request_body_patcher_before/after`) that pass raw `Body []byte` directly across the C ABI without JSON/Base64 request wrapping
- Add `RequestBodyEdit`, `RequestBodyPatchResponse`, and `RequestBodyPatcher` in `sdk/pluginapi` with single-pass host splicing, bounds/overlap validation, `json.Valid` verification, no-op original body reuse, and sequential multi-plugin chaining
- Eliminate redundant full-body slice clones in handler/conductor request interceptor application paths
- Run before-auth and after-auth request interceptors on subsequent duplex WebSocket `response.create`, `response.append`, and `response.steer` messages

Closes: #7072
2026-10-28 21:38:42 +08:00
Luis Pater
e324e4814c perf(pluginhost): allow frontend auth providers to opt out of request body delivery
- Let schema v7+ frontend auth providers opt out of receiving request bodies via frontend_auth_provider_omit_body / frontend_auth_omit_body so metadata-only auth plugins skip reading, decoding, cloning, and marshaling the request body during authentication.
- Avoid cloning the buffered request body slice before JSON serialization when invoking RPC-backed frontend auth providers that still inspect the body.

Closes: #7071
2026-10-28 20:42:52 +08:00
Luis Pater
9717e325ba fix(responses): reject late websocket interrupts after terminal events
- Track the running response identity in the Codex websocket session and reject interrupts that do not target it, so an interrupt after response.completed is never forwarded upstream while turn teardown is pending.
- Gate the handler's local interrupt path by explicit turn ownership and close it before terminal payloads are written downstream, preventing fabricated response.incomplete events and silently dropped claimed frames.
- Add deterministic regression tests covering late and unknown interrupts across completion, failure, queued rejection, upstream loss, and HTTP fallback turns.

Closes: #7065
v8.0.46
2026-10-28 18:33:51 +08:00
Luis Pater
ae65e26df2 feat(api): filter private metadata in OpenAI responses and improve SSE framing recovery
- Filter out internal metadata events such as moderation data for standard clients in OpenAI responses API and websocket streams.
- Enhance `responsesSSEFramer` and frame accumulator to robustly handle fragmented JSON payloads, empty data fields, and recovery of split SSE fields.
- Add comprehensive unit tests covering SSE metadata filtering, fragmented frame recovery, and websocket message handling.
2026-10-28 16:33:13 +08:00
Luis Pater
f7342c3838 Merge pull request #6970 from soulmachine/responses-drop-metadata-non-codex 2026-10-28 11:36:03 +08:00
Luis Pater
a3e76891b1 refactor(api): reuse response compression encoders and add tests 2026-10-28 10:31:07 +08:00
Luis Pater
f6ee1e64d8 Merge pull request #7022: reuse response compression encoders 2026-10-28 10:21:43 +08:00
Luis Pater
58874f3bf3 feat(registry): index web-search support 2026-10-28 08:24:41 +08:00
Luis Pater
e30575dc77 Merge pull request #6995: index web-search support 2026-10-28 08:00:16 +08:00
JohnsonRan
12f2cafe33 test(api): measure open-stream heap with empty encoder pools
BenchmarkResponseCompressionOpenStreams took its baseline after one GC,
which only moves pooled encoders to the sync.Pool victim cache. Streams
then reused memory the baseline already counted, so heap per open stream
collapsed toward zero once b.N > 1. Run two GC cycles before the baseline
so every sample starts with empty pools.

TestResponseCompressionReusesPooledEncoders now counts encoder creations
and fails when finished encoders are not returned to the pool. It also
interleaves responses whose client writes fail, so an encoder pooled
after an error must still produce correct output.
2026-10-28 04:08:45 +09:00
JohnsonRan
16c6b4bd8c perf(api): reuse response compression encoders with a smaller zstd window
Every compressed response created a new encoder: zstd with its default
8 MiB window allocated about 18 MB, gzip about 1 MB, and an open SSE
stream held that for its whole life. Pool zstd and gzip encoders, and
give zstd a 1 MiB window with lower encoder memory; API responses are
far smaller than the window, so the wire size is unchanged. finish now
returns the encoder to the pool and fails later writes instead of
sending them uncompressed under Content-Encoding.
2026-10-28 03:51:21 +09:00
Luis Pater
65889d39f0 test: update tests for default template changes and environment compatibility
Closes: #7059
2026-10-28 02:34:39 +08:00