Skip to content

Commit 6671d78

Browse files
authored
Merge pull request #7474 from lidge-jun/release/promote-main-2.90.0
[WRONG BRANCH] release: promote dev 845ac6b to main as 2.90.0
2 parents dd2bdd2 + 6aeee9d commit 6671d78

279 files changed

Lines changed: 13195 additions & 1035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎desktop/src-tauri/Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎desktop/src-tauri/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opencodex-desktop"
3-
version = "2.89.0"
3+
version = "2.90.0"
44
description = "OpenCodex desktop shell"
55
authors = ["OpenCodex contributors"]
66
license = "MIT"

‎desktop/src-tauri/tauri.conf.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "OpenCodex",
4-
"version": "2.89.0",
4+
"version": "2.90.0",
55
"identifier": "com.opencodex.desktop",
66
"build": {
77
"frontendDist": "../ui",

‎docs-site/src/content/docs/guides/claude-code.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ Claude Desktop can use OpenCodex in one of two mutually exclusive modes. Pick it
254254
**Connect → Claude Desktop → Connection mode** in the dashboard or with `ocx claude desktop apply
255255
--first-party|--gateway`.
256256

257+
> Desktop library profiles and `_meta.json` must be regular files of at most
258+
> 4 MiB. OpenCodex also refuses generated profile or metadata output above that
259+
> limit before replacing files. Back up and reduce oversized configuration
260+
> manually; a size refusal does not truncate the existing data. Connection-owned
261+
> stores retain their existing tighter limits.
262+
257263
### Gateway (default)
258264

259265
New installs use **gateway** by default. Its third-party profile, described below, switches the

‎docs-site/src/content/docs/guides/codex-integration.md‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,24 @@ selected stored account is cooling down and no eligible stored alternative or re
3131
available. This also covers a new request blocked before sending, following the same caller
3232
validation used after an upstream rejection. Existing model-permission and main-account policy
3333
checks still apply. The fallback preserves the stored account's cooldown and does not persist the
34-
caller credential as the Pool selection. An exact account binding remains bound to that account.
34+
caller credential as the Pool selection. An exact account binding remains bound to that account. A manual Pool
35+
pin is a preference, not an exact account binding: it can still use this fallback. Use an
36+
account-qualified model when a request must remain on one account. Pausing the observed native
37+
main blocks fallback for its matching caller credential; it does not identify or pause unrelated
38+
caller-owned logins.
39+
40+
Adding or reauthenticating a pool account rejects a duplicate of the native main login with
41+
`Account is already configured as the native Codex main account.` The check compares ChatGPT
42+
account ID, personal/workspace subscription bucket, and email; a missing email does not prove
43+
a different identity. Different workspaces, distinct workspace members, and separate personal
44+
and workspace subscriptions remain supported. A failed usage lookup does not discard the
45+
subscription plan carried by the login token.
46+
47+
Existing duplicates remain stored but cannot be selected as a second Pool account. The account
48+
list exposes `selectionExcludedReason: "duplicate_main"` and an actionable `selectionExcludedAction`. Use native main explicitly,
49+
or sign native Codex into a different account before reusing the stored entry. Detection follows
50+
the latest owned native-login observation, including a later native relogin; passive account
51+
listing and caller-owned requests do not open native credentials to refresh that observation.
3552

3653
## Config injection
3754

@@ -125,6 +142,17 @@ to restore the default upstream WebSocket selection. This setting does not chang
125142
client-facing `websockets` switch or the ChatGPT account used for the request. Native
126143
mid-turn steering and injection need upstream WebSocket and are unavailable while it is off.
127144

145+
**Reasoning usage metadata (pending next release).** For HTTP/SSE clients on the canonical
146+
ChatGPT route, the upstream WebSocket relay preserves an actual `x-reasoning-included`
147+
connection-response header when the Bun runtime exposes it, including on a reused connection.
148+
This tells Codex that the server's reported usage already includes earlier reasoning. Metadata
149+
sent before the first Responses event takes precedence; later metadata remains in the stream
150+
but cannot change headers already committed. The relay does not invent this signal or alter
151+
usage numbers. A missing upstream signal and Codex's own accounting lifecycle remain separate
152+
issues, so this change alone does not establish that early compaction is fixed. Client-facing
153+
WebSocket connections have already completed their upgrade before the upstream response and
154+
cannot receive the signal retroactively as an upgrade header.
155+
128156
Local provider pacing can also hold a request before it is dispatched at all. So a slow first
129157
output has several possible contributors, and upstream queueing is only one of them. `ocx doctor`
130158
classifies configuration and measures none of these: compare actual transport, pacing, network,

‎docs-site/src/content/docs/guides/pi.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ An explicit reasoning effort of `none` survives Chat conversion. Output limits a
147147
controls are preserved for generic API-key Responses targets; the canonical ChatGPT target
148148
still applies its own restrictions. This does not make all providers' controls equivalent.
149149

150-
**Audio and most file attachments need a native input wire that supports them.** A document
151-
that carries its own base64 bytes in a user message is the exception: it survives translation
152-
and reaches the Anthropic, OpenAI Chat and Google wires as a native document, file part and
153-
inline data part. Everything else still returns an explicit error rather than succeeding
154-
without the attachment — audio, a file-ID or remote reference the proxy cannot dereference, an
155-
attachment in a tool output or a system message, and a document routed to a wire with no byte
150+
Inline WAV/MP3 audio in a user message or tool result survives translation to OpenAI Chat as an
151+
`input_audio` content part; tool-result audio is promoted into a follow-up user message after
152+
the paired tool results because Chat tool messages are text-only. A document that carries its
153+
own base64 bytes in a user message is also carried: it reaches the Anthropic, OpenAI Chat and
154+
Google wires as a native document, file part and inline data part. Everything else still
155+
returns an explicit error rather than succeeding without the attachment — remote or
156+
unsupported audio, a file-ID or remote reference the proxy cannot dereference, an attachment
157+
in a system message, a document in a tool result, and a document routed to a wire with no byte
156158
carrier. File-ID-only images have the same restriction because translated adapters cannot
157159
resolve those IDs. Convert the attachment to text first, or use a native wire and model that
158160
support it. Native Chat and raw Responses (including Azure) retain their existing behavior;

‎docs-site/src/content/docs/guides/providers.md‎

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,27 @@ labels local presets separately; those normally omit both `authMode` and `apiKey
121121
The [`retryOn429`](/reference/configuration/) same-key 429 replay applies only to API-key
122122
providers (`authMode: "key"`). OAuth, forward, and local presets are excluded — their
123123
credentials must never be replayed on the same token, and local runtimes have no remote key to
124-
preserve. It is opt-in: when the option is absent the feature is off; object presence enables
125-
it unless `enabled: false`.
124+
preserve. It is opt-in except for documented destination-specific defaults. Canonical Mistral
125+
Chat uses a patient retry policy (6 replays, 10-second fallback interval), within the
126+
existing request-wide send allowance. Explicit `retryOn429` settings, including
127+
`enabled: false`, take precedence. The Mistral preset also forwards supplied prompt-cache
128+
keys by default; `promptCacheKey: false` disables forwarding. Cache affinity improves the
129+
chance of reuse, but does not guarantee a cache hit or remove token-throughput limits.
130+
131+
Mistral uses one API-key provider for both Studio and Vibe keys. Key types and plan allowances
132+
are described in [Mistral's API-key documentation](https://docs.mistral.ai/admin/identity-access/api-keys);
133+
the proxy does not infer a subscription tier from the key. For every model, explicit upstream
134+
`Retry-After` deadlines are shared between calls on the same credential and model. A 429
135+
without a retry time can activate a conservative 60-second recovery wait when valid minute
136+
counters show exhausted capacity, or the refused query's measured cost exceeds the remaining
137+
tokens while fitting the full advertised allowance. This is a local recovery policy, not an
138+
exact server-reset prediction. Healthy traffic never predicts the next query's cache or cost.
139+
After the wait, one recovery probe runs; success restores ordinary traffic. Missing, malformed,
140+
zero-entitlement, exhausted-monthly, or above-full-allowance evidence does not invent a reset or compact history.
141+
`requestPacing: { "enabled": false }` or `retryOn429: { "respectRetryAfter": false }`
142+
disables shared pacing. If Mistral's
143+
retry time exceeds `retryOn429.maxIntervalMs`, the proxy returns the 429 and retry hint rather
144+
than replaying early. Context windows and per-model compaction preferences remain independent.
126145

127146
When round-robin key selection is enabled, queued requests recheck key cooldowns before sending and acquire pacing capacity for any replacement key. This applies to native Chat, Messages, Responses and compact. Waiting for replacement-key capacity does not consume the upstream response-header timeout. Per-key pacing and round-robin use guarded HTTP/SSE even when upstream WebSockets are enabled; WebSocket-only steering and injection require a route without those key policies. This does not change the saved active key. An established upstream turn keeps its credential; later sends are refused if that key cools. Pre-output key rejection can recover to a healthy key within the existing request limit. Direct Images and compact requests record genuine 401/429 cooldowns without replaying that paid POST.
128147

@@ -478,6 +497,8 @@ cat accounts.json | ocx account import google-antigravity --format cockpit-tools
478497

479498
Inline JSON and extra positional arguments are rejected. Keep exported files private and delete or store them securely after import.
480499

500+
Each record may carry an optional `project_id` for an account whose Cloud Code Assist project is not discovered automatically. It must be a Google Cloud project id (6–30 lowercase letters, digits or hyphens). OpenCodex uses it only when discovery finds no project, and only after a quota check with that account's own token succeeds for it; otherwise the record fails with `missing_project` and nothing is saved. A discovered project always takes precedence.
501+
481502
### OAuth reliability
482503

483504
opencodex coordinates token refresh and Codex pool routing so concurrent requests do not race the
@@ -743,6 +764,16 @@ Create a key in the [OpenGateway dashboard](https://opengateway.ai/api-keys), th
743764
use the configured Bearer key; the public model list does not validate that key.
744765
On the Responses wire OpenGateway rejects replayed native custom tool calls, so the preset
745766
lowers Codex custom tools such as code-mode `exec` to function tools before sending them.
767+
Tool-result content arrays are sent as text, with images preserved after the paired tool-result group. Unsupported result parts, including refusals and opaque content, are rejected explicitly with a client input error before sending.
768+
Image detail `original` maps to `high`, which the gateway accepts; image bytes remain unchanged.
769+
The native Responses route also checks text-only empty completions before exposing them as success.
770+
Exhausted output budgets produce `incomplete` with `max_output_tokens`; the proxy does not increase
771+
the requested budget. A replay-safe empty completion with budget remaining may retry once, within
772+
the existing send limit. Explicit `emptyCompletionRetry: false` or `OCX_EMPTY_COMPLETION_RETRY=0`
773+
disables that retry. Text, refusals, tool activity, and unknown stream events prevent replay and
774+
retain the original stream. The protection does not change other providers or their retry defaults.
775+
Replay requires explicit `store: false`, complete input, and client-executed tools only; a hosted
776+
tool such as `web_search` prevents automatic replay even if no tool event was observed.
746777

747778
**TokenLab** ([sponsor](https://github.com/lidge-jun/opencodex/blob/main/SPONSORS.md)) is an
748779
OpenAI-compatible API gateway at [tokenlab.sh](https://tokenlab.sh/r/OPENCODEX),
@@ -857,10 +888,12 @@ when a stable upstream session is required.
857888

858889
**MiMo tool-call echoes.** On OpenCode Go and other Chat Completions routes, a bare
859890
`<tool_call>` block is hidden when it duplicates one structured call to the same tool
860-
with the same effective input. If the input differs or several calls could explain
891+
with the same effective input. This includes MiMo wrappers such as
892+
`<tool_call_deadbeef>` with matching closing IDs, including echoes appended to ordinary prose.
893+
Code examples remain visible. If the input differs or several calls could explain
861894
the block, the markup remains visible. For `mimo-v2` and dotted MiMo V2 model IDs such as
862895
`mimo-v2.6-pro`, if the gateway instead sends exactly one empty `{}` call for a declared
863-
freeform tool and puts its input in a standalone bare block, opencodex restores that
896+
freeform tool and puts its input in a standalone bare or identified block, opencodex restores that
864897
input to the call and hides the block. Hyphenated IDs such as `mimo-v2-pro` and
865898
`mimo-v2-omni` are outside this recovery rule. Prose, quoted
866899
examples, ordinary functions, and ambiguous responses remain unchanged. This also handles

‎docs-site/src/content/docs/guides/sidecars.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,19 @@ failures after response headers have started are delivered as `response.failed`
138138

139139
## Vision sidecar
140140

141+
Mistral's `zai-glm-5-3` is enrolled by the provider preset as text-only. With the
142+
vision sidecar enabled and available, OpenCodex describes attached images and
143+
sends their text descriptions to GLM. The Codex catalog advertises image
144+
attachments for this route. After an update, run `ocx sync`, then fully quit and
145+
relaunch the Codex desktop app or reload the VS Code window. Sync without a
146+
restart flag does not restart an existing Codex app-server, which can retain
147+
the old model list. Alternatively, use `ocx sync --restart-codex` to sync and
148+
restart matching Codex processes and the desktop app. Finish active work first:
149+
this restart ends live conversations. See the [sync and restart reference](/reference/cli/lifecycle/#ocx-sync---restart-codex---restart-app-server-only).
150+
After relaunch, select `mistral/zai-glm-5-3` and verify that image attachments
151+
are available. No model modality override is needed. Mistral documents native input in its
152+
[GLM 5.3 reference](https://docs.mistral.ai/models/zai-glm-5-3).
153+
141154
Image routing is capability-aware. Before an image-bearing upstream send, opencodex resolves the selected model's effective input modalities from runtime provider evidence, explicit operator declarations, backend/registry metadata, and generated vendor metadata. A target positively known to be text-only goes through the Vision Sidecar first; the image is described **before** the main call and replaced inline with text. A target positively known to support images receives the image directly. Unknown custom models keep the existing compatibility behavior rather than being guessed text-only.
142155

143156
For the canonical ChatGPT Codex route, opencodex uses the `openai-codex` metadata bundle rather than public OpenAI API metadata, so backend-specific modality differences are respected. The native Chat fast path uses the same gate and cannot bypass a known text-only verdict. Without an available sidecar plan, raw images are stripped before a proven text-only backend.

‎docs-site/src/content/docs/ko/guides/codex-integration.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ Pool 모드에서는 선택된 저장 계정이 쿨다운 중이고 사용 가
1313
권한과 main 계정 정책 검사는 유지됩니다. 이 fallback은 저장 계정의 쿨다운을 해제하거나 호출자
1414
인증을 Pool 선택으로 저장하지 않습니다. 특정 계정에 정확히 고정된 요청은 그 계정에 계속 묶입니다.
1515

16+
수동 Pool pin은 우선순위 선호이므로 위 fallback을 허용합니다. 특정 계정만 사용해야 하면
17+
계정이 지정된 모델을 선택하세요. 관측된 native main을 일시 정지하면 일치하는 호출자 자격 증명의
18+
Pool fallback도 거부하지만, 별도 호출자 로그인을 main으로 간주하지는 않습니다.
19+
20+
계정 ID·개인/워크스페이스 구독 구분·이메일이 native main과 중복되는 Pool 등록 및 재인증은
21+
거부됩니다. 이메일이 없으면 다른 구성원이라는 근거로 취급하지 않습니다. 서로 다른 워크스페이스,
22+
이메일로 구분되는 구성원, 개인/워크스페이스 구독은 계속 사용할 수 있습니다. 사용량 조회 실패 시에도
23+
로그인 토큰의 구독 정보는 유지합니다. 기존 중복 계정은 삭제하지 않고 Pool 선택에서 제외하며 계정
24+
목록의 `selectionExcludedReason: "duplicate_main"`과 `selectionExcludedAction`으로 이유를 알립니다. native main을 사용하거나
25+
native Codex를 다른 계정으로 로그인하면 됩니다. 재로그인 감지는 권한을 확보한 다음 native 로그인
26+
관측에서 반영하며, 수동 목록 조회나 호출자 소유 요청은 이를 위해 native 자격 증명을 읽지 않습니다.
27+
1628
## 설정 주입
1729

1830
`ocx init`, `ocx start`, `ocx sync`는 모두 인젝터를 호출합니다. 기본 loopback 바인드에서는 Codex의 빌트인 `openai` 프로바이더 id를 그대로 유지한 채, 그 프로바이더가 opencodex를 바라보게 합니다.
@@ -207,6 +219,17 @@ Windows에서 Orca shell은 `CODEX_HOME`과 `ORCA_CODEX_HOME`을 Orca의 번들
207219

208220
전용 provider 모드의 `requires_openai_auth = true`는 Codex App/TUI의 계정 게이트 화면을 네이티브 Codex와 같은 조건으로 맞춥니다. opencodex는 `/v1/responses`도 WebSocket으로 제공합니다. 전용 provider는 `"websockets": true`일 때만 `supports_websockets = true`를 광고합니다. loopback에서는 Codex의 빌트인 provider가 먼저 WebSocket을 시도할 수 있으며, 비활성화된 proxy는 `426`을 반환해서 Codex가 HTTP/SSE로 fallback합니다.
209221

222+
**추론 사용량 표시 보존(다음 릴리스 반영 예정).** 정식 ChatGPT 경로를 HTTP/SSE로 받는
223+
클라이언트에는, Bun 런타임이 제공하는 상류 WebSocket 연결 응답의 실제
224+
`x-reasoning-included` 헤더를 전달합니다. 같은 연결을 재사용하는 요청에서도 유지합니다.
225+
이 표시는 서버가 보고한 사용량에 이전 추론량이 이미 포함됐음을 Codex에 알립니다.
226+
첫 Responses 이벤트 전에 받은 메타데이터가 우선하며, 이후 메타데이터는 본문에 남지만
227+
이미 확정한 응답 헤더를 바꾸지는 못합니다. 없는 표시를 만들어 붙이거나 사용량 숫자를
228+
수정하지 않습니다. 상류가 표시를 보내지 않는 경우와 Codex 자체의 사용량 상태 관리는
229+
별도 문제이므로, 이 변경만으로 조기 압축 해결을 보장하지 않습니다. 클라이언트도
230+
WebSocket으로 연결하면 상류 응답 전에 연결 승인이 끝나므로, 그 승인 헤더에 표시를
231+
나중에 추가할 수는 없습니다.
232+
210233
네이티브 ChatGPT forward 요청의 로컬 재생 상태가 만료되었거나 없으면 opencodex는
211234
upstream 요청 전에 `previous_response_not_found`를 반환합니다. Codex WebSocket 클라이언트는
212235
일반 스트림 재시도 한도 안에서 다시 연결하고, 완료된 도구 호출과 결과를 포함한 현재 보유

0 commit comments

Comments
 (0)