Commit Graph

273 Commits

Author SHA1 Message Date
Luis Pater
57d005fe6c fix(codex): strip out-of-range int64 numeric bounds from tool schemas
Closes: #6579
2026-10-14 03:45:14 +08:00
Luis Pater
7795de19ca feat(sse): implement CodexSSEScanner for improved event data handling
Closes: #6575
2026-10-14 02:54:02 +08:00
Luis Pater
51952a7b2f feat(httptransport): add request-scoped HTTP transport decorator
- Introduce `sdk/httptransport` package with `Decorator`, `WithDecorator`, `WithoutDecorator`, `InheritDecorator`, and `Decorate` functions.
- Propagate transport decorators from incoming HTTP request contexts in `BaseAPIHandler.GetContextWithCancel`.
- Apply transport decoration after client transport selection across proxy-aware, Devin, uTLS, and Antigravity HTTP clients.

Closes: #5616
2026-10-13 13:01:12 +08:00
Luis Pater
a27183143e fix(antigravity): drop trailing thought-only model turns
Closes: #6530
2026-10-11 20:45:18 +08:00
Luis Pater
15d2148bc2 fix(gemini): ensure trailing user turn for function response with media
Closes: #6524
2026-10-11 17:58:34 +08:00
Luis Pater
29bd0415b9 fix(claude): pin upstream.claude.tool-search per request 2026-10-11 14:21:00 +08:00
Luis Pater
48ad3487b2 feat(executor): add Responses tool_search strip and legacy model helpers 2026-10-11 11:01:28 +08:00
Luis Pater
37fe2608ee feat(usage): propagate access provider and native key metadata to usage records
- Inject API key, access provider, and native key flags into the request context during authentication
- Add `IsNativeKey` and `AccessProvider` fields to usage records, plugin API types, and redis queue payloads
- Provide context helper functions and automatic fallback resolution in the usage manager and reporter

Closes: #6509
2026-10-10 22:16:00 +08:00
Luis Pater
e9c8769a7a fix(executor): normalize and restore non-portable tool call IDs
- Normalize tool use and tool result IDs in Claude message payloads to adhere to character constraints
- Encode non-portable tool call IDs in Devin executor responses and restore original IDs before request construction

Closes: #6478
2026-10-09 19:44:24 +08:00
Luis Pater
2bc236d2fc feat(claude): support responses compaction in claude executor
- Handle compaction trigger requests by generating summaries and sealing antigravity compaction capsules
- Expand replayed compaction capsules into message history before translation and filter foreign compaction items
- Preserve tool definitions with `tool_choice: none` or flatten tool blocks when tool definitions are missing
- Support streaming compaction execution and map cache creation and read token usage

Closes: #6466
2026-10-09 03:24:45 +08:00
Luis Pater
8080967991 fix(claude): ignore overage billing resets in unified rate limit parsing
- Ignore unified reset timestamps matching overage reset boundaries to prevent cooling down credentials until monthly billing reset
- Filter candidate rate limit deadlines exceeding the 7-day window limit
- Treat rejected overage claims with absent or healthy shared utilization as model-scoped rejections

Closes: #6465
2026-10-08 22:14:59 +08:00
Luis Pater
2d5351b3e5 feat(vertex): add support for native gemini interactions api
- Extract shared Gemini Interactions helpers for payload translation, input sanitization, thinking, and SSE streaming
- Add `interactions` configuration option to Vertex credentials
- Support native non-streaming and streaming Interactions API execution in Gemini Vertex executor

Closes: #6445
2026-10-08 12:39:31 +08:00
Luis Pater
0f96f568e4 refactor(translator): update openai and interactions request converters to return errors
- Update OpenAI and OpenAI Responses to Interactions request converters to return `([]byte, error)`
- Register request converters directly in internal translator registry instead of sdktranslator checked requests
2026-10-08 03:00:04 +08:00
Luis Pater
34e73c75a3 fix(xai): add proxy support and semver validation to Grok CLI updater
- Pass configured proxy URL to the npm registry updater client
- Validate fetched versions against strict semver and minimum server version floor (`1.0.13`)
- Update default fallback client version to `1.0.46`
- Manage background updater lifecycle and context via service lifecycle initialization
2026-10-08 02:39:32 +08:00
Luis Pater
298649f677 Merge pull request #6446 from jellyfish-p/feat/grok-cli-dynamic-version
feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
2026-10-08 02:30:27 +08:00
Luis Pater
f51624aa35 fix(translator): report unsendable user turn attachments in openai responses to interactions
- Track dropped attachments and reject emptied user turns during OpenAI Responses to Interactions translation
- Register checked request translator for OpenAI Responses to Interactions format conversion
2026-10-08 02:11:20 +08:00
Jellyfish
90654da573 feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
- Fetch latest @xai-official/grok client version from npm registry on startup
- Periodically refresh Grok CLI version every 3 hours without multiple retries
- Update hardcoded fallback version to 1.0.50 if npm registry is unreachable
- Dynamically inject active version into x-grok-client-version and User-Agent headers
2026-10-08 00:59:27 +08:00
이대희
3b69068e6c fix(translator): stop dropping attachments and empty turns
An attachment a translator could not represent was dropped without a word, and
a turn whose only content was that attachment went upstream as an empty
messages, parts, or input array. The model then answered as if nothing was
attached, or the upstream rejected a request that never named the attachment.

A base64 document now reaches OpenAI as a file part. A file the target cannot
receive, such as container_upload, an OpenAI file_id, or input_audio sent to
Claude, is reported by name so the route answers 400 instead of forwarding an
empty turn. Text beside it still travels.

One rule, ErrIfNothingLeft, decides when to refuse, and RegisterCheckedRequest
carries the refusal on the request envelope. Every executor that translates
checks it before calling upstream. The exported converters keep their []byte
signature, so no caller or sibling test had to change.
2026-10-07 19:21:32 +09:00
Luis Pater
57bde35179 fix(executor): preserve upstream usage on apply patch failures
- Buffer and publish observed upstream usage when apply patch transformation or translation encounters an error in Meta and xAI executors
- Add stream usage buffer helpers to report failure metrics with captured upstream token usage

Closes: #6427
2026-10-07 09:31:03 +08:00
Luis Pater
0ea4e1dcb4 fix(openai): complete responses stream on clean EOF after finish reason
- Track pending completion state in OpenAI-to-Responses translator when item output is complete and a finish reason is received
- Synthesize terminal `[DONE]` event on clean EOF when response completion is pending instead of failing the stream

Closes: #6381
2026-10-05 15:55:38 +08:00
hkfires
611ebba415 refactor(executor): unify model reporting and replay logs
Replace Codex-specific response model APIs with shared model observation and remove redundant substitution warning throttling. Consolidate repeated Antigravity context-hash rejection messages into a single request-level log while preserving rejection details across index rebuilds.
2026-10-05 11:10:54 +08:00
Luis Pater
cbc4cd5532 feat(interactions): support antigravity session continuation and model detail lookup
- Add `InteractionsSessionCache` to preserve Antigravity interaction continuations across tool call rounds
- Automatically restore and inject `previous_interaction_id` and `environment_id` in Gemini interactions executor
- Normalize Antigravity tool identity mappings in OpenAI responses translator
- Add `/v1/models/*model` endpoint to support retrieving individual model details

Closes: #5190
2026-10-04 04:23:31 +08:00
Luis Pater
868e137f6c feat(payload): introduce payload finalizer for protobuf and multipart requests
- Add `PayloadFinalizer` to apply configuration rules at the final serialization barrier
- Support decoding, modifying, and re-encoding Devin protobuf business fields
- Add multipart form-data payload normalization to JSON for media payload rules

Closes: #5067
2026-10-04 03:01:34 +08:00
Luis Pater
5dbce4f3fb perf(claude): prefilter JSON payloads before diagnostic walks
- Add ASCII pre-filter to skip expensive gjson traversals for title helper and 1h TTL checks
- Check raw bytes for target keywords before initiating full JSON walks
- Fall back to full inspection when printable ASCII Unicode escapes are detected

Closes: #6291
2026-10-03 10:48:07 +08:00
Luis Pater
6d57ac9087 fix(claude): pin session date in cloaked reminder to prevent prompt cache invalidation
- Pin local date to continuity context on the first request of a session
- Reuse pinned session date during cloaked date injection across execute and stream flows
- Prevent midnight calendar date flips from invalidating conversation prompt cache prefixes

Closes: #6282
2026-10-03 00:28:35 +08:00
sususu
d7c3c0aaaa feat(antigravity): trace upstream connection reuse in debug logs 2026-10-02 22:13:24 +08:00
Luis Pater
8fbf152b5b fix(executor): preserve top-level responses token usage when service tier is present
- Fall back to top-level token usage when Codex response usage contains only service tier metadata
- Propagate parsed service tier while retaining top-level token counts
- Avoid early return during stream usage observation for chunks with zero token counts

Closes: #6261
2026-10-02 16:01:23 +08:00
hkfires
cf3102cc03 refactor(executor): optimize translation logic and improve plugin invocation handling 2026-10-02 10:58:36 +08:00
Luis Pater
3ebee06516 fix(interactions): bridge apply_patch tool calls in responses translation
- Handle apply_patch custom tool call streaming deltas and snapshots for Responses API translation
- Track and resolve step indexes, function call identities, and error states across stream events
- Propagate apply_patch tool input errors and upstream failure states in stream and non-stream responses
2026-10-02 03:49:51 +08:00
Luis Pater
97f244b8dd fix(codex): pass target executor to compatibility translation and token counting
- Pass target executor identity during Codex token counting and xAI request translation
- Skip tool integer normalization when target executor is Codex during compatibility translation
- Preserve number types in tool parameter schemas during token counting requests
2026-10-01 03:06:59 +08:00
Luis Pater
67cb32b6d3 fix(codex): determine tool integer normalization by target executor identity
- Base tool integer normalization checks strictly on target executor identity rather than protocol
- Add executor-aware translation helpers to pass target executor identity during request translation
- Ensure non-Codex executors normalize tool integer types for Codex clients regardless of protocol
2026-10-01 02:26:02 +08:00
Luis Pater
a8ffd5a843 fix(codex): skip tool parameter integer normalization for codex executor targets
- Skip normalizing tool parameter number types to integer when the target executor is Codex or Codex WebSocket
- Remove tool integer type normalization from schema cleanup in native Codex execution paths to preserve reserved tool schemas
- Apply tool integer type normalization only for non-Codex upstream targets with Codex client User-Agents

Closes: #6244
2026-10-01 02:04:49 +08:00
Luis Pater
82f8e92b21 fix(executor): support negotiated ALPN protocols in uTLS client
- Select HTTP/2 or HTTP/1.1 transport dynamically based on TLS ALPN negotiation
- Route empty ALPN and HTTP/1.1 requests through a dedicated non-pooled transport reusing the handshaken connection
- Ensure uTLS connections are cleanly closed upon response completion or request failure

Closes: #6223
2026-10-01 00:47:24 +08:00
Luis Pater
e5b5a1cfca fix(kimi): reorder interleaved tool outputs in responses input
- Defer intervening non-tool messages until all batch tool outputs are emitted to keep outputs contiguous
- Apply responses input normalization across standard and streaming executor execution paths

Closes: #6231
2026-09-30 23:39:28 +08:00
Luis Pater
71a5f1f6c5 fix(codex): normalize tool parameter number types to integer for codex clients
- Detect Codex client requests via User-Agent and convert target numeric parameters to integer types
- Support schemas across OpenAI functions, Claude input schema, Gemini declarations, and namespace tools
- Apply normalization during executor payload processing, multi-agent request translation, and WebSocket streaming

Closes: #6237
2026-09-30 22:27:18 +08:00
hkfires
d3cd466ddb fix(codex): use resolved compat for multi-agent v2 2026-09-28 19:03:22 +08:00
hkfires
b9971ee3df feat(sdk): add Home credential capabilities and quota APIs
Use Home credential options as authoritative model capability
configuration for compat handling and prompt cache behavior.

Expose quota provider operations through the public plugin host API.
2026-09-28 19:03:21 +08:00
Luis Pater
2c27e61fe7 fix(meta): strip unsupported search_content_types from web search tools
- Add `SanitizeMetaWebSearchTools` to remove `search_content_types` from `web_search` tool definitions
- Support sanitizing nested tools within `namespace` tool definitions
- Apply web search tool sanitization during Meta request preparation

Closes: #6156
2026-09-27 22:54:19 +08:00
Luis Pater
31f4cfab3f feat: migrate CLIProxyAPI to version 8 2026-09-27 14:42:26 +08:00
hkfires
d9922f0589 feat(config): add v8 configuration API
Introduce the v8 management configuration tree with migration-aware reads and
writes, grouped upstream API-key providers, and independent v8 operational
routes.

Preserve legacy configuration compatibility while ensuring successful v8 writes
migrate layouts, redact JSON TURN secrets, and keep OAuth-only provider
settings from affecting API-key credentials.
2026-09-27 14:16:27 +08:00
Luis Pater
6dea3dfa13 fix(antigravity): extract and apply reasoning summary config for OpenAI responses
- Use `ExtractSummaryConfig` to parse summary configuration from OpenAI response payloads
- Default to enabled auto summaries when reasoning effort is set without explicit summary visibility
- Apply the resolved summary configuration directly to Antigravity translations

Closes: #6143
2026-09-27 02:35:18 +08:00
Luis Pater
fc2c98d1ca feat(runtime): enhance Devin model aggregation and UID normalization
- Implement `splitDevinUID` for consistent UID splitting and effort extraction.
- Update model aggregation to handle thinking levels and merge variants.
- Refine display name cleaning logic to remove redundant suffixes.
- Adjust Devin catalog integration to exclude exposed thinking variants.
- Normalize and sort thinking levels with an extended rank scheme.

Closes: #6141
2026-09-27 02:03:55 +08:00
Luis Pater
3b2882b72e fix(codex): strip non-standard multi-agent metadata for compat models
- Pass compat mode flag to multi-agent v2 input rewriting
- Proactively remove `author`, `recipient`, and internal passthrough metadata for compat models
- Allow stripping non-standard metadata even when multi-agent v2 optimization is disabled

Closes: #6136
2026-09-26 22:51:47 +08:00
Luis Pater
ed980be34b fix(auth): preserve resolved model capabilities and configuration update support
- Attach resolved execution model info during execution and token counting even when restoring execution models
- Propagate configuration update support to resolved Home dispatch model info
- Track modifications to configuration updates across plugin normalizers in the translation pipeline
- Mark configuration update support for eligible Codex models in the registry
2026-09-26 13:57:06 +08:00
Luis Pater
4332048dda fix(claude): apply cloaking by default for direct Messages OAuth requests
- Remove direct Messages passthrough bypass for unconfirmed OAuth credentials
- Ensure standard cache control handling and CLI fingerprinting apply upstream
- Support detection for Claude Code 2.1.280 title helper payload shape

Closes: #6120
2026-09-25 12:38:18 +08:00
sususu98
f7c738dad3 fix(claude): align 2.1.280 fingerprint and thinking visibility (#6096)
* fix(claude): align Opus 5.5 cloak and preserve native CLI hints

* fix(claude): recognize the 2.1.280 Haiku title helper

The native title request now appends server-side fallback, fallback credit,
and cache diagnosis after the structured-output beta. Keep the helper
allowlist exact so this sequence passes through without cloaking.

* fix(claude): align thinking visibility and Messages passthrough

* fix(claude): preserve thinking visibility through compatibility paths

* fix(claude): harden OAuth beta, session alignment, and 2.1.280 helper headers
2026-09-24 15:26:39 +08:00
Luis Pater
2fe9932bb9 feat(usage): track execution request ID and trace ID across usage records
- Add `RequestID` (unique execution UUID) and `TraceID` (inbound request ID) fields to usage records and plugin API
- Generate unique UUIDs per model attempt in `UsageReporter` while linking to parent trace context
- Expose `execution_id` and `trace_id` in Redis queue usage payloads while preserving legacy `request_id`
2026-09-23 19:31:39 +08:00
Luis Pater
779bf317e0 feat(claude): bump claude cli baseline to 2.1.280 and support tool changes beta
- Update default Claude CLI version to 2.1.280 in cloaking and device profile
- Add `mid-conversation-tool-changes-2026-07-01` beta header support for supported models

Closes: #6054
2026-09-23 05:07:49 +08:00
Luis Pater
320100ecf7 fix(codex): strip octal NUL pattern escapes from tool schemas
- Strip octal NUL (`\0`) escapes in regex patterns to prevent rejection by strict upstream JSON Schema validators
- Update tool schema normalization fast-path to check for serialized `\0` escape sequences

Closes: #6025
2026-09-22 18:25:48 +08:00
Luis Pater
639b7f1126 perf(executor): reuse identical Claude and Gemini request translations
Skip the second compatibility translation for Claude, Gemini, and Gemini
interactions when the baseline and working payloads share a backing array
and no plugin hooks are installed. Keep independent buffers, the existing
hook order, and native interactions copies.
2026-09-22 05:16:25 +08:00