Commit History
-
refactor codex websocket request normalization
shinmentakezo07197972f -
refactor(stream): harden forwarding and hook composition
shinmentakezo07 +1: Claude Opus 4.6Refactor stream forwarding to centralize option resolution and terminal completion handling, preventing closed error channels from spinning while preserving terminal-error precedence. Add reusable pipeline hook composition/round-tripper adapters and improve Codex provider compatibility by forwarding Codex hint headers and normalizing the reasoning_effort alias. - extracts stream forwarder helpers for keep-alive setup, terminal error draining, and finish behavior - adds regression tests for terminal error precedence/cancel behavior and hook composition utilities - forwards Codex hint headers and maps reasoning_effort to reasoning.effort for request normalization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>76d784c -
ein
shinmentakezo07d61c097
-
fix(responses): reject invalid SSE data JSON
Guard the openai-response streaming path against truncated/invalid SSE data payloads by validating data: JSON before forwarding; surface a 502 terminal error instead of letting clients crash with JSON parse errors.fa85de1 -
fix(openai): emit valid responses stream error chunks
Unverified signatureWhen /v1/responses streaming fails after headers are sent, we now emit a type=error chunk instead of an HTTP-style {error:{...}} payload, preventing AI SDK chunk validation errors.ff75938
-
test(handlers): add tests for passthrough headers behavior in WriteErrorResponse
Unverified signaturecfe9ff0 -
feat: add passthrough headers configuration
Unverified signature- Introduced `passthrough-headers` option in configuration to control forwarding of upstream response headers. - Updated handlers to respect the passthrough headers setting. - Added tests to verify behavior when passthrough is enabled or disabled.11fa176 -
fix: ensure connection-scoped headers are filtered in upstream requests
Unverified signature- Added `connectionScopedHeaders` utility to respect "Connection" header directives. - Updated `FilterUpstreamHeaders` to remove connection-scoped headers dynamically. - Refactored and tested upstream header filtering with additional validations. - Adjusted upstream header handling during retries to replace headers safely.0e32196
-
Merge PR #1626 into codex/pr-1626
Unverified signatureb3b7752 -
Merge pull request #1618 from alexey-yanchenko/fix/completions-usage
Unverified signatureFix empty usage in /v1/completions2710421 -
feat(logging, executor): add request logging tests and WebSocket-based Codex executor
Unverified signature- Introduced unit tests for request logging middleware to enhance coverage. - Added WebSocket-based Codex executor to support Responses API upgrade. - Updated middleware logic to selectively capture request bodies for memory efficiency. - Enhanced Codex configuration handling with new WebSocket attributes.6434782
-
feat: passthrough upstream response headers to clients
Kirill TuranskiyCPA previously stripped ALL response headers from upstream AI provider APIs, preventing clients from seeing rate-limit info, request IDs, server-timing and other useful headers. Changes: - Add Headers field to Response and StreamResult structs - Add FilterUpstreamHeaders helper (hop-by-hop + security denylist) - Add WriteUpstreamHeaders helper (respects CPA-set headers) - ExecuteWithAuthManager/ExecuteCountWithAuthManager now return headers - ExecuteStreamWithAuthManager returns headers from initial connection - All 11 provider executors populate Response.Headers - All handler call sites write filtered upstream headers before response Filtered headers (not forwarded): - RFC 7230 hop-by-hop: Connection, Transfer-Encoding, Keep-Alive, etc. - Security: Set-Cookie - CPA-managed: Content-Length, Content-Encoding409fbf7 -
Add usage to /v1/completions
b64e3a1
-
refactor(all): replace manual pointer assignments with `new` to enhance code readability and maintainability
Unverified signature2359a6f
-
feat: add Kimi authentication support and streamline device ID handling
Unverified signature- Introduced `RequestKimiToken` API for Kimi authentication flow. - Integrated device ID management throughout Kimi-related components. - Enhanced header management for Kimi API requests with device ID context.fc3bbab
-
refactor(translator, executor): remove redundant `bytes.Clone` calls for improved performance
Unverified signature- Replaced all instances of `bytes.Clone` with direct references to enhance efficiency. - Simplified payload handling across executors and translators by eliminating unnecessary data duplication.1b0fbba -
refactor(executor): optimize payload cloning and streamline SDK translator usage
Unverified signature- Replaced unnecessary `bytes.Clone` calls for `opts.OriginalRequest` throughout executors. - Introduced intermediate variable `originalPayloadSource` to simplify payload processing. - Ensured better clarity and structure in request translation logic.c702df8 -
refactor(util, executor): optimize payload handling and schema processing
Unverified signature- Replaced repetitive string operations with a centralized `escapeGJSONPathKey` function. - Streamlined handling of JSON schema cleaning for Gemini and Antigravity requests. - Improved payload management by transitioning from byte slices to strings for processing. - Removed unnecessary cloning of byte slices in several places.45239da
-
Merge pull request #1174 from lieyan666/fix/issue-1082-change-error-status-code
Unverified signaturefix: change HTTP status code from 400 to 502 when no provider available7466d53
-
Merge pull request #1248 from shekohex/feat/responses-compact
Unverified signaturefeat(openai): add responses/compact supportd7805f3
-
fix(logging): capture streaming TTFB on first chunk and make timestamps required
sususu98- Add firstChunkTimestamp field to ResponseWriterWrapper for sync capture - Capture TTFB in Write() and WriteString() before async channel send - Add SetFirstChunkTimestamp() to StreamingLogWriter interface - Make requestTimestamp/apiResponseTimestamp required in LogRequest() - Remove timestamp capture from WriteAPIResponse() (now via setter) - Fix Gemini handler to set API_RESPONSE_TIMESTAMP before writing response This ensures accurate TTFB measurement for all streaming API formats (OpenAI, Gemini, Claude) by capturing timestamp synchronously when the first response chunk arrives, not when the stream finalizes.935dde1
-
fix(logging): add API response timestamp and fix request timestamp timing
sususu98Previously: - REQUEST INFO timestamp was captured at log write time (not request arrival) - API RESPONSE had NO timestamp at all This fix: - Captures REQUEST INFO timestamp when request first arrives - Adds API RESPONSE timestamp when upstream response arrives Changes: - Add Timestamp field to RequestInfo, set at middleware initialization - Set API_RESPONSE_TIMESTAMP in appendAPIResponse() and gemini handler - Pass timestamps through logging chain to writeNonStreamingLog() - Add timestamp output to API RESPONSE section This enables accurate measurement of backend response latency in error logs.3ac39d4
-
feat(handlers): add test to verify no retries after partial stream response
Unverified signatureIntroduce `TestExecuteStreamWithAuthManager_DoesNotRetryAfterFirstByte` to validate that stream executions do not retry after receiving partial responses. Implement `payloadThenErrorStreamExecutor` for test coverage of this behavior.3e1e511
-
refactor: consolidate channel send logic with context-safe handlers
Unverified signatureOptimize channel operations by introducing reusable context-aware send functions (`send` and `sendErr`) across `wsrelay`, `handlers`, and `cliproxy`. Ensure graceful handling of canceled contexts during stream operations.1091995
-
fix(openai): drop stream for responses/compact
Shady KhalifaUnverified signature7e33f2b
-
feat(openai): add responses/compact support
Shady KhalifaUnverified signature8f7449a
-
Merge pull request #1132 from XYenon/fix/gemini-models-displayname-override
Unverified signaturefix(gemini): preserve displayName and description in models list0b4b8da -
fix(api): enhance ClaudeModels response to align with api.anthropic.com
Darley49638ce
-
fix: change HTTP status code from 400 to 502 when no provider available
Unverified signatureFixes #1082 When all Antigravity accounts are unavailable, the error response now returns HTTP 502 (Bad Gateway) instead of HTTP 400 (Bad Request). This ensures that NewAPI and other clients will retry the request on a different channel, improving overall reliability.7ca85a6 -
feat(executor): apply payload rules using requested model
hkfires69a5340
-
fix(gemini): preserve displayName and description in models list
XYenonPreviously GeminiModels handler unconditionally overwrote displayName and description with the model name, losing the original values defined in model definitions (e.g., 'Gemini 3 Pro Preview'). Now only set these fields as fallback when they are missing or empty.fea5337
-
feat(cliproxy, gemini): improve ID matching logic and enrich normalized model output
Unverified signature- Enhanced ID matching in `cliproxy` by adding additional conditions to better handle ID equality cases. - Updated `gemini` handlers to include `displayName` and `description` in normalized models for enriched metadata.90a9a3f -
refactor(gemini): replace static model handling with dynamic model registry lookup
Unverified signature04c0af8
-
refactor: improve thinking logic
hkfiresee9e572
-
refactor(config): replace `nonstream-keepalive` with `nonstream-keepalive-interval`
Unverified signature- Updated `SDKConfig` to use `nonstream-keepalive-interval` (seconds) instead of the boolean `nonstream-keepalive`. - Refactored handlers and logic to incorporate the new interval-based configuration. - Updated config diff, tests, and example YAML to reflect the changes.b052301 -
feat(api): add non-streaming keep-alive support for idle timeout prevention
Unverified signature- Introduced `StartNonStreamingKeepAlive` to emit periodic blank lines during non-streaming responses. - Added `nonstream-keepalive` configuration option in `SDKConfig`. - Updated handlers to utilize `StartNonStreamingKeepAlive` and ensure proper cleanup. - Extended config diff and tests to include `nonstream-keepalive` changes.d4889a8 -
fix(test): implement missing HttpRequest method in stream bootstrap mock
hkfires49e7313
-
feat(management): add `PostOAuthCallback` handler to token requester interface
Unverified signatured68a5ec
-
feat(api): add `GetAuthStatus` method to `ManagementTokenRequester` interface
Unverified signature5e60dc0
-
Merge pull request #761 from router-for-me/log
Chén MùUnverified signaturefix(logging): improve request/response capture8b0b717
-
feat(api): add ManagementTokenRequester interface for management token request endpoints
Unverified signature18d6aea -
fix(handlers): preserve upstream response logs before duplicate detection
hkfires927cccd -
fix(handlers): match raw error text before JSON body for duplicate detection
hkfires5fe686b -
fix(logging): improve request/response capture
hkfiresfbf97dc
-
fix(config): make streaming keepalive and retries ints
hkfires1ee4659
-
fix(test): remove extra argument from ExecuteStreamWithAuthManager call
Thai Nguyen Hung3bbbf02
-
feat(logging): implement request ID tracking and propagation
hkfires7df7bf2 -
refactor(handlers): streamline error and data channel handling in streaming logic
Unverified signatureImproved consistency across OpenAI, Claude, and Gemini handlers by replacing initial `select` statement with a `for` loop for better readability and error-handling robustness.c44e598
-
fix: keep streaming defaults legacy-safe
485ce54 -
fix: stop streaming loop on context cancel
22b9178