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
35 changes: 35 additions & 0 deletions devlog/_plan/260906_release_244_followups/050_combo_recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,38 @@ Before: a merely configured native target suppresses recovery even when not usab
Remote tests cover native disabled/cooldown, native 401 exhaustion, canonical summary exhausted with eligible account, noncanonical quota veto, caller eligibility, cooldown waiting, all targets unavailable skips recovery, recovery failure never dispatches plaintext/ciphertext, aborted recovery at both sites returns cancellation, no retry after client output. Preserve 32-inflight and no-persist safeguards where owned by recovery helper.
CodeRabbit HTTPS-only suggestion is assessed against existing http provider policy: do not invent combo-only URL permission changes. Record evidence-backed rebuttal or a narrowly necessary fix during P/security audit. This carry does not change provider URL policy or credentials. Exact-head CI + independent security review required; no live Kiro or local suites.


## Current composition and cancellation amendment

The lower stack PR #3753 is merged as b9f2acc82 from cd6d4d346 (full
CI34020474748 and independent security/final reviews passed). Source #3706 remains c311e9598; its source-only
patch applies cleanly to this foundation. Preserve every opaque preflight and
client-reader repair; only handleComboResponses changes in core.

At the initial unreadable-task recovery site, a false helper result returns 499
when the caller signal is aborted, otherwise the existing unreadable-task 400.
At native exhaustion, recheck caller cancellation after routed-target waiting and
recovery, before adopting the last native failure. A successful helper remains
one-shot; normal failed recovery preserves the prior failure and never dispatches
unreadable ciphertext or persists recovered plaintext. Add deterministic abort
fixtures at both recovery sites using the existing fake upstream boundary.

Canonical forward providers defer account/model quota admission to the existing
native selector; caller eligibility, target cooldowns and attempted exclusions
still apply. Noncanonical hosts and third-party cached quota remain filtered.

No combo-only HTTPS restriction is added: this routes recovered content through
the same operator-configured provider transport as the already-supported all-routed
recovery case. Recovery credentials still go only to its existing fixed backend,
and explicit opt-in, loopback/caller guards and no-persist policy remain unchanged.
Introducing a new URL policy only for this combo branch would contradict the
existing configured-provider contract without evidence of a distinct boundary.

Also update the English guides/sub-agent-surface.md paragraph that currently says
combo routing is unchanged and native-only. The configuration pages alone would
leave that guide contradicting the newly reachable opt-in routed recovery path.

The parent now also preserves native preflight read resets/cancellation and
tee/eager failed terminal accounting, including semantic streamAborted parity.
The combo delta remains unchanged through that cascade; a fresh composition
review confirmed the same patch and the complete child runtime passed CI34020475627.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Mixed combo recovery implementation

The carry changes only combo selection in core and provider usability in the
combo resolver. A selectable native target keeps priority. If native candidates
are unavailable or exhausted, an available routed target may be selected after
one explicitly enabled encrypted-task recovery. Existing caller admission,
fixed recovery backend, attempt exclusions and plaintext no-persistence remain.

Canonical native quota belongs to account/model selection; cached summaries keep
filtering third-party and noncanonical providers. Both initial and late recovery
failures recheck caller cancellation, including cancellation during target waiting,
before returning an unreadable-task or prior native error.

Original contributor tests cover disabled/cooldown/native-401, failed recovery,
unavailable targets, canonical/noncanonical quota and eligibility. The new paired
abort fixture waits for the recovery fetch to start, then cancels its actual signal;
499/client_cancelled, no routed call and empty cache/continuation stores are asserted.
No local suites/typecheck/build or live Kiro request are used. Hosted exact-head CI
and independent source/security/final reviews supply integration evidence.

## Verified composition

- Source fd5e90f1b and regressions cd054d926 passed independent source/security
and final reviews. The initial full hosted run was CI34019564577.
- Parent #3753 required a separate repair cycle for preflight read failures and
tee EOF account outcomes. That repair is merged on dev as b9f2acc82; source
cd6d4d346 passed CI34020474748 and its two review threads are resolved.
- The resulting child e1f5a5b8d passed full CI34020475627. Stable patch ID
8b62ad9ebb675f63a6dd4933e22663b48e1d95f2 matches the original combo delta,
and a fresh composition review passed. This documentation closeout changes
no runtime or tests. Final PR-head checks remain visible on #3754.
- #3706 remains open until #3754 actually merges. Closure requires a fresh
merged-state and dev-ancestry check; a successful merge command is not assumed.

No local suite, typecheck, build or live Kiro call was used for these results.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Pour un tour enfant créé, l’ordre de repli est le suivant :

Les chaînes de repli propres à un rôle doivent résider dans la configuration d’opencodex. L’ajout de `model_fallback` dans `$CODEX_HOME/agents/*.toml` amène Codex 0.146+ à rejeter le fichier de rôle entier à cause de ce champ inconnu, puis à ignorer le rôle (#1190). Une ancienne ligne `model_fallback` dans le fichier TOML reste lue par souci de rétrocompatibilité, mais `ocx doctor` la signale.

opencodex ignore les candidats désactivés, non routables, en mauvais état, en période de temporisation ou ayant atteint le seuil de quota. L’instantané de disponibilité est mis en cache pendant `subagentModelFallbackPollMs`. Les tâches enfants chiffrées limitent la chaîne aux cibles ChatGPT natives canoniques et aux routes Responses directes avec authentification par clé explicitement approuvées via `allowEncryptedV2AgentTasks: true` ; si aucune ne peut consommer la charge chiffrée, la requête échoue au lieu d’envoyer un texte chiffré illisible à une autre destination. Les combos restent limités aux cibles natives canoniques.
opencodex ignore les candidats désactivés, non routables, en mauvais état, en période de temporisation ou ayant atteint le seuil de quota. L’instantané de disponibilité est mis en cache pendant `subagentModelFallbackPollMs`. Les tâches enfants chiffrées limitent la chaîne aux cibles ChatGPT natives canoniques et aux routes Responses directes avec authentification par clé explicitement approuvées via `allowEncryptedV2AgentTasks: true` ; si aucune ne peut consommer la charge chiffrée, la requête échoue au lieu d’envoyer un texte chiffré illisible à une autre destination. Un combo essaie d’abord une cible native canonique disponible ; si aucune n’est sélectionnable et que `agentTaskRecovery` est activé, un `NEW_TASK` chiffré est récupéré une fois avant l’envoi routé du combo.

```json
{
Expand Down Expand Up @@ -111,7 +111,7 @@ Ce mécanisme ne protège pas contre un autre processus exécuté sous le même

N’activez cette option que si la requête authentifiée supplémentaire, la consommation de quota, la présence de texte en clair dans le processus et la dépendance à un service privé sont acceptables. Dans le cas contraire, privilégiez un enfant ChatGPT natif ou une délégation hétérogène v1.

Ce mécanisme de récupération s’applique aux enfants routés directement. Au maximum 32 requêtes de récupération peuvent être actives simultanément ; toute absence supplémentaire dans le cache échoue de manière sûre. Pour les tâches chiffrées, le routage par combinaison conserve son filtre existant limité aux cibles natives et n’utilise pas la récupération.
Ce mécanisme de récupération s’applique aux enfants routés directement et aux `NEW_TASK` chiffrés d’un combo. Au maximum 32 requêtes de récupération peuvent être actives simultanément ; toute absence supplémentaire dans le cache échoue de manière sûre. Un combo disposant d’une cible native canonique disponible continue d’envoyer directement le texte chiffré ; la récupération ne s’exécute que si aucune cible native n’est sélectionnable. Un échec de récupération, l’épuisement des cibles ou leur indisponibilité conserve l’échec fermé sans transmettre le texte chiffré à un fournisseur routé.

## Plafonds d’effort

Expand Down
7 changes: 5 additions & 2 deletions docs-site/src/content/docs/guides/sub-agent-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ byte-for-byte fidelity is not guaranteed. It rejects generic/API-key proxy calle
`unreadable_encrypted_agent_task` on any failure. See
[Agent configuration: Encrypted v2 task recovery](/reference/configuration/agents/#encrypted-v2-task-recovery)
for the full trust boundary and configuration.
Combo routing remains unchanged and continues to consider only canonical native ChatGPT targets for
encrypted tasks.
Combo routing prefers a selectable canonical native ChatGPT target for encrypted tasks. If none
is usable, or native authorization attempts are exhausted, an explicitly enabled recovery may
make the task readable for one available routed target. All recovery trust and no-persistence
guards above still apply; a configured but disabled or cooling native target does not block this
fallback, and cancellation never becomes an unreadable-task error.
Comment thread
lidge-jun marked this conversation as resolved.
Comment on lines +172 to +176

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 Reconcile the contradictory combo guidance

This new paragraph says an encrypted combo can recover and dispatch to a routed target, but the same section still tells users at lines 150–151 that combos consider only canonical native targets and return HTTP 400 if none is available, while the following recovery-options list also omits combo recovery. Update those earlier statements so the canonical English documentation presents one consistent behavior.

AGENTS.md reference: docs-site/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.


## Rejected encrypted history

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ V1 ガイダンスは、`max` または `ultra` でのみプロアクティブ
拒否し、ロールをスキップします(#1190)。TOML 内のレガシー `model_fallback` 行は後方互換性の
ために引き続き読み取られますが、`ocx doctor` がそれをフラグ付けします。

opencodex は、無効、ルーティング不能、異常、冷却期間、またはクォータしきい値の候補をスキップします。可用性スナップショットは `subagentModelFallbackPollMs` に対してキャッシュされます。暗号化された子タスクでは、チェーンを正規のネイティブ ChatGPT ターゲットと、`allowEncryptedV2AgentTasks: true` で明示的に信頼された直接のキー認証 Responses ルートに制限します。暗号化されたペイロードを処理できる対象がない場合、読み取り不可能な暗号文を別の場所へ送らず、リクエストは失敗します。コンボは引き続き正規のネイティブ対象だけを使用します
opencodex は、無効、ルーティング不能、異常、冷却期間、またはクォータしきい値の候補をスキップします。可用性スナップショットは `subagentModelFallbackPollMs` に対してキャッシュされます。暗号化された子タスクでは、チェーンを正規のネイティブ ChatGPT ターゲットと、`allowEncryptedV2AgentTasks: true` で明示的に信頼された直接のキー認証 Responses ルートに制限します。暗号化されたペイロードを処理できる対象がない場合、読み取り不可能な暗号文を別の場所へ送らず、リクエストは失敗します。コンボはまず利用可能な正規ネイティブ対象を試し、選択できるネイティブ対象がなく `agentTaskRecovery` が有効な場合、暗号化された `NEW_TASK` をルーティングされたコンボ送信の前に一度だけ復旧します

```json
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ V1 안내는 `max` 또는 `ultra`에서만 선제 텍스트로 제공됩니다.
거부하고 역할을 건너뜁니다 (#1190). TOML의 기존 `model_fallback` 줄은 하위 호환성을 위해
계속 읽히지만 `ocx doctor`가 이를 표시합니다.

opencodex는 비활성, 라우팅 불가, 비정상, 쿨다운 중, 또는 할당량 임계값에 걸린 후보를 건너뜁니다. 사용 가능성 스냅샷은 `subagentModelFallbackPollMs` 동안 캐시됩니다. 암호화된 하위 작업은 정규 네이티브 ChatGPT 대상과 `allowEncryptedV2AgentTasks: true`로 명시적으로 신뢰한 직접 키 인증 Responses 라우트만 후보로 사용합니다. 암호화된 페이로드를 처리할 수 있는 대상이 없으면 읽을 수 없는 암호문을 다른 곳으로 보내지 않고 요청이 실패합니다. 콤보는 계속 정규 네이티브 대상만 사용합니다.
opencodex는 비활성, 라우팅 불가, 비정상, 쿨다운 중, 또는 할당량 임계값에 걸린 후보를 건너뜁니다. 사용 가능성 스냅샷은 `subagentModelFallbackPollMs` 동안 캐시됩니다. 암호화된 하위 작업은 정규 네이티브 ChatGPT 대상과 `allowEncryptedV2AgentTasks: true`로 명시적으로 신뢰한 직접 키 인증 Responses 라우트만 후보로 사용합니다. 암호화된 페이로드를 처리할 수 있는 대상이 없으면 읽을 수 없는 암호문을 다른 곳으로 보내지 않고 요청이 실패합니다. 콤보는 먼저 사용 가능한 정규 네이티브 대상을 시도하고, 선택 가능한 네이티브 대상이 없으며 `agentTaskRecovery`가 켜져 있으면 암호화된 `NEW_TASK`를 라우팅된 콤보 전송 전에 한 번 복구합니다.

```json
{
Expand Down
15 changes: 10 additions & 5 deletions docs-site/src/content/docs/reference/configuration/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ opencodex skips disabled, unroutable, unhealthy, cooling-down, or quota-threshol
availability snapshot is cached for `subagentModelFallbackPollMs`. Encrypted child tasks restrict
the chain to canonical native ChatGPT targets plus direct key-auth Responses routes explicitly
trusted with `allowEncryptedV2AgentTasks: true`; if none can consume the encrypted payload, the
request fails instead of routing unreadable ciphertext elsewhere. Combo routing remains
canonical-native-only.
request fails instead of routing unreadable ciphertext elsewhere. Combo routing first tries an
available canonical native target; when none is selectable and `agentTaskRecovery` is enabled,
an encrypted `NEW_TASK` is recovered once before routed combo dispatch.

```json
{
Expand Down Expand Up @@ -203,9 +204,13 @@ Enable this only when the additional authenticated request, quota use, plaintext
and private-backend dependency are acceptable. Prefer a native ChatGPT child or v1 heterogeneous
delegation when they are not.

This recovery path applies to direct-routed children. At most 32 recovery requests can be active at
once; additional misses fail closed. Combo routing keeps its existing native-only filter for
encrypted tasks and does not invoke recovery.
This recovery path applies to direct-routed children and encrypted combo `NEW_TASK` spawns. At
most 32 recovery requests can be active at once; additional misses fail closed. A combo with an
available canonical native target still sends ciphertext directly; recovery runs only when no
native target is selectable. After a stored Pool account's refresh and same-account replay are
exhausted, recovery can use the incoming caller credential for one available routed target without
trying another native account. Policy refusals remain terminal. Failed recovery, exhausted targets,
or unavailable targets still fail closed without forwarding ciphertext to a routed provider.

## Effort caps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ cooldown либо уже достигли порога quota. Availability-сн
native ChatGPT-target'ами и прямыми key-auth Responses-маршрутами, явно доверенными через
`allowEncryptedV2AgentTasks: true`. Если ни один из них не может обработать encrypted payload,
запрос завершается ошибкой вместо отправки нечитаемого ciphertext наружу. Combo по-прежнему
использует только канонические native-цели.
сначала выбирает доступную каноническую native-цель; если её нельзя выбрать и включён
`agentTaskRecovery`, encrypted `NEW_TASK` восстанавливается один раз перед routed combo dispatch.

```json
{
Expand Down
16 changes: 10 additions & 6 deletions docs-site/src/content/docs/tr/reference/configuration/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ görevlerinde zincir, kurallı yerel ChatGPT hedefleriyle ve
`allowEncryptedV2AgentTasks: true` kullanılarak açıkça güvenilen doğrudan anahtar
kimlik doğrulamalı Responses rotalarıyla sınırlıdır. Hiçbiri şifrelenmiş yükü
işleyemezse istek, okunamayan şifreli metni başka bir yere yönlendirmek yerine
başarısız olur. Kombolar yalnızca kurallı yerel hedefleri kullanmaya devam eder.
başarısız olur. Kombo önce kullanılabilir kurallı yerel hedefi dener; seçilebilir
yerel hedef kalmazsa ve `agentTaskRecovery` etkinse, şifrelenmiş `NEW_TASK` yönlendirilen
kombo gönderiminden önce bir kez kurtarılır.

```json
{
Expand Down Expand Up @@ -226,10 +228,13 @@ sınırı ve özel arka uç bağımlılığı kabul edilebilir olduğunda etkinl
Olmadıklarında yerel bir ChatGPT çocuğunu veya v1 heterojen yetkilendirmesini
tercih edin.

Bu kurtarma yolu doğrudan yönlendirilen çocuklara uygulanır. Aynı anda en fazla
32 kurtarma isteği etkin olabilir; ek ıskalamalar kapalı olarak başarısız olur.
Kombo yönlendirmesi şifrelenmiş görevler için mevcut yalnızca yerel filtresini
korur ve kurtarmayı çağırmaz.
Bu kurtarma yolu doğrudan yönlendirilen çocuklara ve bir kombodaki şifrelenmiş
`NEW_TASK` oluşturma isteklerine uygulanır. Aynı anda en fazla 32 kurtarma isteği
etkin olabilir; ek ıskalamalar kapalı olarak başarısız olur. Kullanılabilir kanonik
yerel hedefi olan bir kombo şifreli metni yine doğrudan gönderir; kurtarma yalnızca
seçilebilir yerel hedef kalmadığında çalışır. Kurtarma hatası, tükenen hedefler veya
kullanılamayan hedefler, şifreli metin yönlendirilen sağlayıcıya gönderilmeden yine
kapalı biçimde başarısız olur.

## Çaba sınırları

Expand All @@ -248,4 +253,3 @@ ile `xhigh` arasını sunar.

v1, varsayılan ve v2 davranışının yeni başlayanlara yönelik açıklaması için [Alt
ajan yüzeyleri](/tr/guides/sub-agent-surface/) sayfasına bakın.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ per-role fallback 链必须放在 opencodex 配置里。把 `model_fallback` 写
`$CODEX_HOME/agents/*.toml` 会让 Codex 0.146+ 把整个角色文件当作未知字段拒绝并跳过该角色
(#1190)。TOML 中的旧版 `model_fallback` 仍会被读取以保持向后兼容,但 `ocx doctor` 会标记它。

opencodex 会跳过已禁用、不可路由、不健康、处于冷却中,或已达到配额阈值的候选项。可用性快照会在 `subagentModelFallbackPollMs` 期间缓存。对于加密的子任务,候选链只包含规范的原生 ChatGPT 目标,以及通过 `allowEncryptedV2AgentTasks: true` 明确信任的直接密钥认证 Responses 路由。如果没有任何目标能处理加密载荷,请求就会失败,而不是把不可读的密文路由到别处。combo 仍然只使用规范的原生目标
opencodex 会跳过已禁用、不可路由、不健康、处于冷却中,或已达到配额阈值的候选项。可用性快照会在 `subagentModelFallbackPollMs` 期间缓存。对于加密的子任务,候选链只包含规范的原生 ChatGPT 目标,以及通过 `allowEncryptedV2AgentTasks: true` 明确信任的直接密钥认证 Responses 路由。如果没有任何目标能处理加密载荷,请求就会失败,而不是把不可读的密文路由到别处。combo 会先尝试可用的规范原生目标;如果没有可选择的原生目标且已启用 `agentTaskRecovery`,会在路由到 combo 目标前对加密的 `NEW_TASK` 恢复一次

```json
{
Expand Down
Loading
Loading