28 Commits

Author SHA1 Message Date
hkfires
9a2201c36a fix(auth): forward Home unauthorized upstream errors
Stop refreshing Home-owned OAuth credentials after upstream 401s.
Preserve marked upstream response bodies for direct responses, usage
records, request logs, and websocket handshake failures.
2026-08-29 12:50:44 +08:00
Luis Pater
1cc72b9d13 fix(codex): filter extended reasoning levels for older client versions
- Filter `max` and `ultra` reasoning effort levels for Codex client versions prior to `0.144.0`.
- Extract and forward the `client_version` query parameter across model catalog response handlers.
- Add dotted version parsing and comparison utilities to verify extended reasoning level compatibility.

Closes: #5262
2026-08-27 16:51:33 +08:00
Chén Mù
48d021813b Merge pull request #4994 from router-for-me/models
feat(models): add max_completion_tokens to model definitions and responses
2026-08-15 16:39:30 +08:00
hkfires
046b59ecc5 feat(models): add max_completion_tokens to model definitions and responses 2026-08-15 16:27:57 +08:00
Luis Pater
98c98d66be fix(codex): cache multi-agent spawn-agent model data and invalidate on updates
- Add registry generation tracking and a Codex catalog revision accessor to provide stable cache keys.
- Cache parsed model templates and rendered spawn-agent markdown, and reuse them across requests when revision/generation are unchanged.
- Invalidate/recompute caches when model registrations or catalog content change, and separate rewrite handling for spawn tool descriptions vs. message encryption stripping.

Closes: #4967
2026-08-15 03:49:56 +08:00
Luis Pater
db35b91e2a feat(openai): add xAI Grok Imagine Image 2.0 image model support
- Added `grok-imagine-image-2.0` as a first-class xAI image base model across validation, canonicalization, and routing checks.
- Registered the model in built-in model definitions so it appears in model metadata.
- Updated image model allowlists and request validation error messaging to include the new model.
- Marked the new model as hidden in client visibility override handling.
2026-08-13 14:37:29 +08:00
Luis Pater
b08fe3b492 fix(codex): preserve multi-agent-v2 namespace handling across incremental websocket turns
Closes: #4909
2026-08-12 15:04:17 +08:00
Luis Pater
bd34ceca04 feat(codex): add realtime hangup forwarding and local client-secret support
- Add Codex live handlers for unsupported translation/transcription/SIP endpoints, returning standardized `realtime_capability_not_supported` errors.
- Implement `HandleHangup` to validate call ownership, select/refresh pinned OAuth credentials, forward hangup requests to upstream, and complete local session on success.
- Add ephemeral client-secret infrastructure for local ephemeral auth: create/authenticate endpoints, token storage with expiry/capacity limits, session normalization/model mapping, and unified realtime error handling.

Closes: #4726
2026-08-10 22:52:56 +08:00
Luis Pater
3522e481aa fix(openai): emit response.failed stream errors for Codex requests
Closes: #4854
2026-08-09 03:47:14 +08:00
Luis Pater
4b3cc55cdc fix(cliproxy): centralize client error status mapping and apply context cancellation/deadline HTTP codes
Closes: #4601
2026-08-08 04:53:34 +08:00
Luis Pater
32f1069a18 Merge pull request #4668 from oscarbrey/fix/grok-imagine-video-1.5-ga
fix(xai): support Grok Imagine Video 1.5 GA
2026-08-04 23:12:15 +08:00
Luis Pater
4f5ec105b1 fix(codex): set multi_agent_version to v2 when optimizeMultiAgentV2 is enabled 2026-08-04 02:27:58 +08:00
Luis Pater
7fe8473766 feat(codex): prepare multi-agent v2 tool definitions at the Responses boundary for Codex clients 2026-08-03 22:22:15 +08:00
Supra4E8C
0fc028613b chore: exclude test changes from Home fixes 2026-08-03 21:40:06 +08:00
Supra4E8C
a81b9e9ced fix(home): report every unauthorized attempt 2026-08-03 21:40:06 +08:00
Supra4E8C
1e38a3a544 fix: retry Home OAuth requests after unauthorized 2026-08-03 21:39:48 +08:00
Luis Pater
ffdb9c9fbc Merge pull request #4748 from patrick-fu/p/patrick/fix-codex-collaboration-message-encryption
Handle encrypted collaboration message schemas
2026-08-03 05:47:20 +08:00
Patrick Fu
1cf9a45ca2 Handle encrypted collaboration message schemas
- Generalize spawn_agent tool path discovery into codexToolPathsByNames
  driven by a name set, and add codexCollaborationMessageTools covering
  spawn_agent, send_message, and followup_task.
- Strip parameters.properties.message.encrypted from all collaboration
  message tools (top-level tools and input[].additional_tools, including
  nested namespace tools) via removeCodexCollaborationMessageEncryption,
  invoked unconditionally before the spawn-agent optimization decision.
- Extend optimize_multi_agent_v2_test.go with coverage for the new tool
  path discovery, encrypted-field removal semantics, preservation of
  unrelated encrypted fields, and end-to-end OptimizeCodexMultiAgentV2Request
  behavior across namespace and additional_tools payloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-03 04:40:13 +08:00
Luis Pater
a303fd869b feat(codex): support max-context-length overrides for configured models
- Add optional `max-context-length` model configuration across supported provider model types and expose it via `GetMaxContextLength`.
- Propagate the override into model metadata so Codex/client model catalog responses honor the configured value (`context_window`, `max_context_window`, and `max_context_length`).
- Update example configuration with documented usage of the new option.

Closes: #4728
2026-08-03 03:01:43 +08:00
oscarbrey
abaeb55bb2 fix(xai): support Grok Imagine Video 1.5 GA 2026-07-29 23:06:30 +02:00
Luis Pater
3d5ec8628e feat(models): add minimal reasoning level to Codex client models
- Introduced a new reasoning level, `minimal`, to the `codexClientAllowedReasoningLevels` map.
- Updated response-building logic to include descriptive messaging for the `minimal` level.

Closes: #4542
2026-07-28 01:54:16 +08:00
Luis Pater
f8dffa0522 feat(logging): log Codex media forwarding start with detailed fields
- Implemented logging for Codex remote media forwarding start events, including detailed connection and credential metadata.
- Added `formatLogFieldValue` for quoting specific log fields and ensured newline safety in log output.
- Enhanced unit tests to validate log content, escaping, and field inclusion.
2026-07-25 07:51:43 +08:00
Luis Pater
49be36aef6 feat(live): add TCP proxy for Codex Live WebRTC relay
- Implemented a TCP proxy for WebRTC candidate tunneling in Codex Live, supporting passive TCP candidates on port 443.
- Restricted tunneling to globally routable public IPs and added safeguards for rejecting unsafe/private targets.
- Added robust validation of STUN BindingRequest frames before forwarding to upstream candidates.
- Includes extensive unit tests for proxying behavior, candidate validation, and tunnel edge cases.
2026-07-25 07:12:28 +08:00
Luis Pater
ebc7446929 feat(diff): enhance config diff and relay updates for Codex Live Media
- Added comprehensive diffing for Codex live media relay settings, including support for public IP, UDP port ranges, and ICE server changes.
- Introduced `displayOptionalValue` utility to handle optional values in diff outputs.
- Improved test coverage for config change detection, ensuring no sensitive information leakage.
- Replaced `allow-private-remote-ips` with the new `disable-private-remote-ips` property, adding YAML backward compatibility.
- Updated Codex live handler to differentiate media relay configuration changes and runtime updates.
2026-07-25 06:09:50 +08:00
Luis Pater
bda79b21bb feat(live): relay realtime WebRTC media 2026-07-25 05:11:28 +08:00
Luis Pater
46172dd452 feat(live): add Codex Live session handler and sideband support
- Implemented `live` package to handle Codex WebRTC session bootstrap requests.
- Introduced session forwarding, OAuth-based selection, and multipart payload handling.
- Added sideband WebSocket relay functionality with authorization pinning.
- Comprehensive tests for session handling, response validation, and header management included.

Closes: #4541
2026-07-25 03:44:41 +08:00
Luis Pater
71d591296b feat(models): add Codex client model catalog and response builder
- Introduced a new `models` package for organizing Codex client model templates and building responses.
- Migrated Codex response handling to `codexmodels.BuildResponse`.
- Added comprehensive tests for model metadata, reasoning levels, and input modalities handling.
2026-07-25 01:24:22 +08:00
Luis Pater
84bf9376e5 feat(executor): replace sdktranslator.TranslateRequest with helps.TranslateRequestWithCodexMultiAgentV2
- Updated Kimi and Gemini executors to use `TranslateRequestWithCodexMultiAgentV2` for improved multi-agent v2 optimization.
- Enhanced configuration and API server to support `CodexOptimizeMultiAgentV2`.
- Added codex multi-agent V2 optimizations in `config`, `executor`, and `watcher` modules.
2026-07-25 00:32:37 +08:00