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
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ Before the raw-body outbound normalizer requires array content and leaves the is
## Verification

Pin parent/child fixtures to synthetic input. The strict upstream stub must reject the pre-fix request shape and accept the normalized one; destination-negative controls prove the guard is active. Hosted PR CI and final full dispatch execute adapter/server regressions. Local tests/install/typecheck/build remain NOT RUN. Source audit checks raw-body call placement and all consumers of the added option. There is no serialized configuration field or migration: option creation and consumption are both in-memory adapter calls.

## wp2 P refresh

Previous wp1 D: PR3986 at d1f61e933 passed run34178540141 and independent source/security audit, with18Go replay scenarios and remote docs425pages. Proceed to xAI string residual. Candidate339e42c1e was prepared in an isolated worktree under the owner-authorized parallel-preparation amendment; it is not yet adopted. Its base exactly equals the certified preceding layer, and the eight-file diff matches this plan. Existing xAI predicate remains the destination owner; no account changes. Issue3907 is still open. Main revalidates candidate before B and retains fresh hosted CI before wp2 closure.
4 changes: 4 additions & 0 deletions devlog/_plan/260908_bug6_manual_stack/030_v2_guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ Remote-only focused activation: `bun test tests/codex-integration/multi-agent-co


Main decision: preserve the complete original diff. The optional extra server caller fixture is deferred unless source audit reveals an untested change; do not duplicate the existing replay matrix merely for volume. Sync structure/03_catalog-and-subagents.md to the new tag and policy boundary.

## wp3 P refresh

Previous wp2 D: PR3991 head00eb47886 passed run34180674115, source audit and remote docs425pages; proceed guidance carry. Prepared layer3 consists of24977adf2,21757b71a,8000e2482, based on d1f61e933. Intervening wp2 changes affect xAI adapter/tests, provider/adapters docs and structure04; none overlap the9layer3 files. Original #3944 remains open at6fb0fc6f. Independent prepared-source/security audit PASS in isolated v2GuidanceReviewer.md; actual adoption requires unchanged-delta/interdiff verification and own hostedCI.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ description: マルチエージェント サーフェス、委任ガイダンス

## ロスターとガイダンス

有効な v2 ロスターは、v2 と互換性があり、挿入されたカタログに存在する、構成され、ピッカーに表示され、優先順位で並べ替えられた最初の 5 つのモデルです。 V2 の適格性は、明示的な `"v2"`、`null`、または欠落しているアップストリーム ピンを適格なものとして扱います。実際の `"v1"` ピンは除外されます。除外されたエントリは設定に残るため、後で適格になる可能性があります。
有効な v2 ロスターは、設定済みでピッカーに表示され、優先順位で並べ替えられた最初の 5 つのモデルのうち、挿入されたカタログに存在し、明示的に `"disabled"` とされていないモデルです。明示的な `"v2"` ピンは再帰的なワーカーをサポートし、`"v1"`、`null`、ピンの省略はリーフワーカーとして引き続き適格です。除外されたエントリは設定に残るため、後で適格になる可能性があります。

表面検出はツール形状を使用します。 `send_input`、`resume_agent`、または `close_agent` を持つ名前空間付き `spawn_agent` は v1 です。 `send_message`、`followup_task`、`interrupt_agent`、または `list_agents` を備えたフラット `spawn_agent` は v2 です。

V1 ガイダンスは、`max` または `ultra` でのみプロアクティブ テキストです。 V2 は、優先モデル、適格なロスター、またはフォールバック チェーンが存在する場合にのみ、プロキシ作成の開発者メッセージを受信します。組み込みの v2 ガイダンスには 700 文字のバジェットがあり、必要に応じて最初にロスターが削除されます。ガイダンスはリプレイ プレフィックス全体で重複排除され、後続の `compaction_trigger` の前に挿入されます。

`injectionModel` および `injectionEffort` は、ネイティブデフォルト同期が有効になっていない限り、推奨事項です。組み込みの v2 テキストは、サポートされているモデル/エフォートのオーバーライドを `fork_turns: "none"` を使用して `spawn_agent` に渡すように Codex に要求します。カスタム `injectionPrompt` は、欠落している値を空の文字列に置き換えます。
組み込みの v2 サブエージェントガイダンスとカスタム `injectionPrompt` 本文は、どちらも `<opencodex_subagent_guidance>` を使用し、Codex ネイティブの `<multi_agent_mode>` メッセージとは区別されます。組み込みテキストは、解決済みの優先モデル、ロスター、フォールバックチェーンを示しますが、委任、モデルのオーバーライド、`fork_turns` は指示しません。カスタム本文のプレースホルダー置換と内容は維持されます。`injectionModel` および `injectionEffort` は、ネイティブデフォルト同期が有効になっていない限り推奨事項であり、カスタムプレースホルダーの欠落値は引き続き空の文字列に置き換えられます。

リプレイの重複排除では、タグの種類ごとに最新のテキストとの完全一致を確認します。両方の値が新しいプロキシのタグを使用する場合、カスタムガイダンスから組み込み形式へ戻すと、その時点の内容が追加されます。途中でネイティブモードが変わっても、変更のないプロキシガイダンスは重複追加されません。既存のネイティブメッセージと旧タグ付きの履歴は保持されます。ラッパーの変更によって過去のメッセージの作成者が判明したり、以前の指示が取り消されたりするわけではありません。複数バージョンが混在する履歴は、旧タグだけでは分類できず、そのような履歴での設定変更の検出は保証されません。

## ネイティブ Codex のデフォルト同期

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ description: 멀티 에이전트 표면, 위임 안내, 선호 모델, 대체

## 로스터와 안내

실제 v2 로스터는 설정되어 있고, 선택기에 보이며, 우선순위로 정렬된 상위 다섯 모델 중 v2와 호환되고 주입된 카탈로그에 존재하는 모델입니다. v2 적격성은 명시적인 `"v2"`, `null`, 또는 생략된 상위 고정값을 적격으로 보고, 실제 `"v1"` 고정값은 제외합니다. 제외된 항목은 나중에 적격이 될 수 있도록 설정에 그대로 남습니다.
실제 v2 로스터는 설정되어 있고, 선택기에 보이며, 우선순위로 정렬된 상위 다섯 모델 중 주입된 카탈로그에 존재하고 명시적으로 `"disabled"`로 표시되지 않은 모델입니다. 명시적인 `"v2"` 고정값은 재귀 작업자를 지원하며, `"v1"`, `null`, 생략된 고정값도 하위 작업을 다시 위임하지 않는 작업자로 참여할 수 있습니다. 제외된 항목은 나중에 적격이 될 수 있도록 설정에 그대로 남습니다.

표면 판별은 도구 형태를 기준으로 합니다. 네임스페이스가 붙은 `spawn_agent`에 `send_input`, `resume_agent`, `close_agent`가 있으면 v1입니다. 평평한 `spawn_agent`에 `send_message`, `followup_task`, `interrupt_agent`, `list_agents`가 있으면 v2입니다.

V1 안내는 `max` 또는 `ultra`에서만 선제 텍스트로 제공됩니다. V2는 선호 모델, 적격 로스터, 대체 체인 중 하나가 있을 때만 프록시가 작성한 개발자 메시지를 받습니다. 내장 v2 안내에는 700자 예산이 있고, 필요하면 로스터를 먼저 줄입니다. 안내는 replay prefix 전반에서 중복 제거되며, 뒤에 오는 `compaction_trigger` 앞에 삽입됩니다.

`injectionModel`과 `injectionEffort`는 네이티브 기본값 동기화가 활성화되지 않으면 권고 수준입니다. 내장 v2 텍스트는 Codex에게 지원되는 모델/노력 오버라이드를 `fork_turns: "none"`과 함께 `spawn_agent`로 전달하라고 요청합니다. 사용자 지정 `injectionPrompt`는 누락된 값을 빈 문자열로 대체합니다.
내장 v2 서브에이전트 안내와 사용자 지정 `injectionPrompt` 본문은 모두 `<opencodex_subagent_guidance>`를 사용하며, Codex 네이티브 `<multi_agent_mode>` 메시지와 구분됩니다. 내장 텍스트는 결정된 선호 모델, 모델 목록, 대체 체인을 알리지만 위임, 모델 오버라이드, `fork_turns`를 지시하지는 않습니다. 사용자 지정 본문의 자리표시자 치환과 내용은 유지됩니다. `injectionModel`과 `injectionEffort`는 네이티브 기본값 동기화가 활성화되지 않으면 계속 권고 수준이며, 사용자 지정 자리표시자의 누락된 값은 빈 문자열로 대체됩니다.

replay 중복 제거는 각 태그 계열의 가장 최근 텍스트와 정확히 일치하는지 비교합니다. 두 값 모두 새 프록시 태그 계열을 사용하는 경우, 사용자 지정 안내에서 내장 형식으로 돌아오면 현재 안내가 추가됩니다. 그 사이에 네이티브 모드가 바뀌어도 변경되지 않은 프록시 안내가 중복 추가되지는 않습니다. 기존 네이티브 메시지와 예전 태그가 붙은 이력은 보존됩니다. 래퍼 변경으로 과거 메시지의 작성자가 판별되거나 이전 지침이 철회되는 것은 아닙니다. 여러 버전이 섞인 이력은 예전 태그만으로 분류할 수 없으며, 이러한 이력에서 설정 전환이 감지된다고 보장하지 않습니다.

## Codex 기본값 동기화

Expand Down
9 changes: 6 additions & 3 deletions docs-site/src/content/docs/reference/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,17 @@ collision-safe public function tool. Matching request history and JSON/SSE funct
translated back to the private `tool_search` lifecycle for the client. Canonical OpenAI forward
keeps the native private type unchanged.

Requests with `authMode` other than `"forward"` convert plaintext Codex `agent_message`
items into public user messages, preserving content parts and readable author/recipient
Requests with `authMode` other than `"forward"` convert Codex `agent_message`
items containing nonempty arrays of supported plaintext parts into public user messages, preserving those parts and readable author/recipient
metadata. `agent_message` is private to the ChatGPT Codex backend, and the routed
destinations reported so far reject the entire body with
`422 unknown item type "agent_message"` — and because Codex replays sub-agent history on
every turn, that failure repeats for the rest of the thread. This conversion leaves
encrypted or unknown content unchanged. Providers using `authMode: "forward"` retain
these items unchanged.
these items unchanged. For xAI Responses on HTTPS `api.x.ai` or `cli-chat-proxy.grok.com`
using the standard port, a nonblank string child result is also converted into an `input_text`
part with its exact whitespace and newlines. Other destinations retain string-valued items;
blank strings and mixed encrypted/unknown parts are not partially converted.
See [agent messages](/reference/configuration/providers/#routed-agent-messages)
for the separate opt-in encrypted-task recovery behavior.

Expand Down
22 changes: 16 additions & 6 deletions docs-site/src/content/docs/reference/configuration/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ loudly when the installed Codex build does not know the flag yet.
## Roster and guidance

The effective v2 roster is the configured, picker-visible, priority-sorted first five models that
are compatible with v2 and present in the injected catalog. V2 eligibility treats an explicit `"v2"`,
`null`, or absent upstream pin as eligible; a real `"v1"` pin is excluded. Excluded entries remain in
configuration so they can become eligible later.
are present in the injected catalog and are not explicitly marked `"disabled"`. An explicit `"v2"`
pin supports recursive workers; `"v1"`, `null`, and absent pins remain eligible as leaf workers.
Excluded entries remain in configuration so they can become eligible later.

Surface detection uses tool shape. A namespaced `spawn_agent` with `send_input`, `resume_agent`, or
`close_agent` is v1. A flat `spawn_agent` with `send_message`, `followup_task`, `interrupt_agent`, or
Expand All @@ -88,9 +88,19 @@ message only when a preferred model, eligible roster, or fallback chain exists.
has a 700-character budget and drops the roster first if necessary. Guidance is deduplicated across
replay prefixes and inserted before a trailing `compaction_trigger`.

`injectionModel` and `injectionEffort` are advisory unless native-default sync is enabled. The built-in
v2 text asks Codex to pass supported model/effort overrides to `spawn_agent` with
`fork_turns: "none"`. A custom `injectionPrompt` substitutes missing values with an empty string.
Both built-in v2 subagent guidance and custom `injectionPrompt` bodies use
`<opencodex_subagent_guidance>`, separate from Codex's native `<multi_agent_mode>` messages.
Built-in text reports the resolved preferred model, roster, and fallback chain without prescribing
delegation, model overrides, or `fork_turns`. Custom bodies retain their placeholder substitution
and content. `injectionModel` and `injectionEffort` remain advisory unless native-default sync is
enabled; missing custom placeholder values are still replaced with an empty string.

Replay deduplication compares the latest exact text in each tag family. When both values use the
new proxy family, switching custom guidance back to the built-in form appends the current value;
intervening native mode changes do not duplicate unchanged proxy guidance. Existing native and
legacy-tagged history is preserved. This wrapper change does not identify the author of old
messages or revoke prior instructions. Mixed-version histories cannot be classified from the
legacy tag alone, and transition detection across such histories is not guaranteed.

## Native Codex default sync

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,14 +968,19 @@ their previous behavior. See the

## Routed agent messages

With the [`openai-responses` adapter](/reference/adapters/#openai-responses), plaintext
Codex `agent_message` items become user messages when `authMode` is not `"forward"`
With the [`openai-responses` adapter](/reference/adapters/#openai-responses), Codex
`agent_message` items containing nonempty arrays of supported plaintext parts become user messages when `authMode` is not `"forward"`
(for example, `"key"`). Providers using `authMode: "forward"` retain these items unchanged.
`agent_message` is private to the ChatGPT Codex backend, and the routed destinations
reported so far answer the whole request with
`422 unknown item type "agent_message"`; Codex replays sub-agent history on every
subsequent turn, so the thread keeps failing until the item is converted.
Author and recipient remain explicit text metadata, and the content parts are preserved.
For HTTPS `api.x.ai` and `cli-chat-proxy.grok.com` on the standard port, non-forward
Responses dispatch also accepts a nonblank string child result and turns it into one
`input_text` part. The original string, including leading/trailing whitespace and newlines,
is preserved. Other destinations keep string-valued agent messages unchanged. Empty or
whitespace-only strings remain unchanged, as do incomplete and mixed encrypted/unknown shapes.
Encrypted and unknown content is not normalized; native encrypted tasks still require the
separate opt-in [task recovery](/reference/configuration/agents/#encrypted-v2-task-recovery).

Expand Down
14 changes: 12 additions & 2 deletions docs-site/src/content/docs/ru/reference/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,20 @@ interface ProviderAdapter {

## `openai-responses`

**Назначение:** OpenAI **Responses API**. **`passthrough: true`** — пересылает исходное тело
запроса и стримит ответ обратно **без преобразования**.
**Назначение:** OpenAI **Responses API**. **`passthrough: true`** — пересылает тело
запроса и ответ с преобразованиями совместимости для выбранного провайдера.
**Аутентификация:** `forward` (ретрансляция заголовков вызывающей стороны) или `key`.

При `authMode`, отличном от `"forward"`, элементы Codex `agent_message` с непустым
массивом поддерживаемых открытых частей преобразуются в обычные сообщения пользователя.
Содержимое и читаемые поля author/recipient сохраняются. Для HTTPS `api.x.ai` и
`cli-chat-proxy.grok.com` на стандартном порту также поддерживается непустой строковый
результат дочерней задачи: он становится частью `input_text` без удаления пробелов и
переносов строк. Другие адреса сохраняют строковые элементы без изменений. Пустые строки,
зашифрованное содержимое и смешанные массивы с неизвестными или зашифрованными частями
не преобразуются частично. При `authMode: "forward"` элементы `agent_message` остаются
без изменений.

При `key`-аутентификации [`retryOn429`](/ru/reference/configuration/) действует и здесь: 429 до
начала потока ждёт и, до любой другой обработки или фейловера, повторяет идентичный запрос на
том же ключе, как и в переводимом пути `openai-chat`/Anthropic. Пользовательские транспорты
Expand Down
Loading
Loading