Commit Graph

3705 Commits

Author SHA1 Message Date
chaoshou
e026cbf4e9 fix(api): skip access logging for health probes 2026-09-08 18:41:38 +08:00
Luis Pater
20e3f731ea feat(auth): export helper functions for headless antigravity oauth
- Add `ExchangeAntigravityCode`, `FetchAntigravityUserInfo`, and `CompleteAntigravityOAuth` helpers for programmatic authentication.
- Introduce `BuildAntigravityAuthURL` and `AntigravityDefaultCallbackURI` to support custom and default redirect flows.
- Refactor Antigravity credential record assembly into `BuildAntigravityAuth`.

Closes: #5593
2026-09-08 18:22:01 +08:00
Luis Pater
1d5f7b2ac3 fix(auth): strip monotonic clock reading from quota cooldown deadlines
- Strip monotonic clock readings using `Round(0)` on calculated quota retry and recover deadlines.
- Ensure quota cooldown times rely on wall-clock timestamps across model and auth states.

Closes: #5590
2026-09-08 17:58:56 +08:00
sususu
6b187e778c feat(usage): normalize reported session hierarchy to canonical UUIDv8 2026-09-08 17:04:58 +08:00
sususu
390589159e feat(session): enhance harness hierarchy recognition and deduplicate selector extraction 2026-09-08 17:04:58 +08:00
Luis Pater
e365ab0cc9 fix(claude): map codex reasoning tokens to thinking tokens
- Extract `reasoning_tokens` from Codex response usage across streaming and non-streaming responses.
- Map valid non-negative reasoning tokens to `usage.output_tokens_details.thinking_tokens`.
- Clamp reasoning tokens to `output_tokens` and ignore invalid or negative values.

Closes: #5587
2026-09-08 12:17:37 +08:00
Luis Pater
48e5e9e03d fix(auth): cap refresh loop timer wait duration
- Cap the timer sleep duration to 30 seconds to wake promptly after system suspend.
- Factor out `nextWait` to clamp the maximum wait duration for scheduled credential refreshes.

Closes: #5584
2026-09-08 12:07:57 +08:00
Luis Pater
ef99119e57 fix(claude): enforce sequential content blocks for interleaved streaming tool calls
- Buffer text and thinking content arriving while a tool call block is currently open.
- Ensure tool calls are emitted and finalized sequentially to meet Anthropic content block constraints.
- Flush buffered interleaved content blocks after open tool calls are closed.

Closes: #5581
2026-09-08 11:40:16 +08:00
sususu
68dd99d56f fix(antigravity): include resolved pool settings in transport cache key
- Add shortMode, idleConnTimeout, and maxIdleConnsPerHost to antigravityTransportKey.
- Prevent stale transport reuse during hot-reload race windows under load.
- Add TestAntigravityTransportKeySeparatesPoolSettingsAcrossReload regression test.
2026-09-08 11:29:05 +08:00
Luis Pater
d4146bde12 feat(kimi): support openai responses api
- Route `openai-response` source format requests to dedicated streaming and non-streaming responses handlers.
- Add upstream URL resolution for Kimi Responses API endpoints based on auth attributes.
- Normalize `openai-response` provider format to codex during thinking parameter resolution.

Closes: #5400 #5571
2026-09-08 10:52:27 +08:00
이현민
35a4723872 fix(claude): attach helper request IDs according to the upstream base
2.1.258 attaches x-client-request-id only when the base URL is
api.anthropic.com. Since the helper check made this header optional, a
helper that arrived without one gained a freshly generated UUID on a
custom upstream. Attach it only for a first-party upstream or when the
caller actually sent one, and otherwise keep the header absent as the
real client would.
2026-09-08 10:34:05 +08:00
이현민
280b96acea fix(claude): align beta assembly and Haiku helper transport with the measured 2.1.258
advanced-tool-use-2025-11-20 is sent only while tool search or another
advanced tool-use feature is on the wire, or when the caller asks for it;
2.1.258 no longer attaches it to plain tool declarations (measured: 158
inline tools, no beta). A caller-supplied afk-mode-2026-01-31 is forwarded
between fast-mode and extended-cache-ttl and is an insertion boundary for
the advisor beta.

2.1.258 Haiku helpers offer the same full compression set as the main
thread and never send X-Stainless-Async. x-client-request-id is attached
only when the client's base URL is api.anthropic.com, so the helper
transport check accepts an empty value or a valid UUID and rejects only a
malformed one.
2026-09-08 10:34:05 +08:00
Luis Pater
dc21a42639 fix(antigravity): normalize gemini responseJsonSchema to responseSchema
- Translate `responseJsonSchema` and `response_json_schema` within `generationConfig` to `responseSchema` for Antigravity compatibility.
- Remove deprecated schema keys while preserving existing `responseSchema` fields.

Closes: #5570
2026-09-08 09:56:32 +08:00
Luis Pater
6e1f9ec4e0 fix(claude): default function parameters for tools without input schema
- Fall back to an empty object schema for `function.parameters` when Claude tool `input_schema` is omitted or null.

Closes: #5569
2026-09-08 09:47:47 +08:00
Supra4E8C
d198db54d4 fix(docs): remove Infistar.ai sponsorship details from README files 2026-09-08 09:28:59 +08:00
Luis Pater
ba7e55836d fix(codex): recognize retryable server errors for bootstrap failover
- Check `error.message` and `message` for retry advice on upstream `server_error` responses.
- Treat server errors indicating the request can be retried as eligible overload bootstrap failures.
v7.2.154
2026-09-08 03:49:10 +08:00
Luis Pater
bee20b9940 fix(codex): sanitize invalid tool name characters for upstream compatibility
- Replace characters outside `[a-zA-Z0-9_-]` with underscores during tool name shortening to meet Codex upstream requirements.
- Collect tool names across `tools` declarations, `tool_choice`, and assistant `tool_calls` history in requests to ensure consistent shortening and reverse restoration.

Closes: #5564
2026-09-08 02:53:30 +08:00
Luis Pater
03a054e32f fix(codex): recover omitted tool namespaces in openai responses
- Canonicalize omitted namespaces for unambiguous local tool calls across request and response conversions.
- Preserve exact emitted names and leave ambiguous tool candidates unmapped.

Closes: #5560
2026-09-08 02:09:01 +08:00
Luis Pater
d01516c120 fix(codex): explicitly default function tool strict to false
- Forward `strict` as `false` when omitted in function tools to prevent upstream Responses API from defaulting it to `true`.

Closes: #5555
2026-09-07 22:52:24 +08:00
Luis Pater
8696585cea fix(codex): preserve service tier and cache write tokens in openai responses
- Propagate upstream `service_tier` across streaming chunks and non-stream response bodies.
- Set both `cache_write_tokens` and `cached_creation_tokens` in prompt token details while preserving integer precision.
- Validate `cache_write_tokens` format and reject non-integer or malformed values.

Closes: #5543
2026-09-07 21:35:09 +08:00
Luis Pater
7871a5a978 fix(wsrelay): preserve queued frames during terminal message delivery
- Wait for channel buffer capacity instead of dropping queued frames when delivering terminal messages.
- Cancel pending requests with the appropriate cause if terminal delivery is interrupted by context cancellation or session closure.

Closes: #5535
2026-09-07 20:45:39 +08:00
Luis Pater
4f03809901 feat(claude): support structured output via system prompt instructions
- Build structured output prompt instructions for `json_object` and `json_schema` formats.
- Inject schema and JSON formatting instructions into Claude system blocks for chat completions requests.
- Support `text.format` and fallback `response_format` structured output for OpenAI Responses conversions.

Closes: #5533
2026-09-07 20:31:46 +08:00
Luis Pater
bf20b999de fix(codex): simplify complex tool schema unions and detect empty incomplete responses
- Normalize complex constant `oneOf` and `anyOf` tool parameter schemas into equivalent enums to prevent upstream aborts.
- Escape property keys containing dots and colons during schema updates to prevent invalid path splitting.
- Identify terminal `response.incomplete` events with zero output tokens and no content as upstream failures.

Closes: #5551
2026-09-07 20:09:29 +08:00
Luis Pater
f19d6da012 Merge pull request #5596 from sususu98/fix/issue-5494-antigravity-idle-conns
fix(antigravity): default to short connections and harden connection pool lifecycle (#5494)
2026-09-07 19:25:29 +08:00
sususu
d5397905f0 fix(antigravity): default to short connections and harden connection pool lifecycle (fixes #5494)
- Configure upstream connection pool under antigravity.connection-pool with enabled: false by default.
- In short connection mode, set MaxIdleConnsPerHost = -1 with DisableKeepAlives = false, ensuring immediate TCP termination after response body completion without leaking Connection: close request headers.
- When pooling is explicitly enabled (enabled: true), cap idle-conn-timeout at 210s (leaving a 30s safety buffer below Google Frontend's 240s Keep-Alive cutoff) and default max-idle-conns-per-host to 2 (bounded at 100).
- Refactor TransportCache to execute CloseIdleConnections outside the mutex lock during LRU eviction and matching closes.
- Proactively evict and close idle connections on 429 quota exhaustion across Execute, ExecuteStream, and CountTokens.
- Wire hot-reload diff detection and server reload purge hooks for graceful transport pool updates.
2026-09-07 19:15:39 +08:00
Luis Pater
82f4f370df fix(codex): restore dotted collaboration tool names in multi-agent v2
- Detect `collaboration-optimize.` tool conflicts during multi-agent v2 request optimization.
- Restore dot-prefixed tool calls back to the collaboration namespace and base tool name in responses.

Closes: #5524
2026-09-07 19:12:46 +08:00
Luis Pater
510c9c8fa5 fix(gemini): hide trailing text thought signatures from responses timeline
- Cache trailing thought signatures tied to visible assistant text to keep carriers off the client reasoning timeline.
- Restore and recombine cached text signatures when converting OpenAI Responses input requests back to Gemini.
- Fall back to detached carrier emission when signature caching fails or invariants are unmet.

Closes: #5513
2026-09-07 18:15:15 +08:00
Supra4E8C
934fb7928c feat: add link to Aiberm in sponsorship section of README files v7.2.153 2026-09-07 11:55:06 +08:00
Supra4E8C
4cd8ee7f4c feat: add Aiberm sponsorship information to README_JA.md 2026-09-07 11:53:25 +08:00
Supra4E8C
578ac8fdcf fix Aiberm sponser logo 2026-09-07 11:45:16 +08:00
Supra4E8C
63fd255090 feat: add Aiberm sponser 2026-09-07 11:34:23 +08:00
Luis Pater
d2f7122067 fix(claude): normalize codex agent messages in responses conversion
- Rewrite Codex multi-agent `agent_message` inputs into user `message` items to prevent dropping delegated task text.
- Convert `encrypted_content` parts into `input_text` content items.

Closes: #5510
2026-09-07 03:03:42 +08:00
Luis Pater
e92f6cf557 fix(antigravity): enable thinking summary when responses reasoning effort is set
- Enable Antigravity thinking summary by default when OpenAI Responses requests specify reasoning effort without an explicit summary configuration.
- Ensure `includeThoughts` is populated so thinking effort produces visible thoughts downstream.

Closes: #5508
2026-09-07 02:51:42 +08:00
Luis Pater
1c22598d0b fix(auth): preserve active cooldown deadlines on subsequent failures
- Ensure subsequent failure updates only extend and do not shorten active model-level or credential-level retry deadlines.
- Retain longer per-model retry deadlines when propagating credential-scoped quota failures across sibling models.
- Avoid promoting sibling non-quota retry deadlines into quota recovery states during credential failure propagation.
- Reflect credential-wide cooldowns in client model projections when no per-model states exist.

Closes: #5501
2026-09-07 02:34:39 +08:00
Luis Pater
a76da71154 fix(antigravity): omit tools when tool_choice is none
- Remove or skip emitting `request.tools` across Claude, OpenAI, and Interactions translators when `tool_choice` is set to `none`.
- Support object format `{"type": "none"}` for `tool_choice` in OpenAI chat completions.
- Skip interleaved thinking hint injection in Claude requests when tools are disabled via `tool_choice`.

Closes: #5485
2026-09-07 01:17:11 +08:00
Luis Pater
8564142fb0 fix(claude): preserve non-result block positions during tool result alignment
- Maintain non-tool-result content blocks at their original indices in `AlignClaudeToolResults` instead of moving them after results.
- Reorder tool results in-place into their original slot indices based on preceding tool use IDs.

Closes: #5484
2026-09-07 01:09:18 +08:00
Luis Pater
5dc428f392 fix(gemini): append trailing user turn for requests ending with model content
- Ensure Gemini, AI Studio, Vertex, and Antigravity requests end with a user turn to prevent upstream errors when trailing with model content.
- Preserve trailing turns that contain a function response and skip trailing adjustments for `countTokens` actions or Claude models.
- Introduce boundary normalization helpers to validate both leading and trailing turn roles.

Closes: #5358
2026-09-06 23:41:12 +08:00
Luis Pater
0e85eb46f3 fix(xai): support compaction fallback from payload input or previous response id
- Fall back to request payload input items or `previous_response_id` during websocket compaction when transcript snapshot is empty.
- Preserve `previous_response_id` in prepared request body for xAI execution.

Closes: #5205
2026-09-06 22:16:06 +08:00
Luis Pater
70f4560452 feat(antigravity): add conversation compaction support and capsule encryption
- Add payload detection and preparation helpers for compaction triggers and summary generation.
- Implement AES-GCM sealing and unsealing to store and restore opaque compaction capsules across turns.
- Support expanding compaction capsules into developer context for downstream turns.
- Provide summary text extraction across Gemini, Claude, and OpenAI response formats.
- Add builders for compaction non-stream JSON responses and SSE stream frames.

Closes: #5094
2026-09-06 21:51:47 +08:00
Luis Pater
00c63a5669 feat(pluginhost): expose outbound HTTP wire profile to plugin requests
- Add HTTPWireProfile to sdk/pluginapi on HTTPRequest with wire_profile JSON tag
- Decode wire_profile in host callbacks for flat and nested RPC payloads
- Match header casing in httpwire ordered_conn and allow non-HTTP handshakes
- Apply wire profile settings (HTTP/1.1 enforcement, auto compression disable, header ordering) in plugin host HTTP client
- Preserve proxy configuration, custom TLS dialers, redirect handling, and connection lifecycle

Closes: #5062
2026-09-06 20:41:58 +08:00
Luis Pater
fa01468e95 perf(auth): optimize scheduler result updates with targeted model shards
- Add `upsertAuthResult` to incrementally update only affected model shards after request completion.
- Cache supported model sets per auth using registry epoch tracking to avoid redundant lookups.
- Preserve full shard synchronization for auth lifecycle events and credential-scoped results.

Closes: #5061
2026-09-06 16:42:59 +08:00
Luis Pater
c76dfd4e0e chore(codex): update codex user-agent to 0.153.3
- Update default Codex executor user-agent and model override headers to `codex-tui/0.153.3`.

Closes: #5521
v7.2.152
2026-09-06 15:27:15 +08:00
sususu
580df36423 feat(usage): propagate session and parent session hierarchy to usage reporting queue
- Reuse coresession.ExtractSessionInfo across HTTP headers and request payloads to unify canonical session prefix namespaces with the scheduler.
- Extract hierarchical session identities in two phases: initial extraction from request headers on entry, and authoritative deep extraction once request payloads and metadata are available.
- Support Claude Code multi-level subagents (X-Claude-Code-Agent-Id, metadata.agent_id) and Codex thread fork lineages.
- Propagate SessionID and ParentSessionID across ClientRequestMetadata, UsageReporter, and coreusage.Record without root_session_id.
- Include session_id and parent_session_id in queuedUsageDetail for Home LPushUsage forwarding and Redis consumption with self-loop guards.
- Add comprehensive test coverage for canonical headers, body extraction, ghost parent elimination, and self-referential loop guards.
2026-09-06 10:45:32 +08:00
Luis Pater
5ab0bca040 fix(codex): scope usage limit errors to credentials and parse flexible quota resets
- Mark Codex usage limit errors as credential-scoped across HTTP and WebSocket executors.
- Support both top-level and nested error structures with case-insensitive matching when parsing retry-after resets.
- Propagate prevalidated candidate context to session affinity and built-in selectors during auth selection.

Closes: #5529
2026-09-06 06:20:20 +08:00
Luis Pater
7c2f6ce0d1 fix(claude): avoid mid-conversation system splicing for advisor calls or results
- Detect advisor tool calls and advisor results in conversation history.
- Preserve forwarded system prompt blocks in top-level system instead of splicing them into message turns or prepending reminders.
- Prevent message index shifts that break layout bindings for encrypted advisor results and trigger upstream 400 errors.

Closes: #5470
2026-09-06 05:55:42 +08:00
Luis Pater
084f25c798 fix(watcher): preserve concurrent file updates during auth snapshot rescans
- Track auth revisions and file observations to detect changes that occur while background auth scans are in flight.
- Invalidate and drop stale scanned auth records in `refreshAuthState` when concurrent file modifications or deletions are observed.
- Reject out-of-order delayed snapshot updates in `dispatchAuthUpdates` using watcher-local revision counters.

Closes: #5528
2026-09-06 05:36:32 +08:00
Luis Pater
9dfddd613d fix(aistudio): normalize thinking level to uppercase
- Normalize `generationConfig.thinkingConfig.thinkingLevel` to canonical uppercase enum values (`MINIMAL`, `LOW`, `MEDIUM`, `HIGH`).
- Prevent upstream HTTP 400 invalid argument errors caused by case-sensitive validation.

Closes: #5481
2026-09-06 04:14:41 +08:00
Luis Pater
31ec43621b chore(models): remove gpt-5.4 and gpt-5.4-mini models
- Remove `gpt-5.4` and `gpt-5.4-mini` specifications from registry models.
- Remove deprecated `gpt-5.4` configuration from Codex client models.
2026-09-06 03:56:06 +08:00
Luis Pater
5208aec703 fix(codex): preserve empty supported_reasoning_levels array
- Retain `supported_reasoning_levels` as an empty array instead of deleting the key when no reasoning levels are supported or compatible.
- Continue deleting `default_reasoning_level` when reasoning levels are empty.
v7.2.151
2026-09-05 04:01:25 +08:00
Luis Pater
c77b136943 feat(models): add gpt-6-astra model and update codex client configurations
- Add `gpt-6-astra` model specifications and capabilities to registry models.
- Update Codex client models configuration and instructions for `gpt-6-astra`.
- Bump default Codex client version and user-agent to `0.153.3` in model fetcher tool.
v7.2.150
2026-09-05 03:35:14 +08:00