Skip to content
Closed
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
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/fr/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Il s'agit d'un réétiquetage large et destructif : chaque fil contenant un mess

### `ocx recover-history --ocx-compaction <thread-id> --yes`

Réparez l'historique d'une tâche compactée par un fournisseur routé avant de la reprendre avec Codex natif. La commande sélectionne exactement une tâche par UUID, enregistre d'abord une sauvegarde privée octet par octet, puis convertit uniquement l'état de compaction `ocx1:` propre à OpenCodeX en résumé ordinaire relisible par Codex natif. Le contenu chiffré natif et les autres tâches restent inchangés. Fermez la tâche sélectionnée avant d'exécuter la commande ; toute modification simultanée du rollout interrompt la récupération sans remplacer le fichier.
Réparez l'historique d'une tâche compactée par un fournisseur routé avant de la reprendre avec Codex natif. La commande sélectionne exactement une tâche par UUID, enregistre d'abord une sauvegarde privée octet par octet, puis convertit uniquement l'état de compaction `ocx1:`/`ocx2:` propre à OpenCodeX en résumé ordinaire relisible par Codex natif. Le contenu chiffré natif et les autres tâches restent inchangés. Fermez la tâche sélectionnée avant d'exécuter la commande ; toute modification simultanée du rollout interrompt la récupération sans remplacer le fichier.

### `ocx uninstall` · `ocx remove`

Expand Down
6 changes: 3 additions & 3 deletions docs-site/src/content/docs/guides/codex-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,10 @@ other providers keep their defaults.
Authenticated loopback routing normally keeps Codex on its built-in `openai` provider identity.
That preserves native thread identity, but it also makes Codex request native remote compaction.
When a routed provider cannot return a native compaction blob, OpenCodeX stores the summary in its
own `ocx1:` envelope. Native ChatGPT cannot verify that envelope if OpenCodeX is later removed from
own `ocx1:`/`ocx2:` envelope. Native ChatGPT cannot verify that envelope if OpenCodeX is later removed from
the request path.

On an authenticated loopback route, enable client-side compaction to keep V2 sub-agent routing while preventing new `ocx1:` compaction summaries. Non-loopback and API-key routes retain their existing provider and authentication behavior:
On an authenticated loopback route, enable client-side compaction to keep V2 sub-agent routing while preventing new `ocx1:`/`ocx2:` compaction summaries. Non-loopback and API-key routes retain their existing provider and authentication behavior:

```bash
ocx system settings --client-compaction on # or "codexClientCompaction": true in config.json
Expand Down Expand Up @@ -495,7 +495,7 @@ selected provider. V2 sub-agent requests keep their existing provider selection
accounting. Client-side compaction does not change plaintext delivery, encrypted task passthrough
through `allowEncryptedV2AgentTasks`, or configured recovery and fallback behavior.

This preference affects future compactions only, and it rewrites no existing `ocx1:` payload in
This preference affects future compactions only, and it rewrites no existing `ocx1:`/`ocx2:` payload in
any configuration, so use the explicit history recovery workflow for a thread that needs one.

Whether resume-history metadata is re-tagged depends on which form the injection takes. On its
Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/ja/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ocx eject back

### `ocx recover-history --ocx-compaction <thread-id> --yes`

ルーティングされたプロバイダーで圧縮されたタスクをネイティブ Codex で再開する前に、その履歴を修復します。このコマンドは UUID で 1 つのタスクだけを選択し、非公開のバイト単位バックアップを保存してから、OpenCodeX 所有の `ocx1:` 圧縮状態だけをネイティブ Codex が再生できる通常の要約に変換します。ネイティブの暗号化コンテンツと他のタスクは変更しません。実行前に対象タスクを閉じてください。処理中に rollout が変更された場合、ファイルを置き換えずに修復を中止します。
ルーティングされたプロバイダーで圧縮されたタスクをネイティブ Codex で再開する前に、その履歴を修復します。このコマンドは UUID で 1 つのタスクだけを選択し、非公開のバイト単位バックアップを保存してから、OpenCodeX 所有の `ocx1:`/`ocx2:` 圧縮状態だけをネイティブ Codex が再生できる通常の要約に変換します。ネイティブの暗号化コンテンツと他のタスクは変更しません。実行前に対象タスクを閉じてください。処理中に rollout が変更された場合、ファイルを置き換えずに修復を中止します。

### `ocx uninstall`・`ocx remove`

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/ko/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ dedicated-provider history도 포함됩니다. 상태를 백업하고 이 전체

### `ocx recover-history --ocx-compaction <thread-id> --yes`

라우팅된 provider를 통해 압축된 작업을 native Codex에서 다시 열기 전에 해당 기록을 복구합니다. 이 명령은 UUID로 정확히 하나의 작업을 선택하고 비공개 바이트 단위 백업을 저장한 뒤, OpenCodeX가 소유한 `ocx1:` 압축 상태만 native Codex가 재생할 수 있는 일반 요약으로 변환합니다. native 암호화 콘텐츠와 다른 작업은 변경하지 않습니다. 실행 전에 선택한 작업을 닫으십시오. 처리 중 rollout이 변경되면 파일을 교체하지 않고 복구를 중단합니다.
라우팅된 provider를 통해 압축된 작업을 native Codex에서 다시 열기 전에 해당 기록을 복구합니다. 이 명령은 UUID로 정확히 하나의 작업을 선택하고 비공개 바이트 단위 백업을 저장한 뒤, OpenCodeX가 소유한 `ocx1:`/`ocx2:` 압축 상태만 native Codex가 재생할 수 있는 일반 요약으로 변환합니다. native 암호화 콘텐츠와 다른 작업은 변경하지 않습니다. 실행 전에 선택한 작업을 닫으십시오. 처리 중 rollout이 변경되면 파일을 교체하지 않고 복구를 중단합니다.

### `ocx uninstall` · `ocx remove`

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ intended.

Repair one thread that was compacted through a routed provider before resuming it through native
Codex. The command reads the exact thread selected by UUID, saves a private byte-for-byte backup,
then converts only OpenCodeX-owned `ocx1:` compaction state into a plain summary that native Codex
then converts only OpenCodeX-owned `ocx1:`/`ocx2:` compaction state into a plain summary that native Codex
can replay. Native encrypted content and other threads are left unchanged. Close the selected
thread before running the command; a concurrent rollout change makes recovery stop without
replacing the file.
Expand Down
60 changes: 60 additions & 0 deletions docs-site/src/content/docs/reference/configuration/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,66 @@ without tool declarations. This changes only the summary request, not stored his
compaction; a failed summary does not replace the history. Restart the proxy after editing
`config.json` by hand. Dashboard saves apply immediately.

### Reasoning retention during compaction

Readable reasoning retention is an advanced, explicit opt-in and is **off by default**.
Only `reasoningRetention.enabled: true` enables it; an omitted block, `enabled: false`,
or legacy limits without `enabled: true` leave ordinary compaction behavior unchanged.
When enabled for routed v1 `POST /v1/responses/compact` and routed v2 `compaction_trigger` requests, readable reasoning stays local while the selected
model summarizes other context. After a readable summary succeeds, exact retained text returns
alongside it in framed historical context messages, not as new assistant reasoning or instructions.
Repeated compaction withholds those messages again. Ordinary subsequent turns replay them as history.

```json
{
"reasoningRetention": {
"enabled": true,
"maxContextPercent": 20,
"maxTokens": 100000
}
}
```

Both limit fields are optional and, **when enabled**, default at runtime to `20` percent and `100000` estimated tokens.
The effective limit is the smaller of the percentage of the compacting model's context window
and the absolute token cap; when the context window is unknown, only the absolute cap applies.
The estimate includes each retained message's historical-context frame, not just its reasoning text.
Above the limit, readable text is written verbatim under the resolved OpenCodex home's
`reasoning-archive/` (normally `~/.opencodex/reasoning-archive/`). The summarizer receives a
path note instead of the text, and the finished readable summary includes a notice naming that file.
New archives are private to the user on POSIX. An archive is provisional until a readable summary
returns its path: failures, cancellation, invalid summaries, and opaque compaction responses remove
the current attempt's file. Internal retries reuse it; previously successful archives are preserved.
Failed compaction returns no replacement history.

The percentage/token limits bound reasoning returned in context, **not cumulative archive storage**.
Each archive contains only readable reasoning admitted in that request; request admission is bounded
by `maxInboundBodyBytes` (256 MiB by default, configurable up to 512 MiB), plus small block separators.
There is **no aggregate archive byte/file limit, automatic expiry, or background archive cleanup**.
Successful archives remain until you manually delete their files, including after disabling retention
or resetting the setting. They are plaintext, contain potentially sensitive conversation reasoning,
and share the resolved OpenCodex home of that proxy instance. Deleting an archive makes any existing
path notice unable to recover its contents; save anything you need first. A process crash or failed
filesystem write/cleanup can also leave a provisional file requiring manual cleanup.

**Dashboard → Overview → Advanced settings → Reasoning retention** provides the explicit switch
and both limits; **Reset and turn off** removes the override and switches retention off. GET/PUT `/api/settings` exposes `reasoningRetention`: null clears the block,
and omission preserves it. `enabled` must be a boolean when present. Percentages must be greater than 0 and at most 100; token caps must
be positive integers, and unknown fields are rejected. Invalid hand edits disable only this
block with a warning, keeping unrelated providers and settings.

Private provider ciphertext and signatures are not decrypted or copied into portable retained
messages. An upstream native opaque compaction response retains its exact output item and
ciphertext, without added retained messages or a rewritten summary. Native compact endpoints
keep their existing behavior.

Routed v2 still returns exactly one compaction item. Its proxy-owned `ocx2:` envelope stores
the summary and retained historical reasoning separately as JSON/Base64; this is encoding,
not provider encryption. Subsequent requests restore separate historical messages, and
repeated compaction withholds the reasoning again. Old `ocx1:` summaries remain supported.
Opt-in emergency compaction recovery also preserves this separation for JSON and SSE.
Explicit native-history recovery restores separate summary and historical reasoning messages too.

## Memory routing

In **Dashboard → Overview → Memory routing**, choose a model and an optional reasoning effort for
Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/ru/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ocx eject back

### `ocx recover-history --ocx-compaction <thread-id> --yes`

Исправьте историю одной задачи, сжатой через маршрутизируемого провайдера, перед её возобновлением в нативном Codex. Команда выбирает ровно одну задачу по UUID, сначала сохраняет приватную побайтовую резервную копию, а затем преобразует только принадлежащее OpenCodeX состояние сжатия `ocx1:` в обычную сводку, которую может воспроизвести нативный Codex. Нативное зашифрованное содержимое и другие задачи не изменяются. Перед запуском закройте выбранную задачу; если rollout изменится во время обработки, восстановление остановится без замены файла.
Исправьте историю одной задачи, сжатой через маршрутизируемого провайдера, перед её возобновлением в нативном Codex. Команда выбирает ровно одну задачу по UUID, сначала сохраняет приватную побайтовую резервную копию, а затем преобразует только принадлежащее OpenCodeX состояние сжатия `ocx1:`/`ocx2:` в обычную сводку, которую может воспроизвести нативный Codex. Нативное зашифрованное содержимое и другие задачи не изменяются. Перед запуском закройте выбранную задачу; если rollout изменится во время обработки, восстановление остановится без замены файла.

### `ocx uninstall` · `ocx remove`

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/tr/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ dahildir. Durumu yedekleyin ve yalnızca bu kapsamın tamamını istiyorsanız

### `ocx recover-history --ocx-compaction <thread-id> --yes`

Yönlendirilmiş bir sağlayıcı üzerinden sıkıştırılmış bir görevi yerel Codex ile sürdürmeden önce geçmişini onarın. Komut UUID ile yalnızca bir görevi seçer, önce özel ve bayt bayt bir yedek kaydeder, ardından yalnızca OpenCodeX'e ait `ocx1:` sıkıştırma durumunu yerel Codex'in yeniden oynatabileceği düz bir özete dönüştürür. Yerel şifreli içerik ve diğer görevler değişmeden kalır. Komutu çalıştırmadan önce seçili görevi kapatın; işlem sırasında rollout değişirse kurtarma dosyayı değiştirmeden durur.
Yönlendirilmiş bir sağlayıcı üzerinden sıkıştırılmış bir görevi yerel Codex ile sürdürmeden önce geçmişini onarın. Komut UUID ile yalnızca bir görevi seçer, önce özel ve bayt bayt bir yedek kaydeder, ardından yalnızca OpenCodeX'e ait `ocx1:`/`ocx2:` sıkıştırma durumunu yerel Codex'in yeniden oynatabileceği düz bir özete dönüştürür. Yerel şifreli içerik ve diğer görevler değişmeden kalır. Komutu çalıştırmadan önce seçili görevi kapatın; işlem sırasında rollout değişirse kurtarma dosyayı değiştirmeden durur.

### `ocx uninstall` · `ocx remove`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ocx eject back

### `ocx recover-history --ocx-compaction <thread-id> --yes`

在通过原生 Codex 恢复某个曾由路由提供方压缩的任务前,修复该任务的历史记录。此命令按 UUID 精确选择一个任务,先保存私有的逐字节备份,然后仅将 OpenCodeX 自有的 `ocx1:` 压缩状态转换为原生 Codex 可重放的普通摘要。原生加密内容和其他任务保持不变。运行前请关闭所选任务;如果 rollout 在处理期间发生变化,恢复会停止且不会替换原文件。
在通过原生 Codex 恢复某个曾由路由提供方压缩的任务前,修复该任务的历史记录。此命令按 UUID 精确选择一个任务,先保存私有的逐字节备份,然后仅将 OpenCodeX 自有的 `ocx1:`/`ocx2:` 压缩状态转换为原生 Codex 可重放的普通摘要。原生加密内容和其他任务保持不变。运行前请关闭所选任务;如果 rollout 在处理期间发生变化,恢复会停止且不会替换原文件。

### `ocx uninstall` · `ocx remove`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ocx eject back

### `ocx recover-history --ocx-compaction <thread-id> --yes`

在透過原生 Codex 恢復曾由路由提供方壓縮的工作前,修復該工作的歷史記錄。此命令依 UUID 精確選取一個工作,先儲存私有的逐位元組備份,然後只把 OpenCodeX 自有的 `ocx1:` 壓縮狀態轉換成原生 Codex 可重播的普通摘要。原生加密內容與其他工作不會變更。執行前請關閉所選工作;若 rollout 在處理期間發生變化,復原會停止且不會取代原始檔案。
在透過原生 Codex 恢復曾由路由提供方壓縮的工作前,修復該工作的歷史記錄。此命令依 UUID 精確選取一個工作,先儲存私有的逐位元組備份,然後只把 OpenCodeX 自有的 `ocx1:`/`ocx2:` 壓縮狀態轉換成原生 Codex 可重播的普通摘要。原生加密內容與其他工作不會變更。執行前請關閉所選工作;若 rollout 在處理期間發生變化,復原會停止且不會取代原始檔案。

### `ocx uninstall` · `ocx remove`

Expand Down
Loading
Loading