Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions docs-site/src/content/docs/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@ points at opencodex, the proxy relays those calls to the OpenAI upstream:
`openai-responses` provider whose endpoint implements the OpenAI Images API. Explicit selection
fails closed and never falls back to a different paid upstream. Registry-managed provider ids
are not accepted here; omit `images.provider` to use the built-in OpenAI tiers.
- **Google Antigravity (CCA) fallback:** when neither an OpenAI forward candidate nor a keyed
provider is configured, `/v1/images/generations` (not `/images/edits`) falls back to the
Antigravity **Cloud Code Assist** endpoint using the `gemini-3.1-flash-image` model. The fallback
also fires after OpenAI auth resolution fails (e.g. an expired or missing ChatGPT credential),
not only when no OpenAI candidate is configured. This
requires `ocx login google-antigravity`; the OAuth token is sent only to the pinned CCA registry
host, never to a config-level `baseUrl` override. The response is returned in the same
`{created, data:[{b64_json}]}` shape Codex expects.
- **Neither:** the proxy returns a clear error instead of a generic 404. Routed providers
(Cursor, Gemini, Kiro, …) cannot serve image generation; if you don't want the tool offered at
all, disable it in Codex with `codex features disable image_generation`
(Cursor, Gemini, Kiro, …) cannot serve the `image_generation` tool relay; if you don't want the
tool offered at all, disable it in Codex with `codex features disable image_generation`
(`[features] image_generation = false` in `config.toml`).

For an OpenAI-compatible custom gateway, configure a dedicated provider and select it only for
Expand All @@ -75,6 +83,11 @@ The custom endpoint must accept `POST /v1/images/generations` and `/v1/images/ed
OpenAI Images response shape expected by Codex. The provider's configured key replaces any caller
bearer before the upstream request.

> **Note:** This refers only to the Codex `image_generation` tool (`/images/generations` relay).
> Gemini models that are image-capable produce inline images natively through the `google` adapter
> (via `responseModalities: ["TEXT", "IMAGE"]`), independent of this relay — see
> [Adapters](/reference/adapters/#google).

For a non-loopback `hostname`, Codex must send the generated API auth header. The injector therefore
uses a dedicated provider instead:

Expand Down
11 changes: 9 additions & 2 deletions docs-site/src/content/docs/ja/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ ChatGPT bearer 認証で直接 POST します。注入された `base_url` が o
API キー方式 `openai-responses` プロバイダーを指定できます。明示的な選択が失敗しても、別の
有料上流へフォールバックしません。組み込みプロバイダー id には使わず、既定の OpenAI 経路を
使う場合は省略してください。
- **両方なし:** 曖昧な 404 の代わりに明確なエラーを返します。ルーティングされる他のプロバイダー(Cursor、
Gemini、Kiro など)は既定では画像生成を提供できません。ツール自体をオフにしたい場合は Codex で
- **Google Antigravity (CCA) フォールバック:** OpenAI forward 候補も API キープロバイダーもない場合、

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the incomplete duplicate fallback bullets

In the Japanese guide, this insertion starts a new bullet before the preceding “neither” bullet finishes, then repeats that bullet after the CCA section; the Korean, Russian, and Chinese translations have the same malformed duplication. Readers therefore see an interrupted sentence and two conflicting “no provider” cases, unlike the synchronized English list. Remove the stale pre-CCA bullet in all four translated guides.

AGENTS.md reference: AGENTS.md:L96-L97

Useful? React with 👍 / 👎.

`/v1/images/generations`(`/images/edits` を除く)は Antigravity **Cloud Code Assist** エンドポイントに
フォールバックし、`gemini-3.1-flash-image` モデルを使用します。OpenAI 認証の解決に失敗した場合
(例: ChatGPT 認証情報が期限切れまたは不在)も同様にフォールバックが発火し、OpenAI 候補が全くない
場合のみではありません。`ocx login google-antigravity` が
必要です。OAuth トークンは CCA レジストリホストにのみ送信され、設定の `baseUrl` オーバーライドには
送信されません。レスポンスは Codex が期待する `{created, data:[{b64_json}]}` 形式で返されます。
- **いずれもなし:** 曖昧な 404 の代わりに明確なエラーを返します。ルーティングされる他のプロバイダー(Cursor、
Gemini、Kiro など)は画像生成を提供できません。ツール自体をオフにしたい場合は Codex で
`codex features disable image_generation`(`config.toml` の `[features] image_generation = false`)を
使ってください。

Expand Down
11 changes: 9 additions & 2 deletions docs-site/src/content/docs/ko/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ ChatGPT bearer 인증으로 직접 POST합니다. 주입된 `base_url`이 openco
- **명시적 커스텀 프로바이더:** `images.provider`에 OpenAI Images API를 구현한 커스텀 API-key
`openai-responses` 프로바이더를 지정할 수 있습니다. 명시적 선택이 실패해도 다른 유료 업스트림으로
fallback하지 않습니다. 내장 프로바이더 id에는 사용하지 말고, 기본 OpenAI 경로를 쓰려면 생략하세요.
- **둘 다 없음:** 모호한 404 대신 명확한 오류를 반환합니다. 라우팅되는 다른 프로바이더(Cursor,
Gemini, Kiro 등)는 기본적으로 이미지 생성을 제공할 수 없습니다. 도구 자체를 끄고 싶다면 Codex에서
- **Google Antigravity (CCA) 폴백:** OpenAI forward 후보와 API key 프로바이더 모두 없을 때,
`/v1/images/generations`(`/images/edits` 제외)가 Antigravity **Cloud Code Assist** 엔드포인트로
폴백되며 `gemini-3.1-flash-image` 모델을 사용합니다. OpenAI 인증 해석이 실패할 때(예: ChatGPT 자격
증명이 만료되거나 누락된 경우)에도 동일하게 폴백이 트리거되며, OpenAI 후보가 아예 없을 때만
발생하는 것은 아닙니다. `ocx login google-antigravity`가 필요합니다.
OAuth 토큰은 CCA 레지스트리 호스트로만 전송되며 설정의 `baseUrl` 재정의로는 가지 않습니다.
응답은 Codex가 기대하는 `{created, data:[{b64_json}]}` 형식으로 반환됩니다.
- **모두 없음:** 모호한 404 대신 명확한 오류를 반환합니다. 라우팅되는 다른 프로바이더(Cursor,
Gemini, Kiro 등)는 이미지 생성을 제공할 수 없습니다. 도구 자체를 끄고 싶다면 Codex에서
`codex features disable image_generation`(`config.toml`의 `[features] image_generation = false`)을
사용하세요.

Expand Down
9 changes: 9 additions & 0 deletions docs-site/src/content/docs/reference/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ streams the response back **untranslated**.
`functionDeclarations`. Data-URL images → `inline_data`.
- Tool-call ids are synthesized when Gemini omits them. Antigravity preserves and replays real
`thoughtSignature` values so reasoning continuity survives later turns.
- **Inline image output:** when the model is one of the explicit image-capable chat IDs
(`gemini-3.1-flash-image`, `gemini-2.0-flash-preview-image-generation`, or
`gemini-3-pro-image-preview`), the adapter sends `responseModalities: ["TEXT", "IMAGE"]`.
Standalone media-generation IDs such as `gemini-3-pro-image` are not included. Returned
`inlineData` parts are materialized under the configured OpenCodex `artifacts/` directory and
surfaced as markdown image links to the authenticated opaque route
`/v1/opencodex/artifacts/<id>` (not `file:` URIs or host filesystem paths). Each image is capped
at 50 MB and each response at 100 MB of decoded data; malformed base64 payloads are rejected.
Artifacts are pruned automatically when the count exceeds 200 files.

## `kiro`

Expand Down
12 changes: 10 additions & 2 deletions docs-site/src/content/docs/ru/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ fast_mode = true
API-key-провайдер `openai-responses`, реализующий OpenAI Images API. Ошибка явного выбора не
приводит к fallback на другую платную вышестоящую сторону. Встроенные id провайдеров здесь не
используются; чтобы сохранить стандартный путь OpenAI, опустите это поле.
- **Ни того, ни другого:** прокси возвращает понятную ошибку вместо безликого 404.
Маршрутизируемые провайдеры (Cursor, Gemini, Kiro, …) по умолчанию не могут обслуживать генерацию
- **Резерв Google Antigravity (CCA):** когда ни forward-кандидат OpenAI, ни провайдер с
API-ключом не настроены, `/v1/images/generations` (но не `/images/edits`) переключается на
эндпоинт Antigravity **Cloud Code Assist** с моделью `gemini-3.1-flash-image`. Этот же резерв
срабатывает и при сбое разрешения аутентификации OpenAI (например, истёкшая или отсутствующая
учётная запись ChatGPT), а не только при отсутствии кандидата OpenAI. Требуется
`ocx login google-antigravity`; OAuth-токен отправляется только на закреплённый хост реестра
CCA, а не на `baseUrl` из конфигурации. Ответ возвращается в том же формате
`{created, data:[{b64_json}]}`, что ожидает Codex.
- **Ничего из перечисленного:** прокси возвращает понятную ошибку вместо безликого 404.
Маршрутизируемые провайдеры (Cursor, Gemini, Kiro, …) не могут обслуживать генерацию
изображений; если вы вообще не хотите предлагать этот инструмент, отключите его в Codex
командой `codex features disable image_generation`
(`[features] image_generation = false` в `config.toml`).
Expand Down
10 changes: 8 additions & 2 deletions docs-site/src/content/docs/zh-cn/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ OpenAI 上游:
- **显式自定义 provider:** 可将 `images.provider` 设为一个自定义 API-key
`openai-responses` provider;该 endpoint 必须实现 OpenAI Images API。显式选择失败时不会
fallback 到其他付费上游。内置 provider id 不适用于此字段;省略它即可使用默认 OpenAI 路径。
- **两者都没有:** proxy 返回明确的错误而不是含糊的 404。其他路由提供商(Cursor、Gemini、
Kiro 等)默认无法提供图像生成;如果想完全关闭该工具,可在 Codex 中执行
- **Google Antigravity(CCA)回退:** 当 OpenAI forward 候选和 API key 提供商都不存在时,
`/v1/images/generations`(不含 `/images/edits`)会回退到 Antigravity **Cloud Code Assist**
端点,使用 `gemini-3.1-flash-image` 模型。当 OpenAI 认证解析失败(例如 ChatGPT 凭证过期或缺失)时,
该回退同样会触发,而不仅仅在没有任何 OpenAI 候选时。需要 `ocx login google-antigravity`;OAuth token
只发送到 CCA 注册端点,不会发送到配置中的 `baseUrl` 覆盖地址。返回格式与 Codex 期望的
`{created, data:[{b64_json}]}` 一致。
- **以上都没有:** proxy 返回明确的错误而不是含糊的 404。其他路由提供商(Cursor、Gemini、
Kiro 等)无法提供图像生成;如果想完全关闭该工具,可在 Codex 中执行
`codex features disable image_generation`(即 `config.toml` 的
`[features] image_generation = false`)。

Expand Down
4 changes: 4 additions & 0 deletions src/adapters/google-wire-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ function compileGenerationConfig(value: unknown): JsonObject | undefined {
: (["xhigh", "max", "ultra"].includes(raw) ? "high" : undefined);
if (thinkingLevel) out.thinkingConfig = { thinkingLevel };
}
if (Array.isArray(value.responseModalities)) {
const valid = value.responseModalities.filter((m): m is string => typeof m === "string" && ["TEXT", "IMAGE", "AUDIO"].includes(m));
if (valid.length > 0) out.responseModalities = valid;
}
return Object.keys(out).length > 0 ? out : undefined;
}

Expand Down
Loading
Loading