Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b1a785a
feat(ocx-child): name the link in the CODEX_HOME owner record and add…
lidge-jun Nov 13, 2026
b9a67b8
feat(link): keep a tombstone for force-revoked ephemeral links and ad…
lidge-jun Nov 13, 2026
0338043
feat(cli): ocx link recover, its capability, docs and structure
lidge-jun Nov 13, 2026
cebd9c7
fix(link): recover never restores another link, settles a lost receip…
lidge-jun Nov 13, 2026
4265e7f
fix(link): settle a lost recover answer only on the Child's link-boun…
lidge-jun Nov 13, 2026
13e46f7
fix(ocx-child): guard the shared planted binary and bind restore rece…
lidge-jun Nov 13, 2026
c6c3dd6
fix(link): keep the in-use lock file, honour a kept binary on rollbac…
lidge-jun Nov 13, 2026
0238489
fix(link): the receipt read trusts an absent binary only below search…
lidge-jun Nov 13, 2026
abfebe8
feat(cli): advertise link.recover/1 in ocx capabilities --contracts
lidge-jun Nov 13, 2026
c0763b1
Merge origin/dev (explicit exclusive route, #8615) and recover over it
lidge-jun Nov 13, 2026
b599e27
test(link): recover's platform probe and receipt read go over the exp…
lidge-jun Nov 13, 2026
77f9d97
fix(link): pass the link id to the Windows recover scripts as data, n…
lidge-jun Nov 13, 2026
a324e94
fix(link): bound tombstones with list and forget, settle them on unco…
lidge-jun Nov 13, 2026
e440e3d
fix(link): forget a tombstone only from the CLI on the Home while its…
lidge-jun Nov 13, 2026
75b5c2a
Merge origin/dev (O1 #8623) into feat/child-owner-link-recover
lidge-jun Nov 13, 2026
4f994f5
fix(link): take the alias lock for apply and revoke whenever a tombst…
lidge-jun Nov 13, 2026
698c8cc
Merge origin/dev into feat/child-owner-link-recover
lidge-jun Nov 13, 2026
4053ddd
docs(link): mirror ocx link recover into the Spanish guide and lifecy…
lidge-jun Nov 13, 2026
7176385
Merge remote-tracking branch 'origin/dev' into feat/child-owner-link-…
lidge-jun Nov 13, 2026
2b82943
Merge branch 'dev' into feat/child-owner-link-recover
lidge-jun Nov 13, 2026
7af53ca
Merge remote-tracking branch 'origin/dev' into feat/child-owner-link-…
lidge-jun Nov 13, 2026
b2e6af2
fix(link): write a forced revoke's tombstone before its first journal…
lidge-jun Nov 13, 2026
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
5 changes: 5 additions & 0 deletions docs-site/src/content/docs/es/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ ocx link diagnostics [--limit <n>] [--since <iso-time|epoch-ms>] [--json]
ocx link revoke --link-id <id> [--operation-id <id>] [--json]
ocx link operations [--operation-id <id>] [--json]
ocx link operations resolve --operation-id <id> --yes [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link recover --list [--json]
ocx link recover --forget --link-id <id> --yes [--json]
ocx link reconnect --link-id <id> [--json]
ocx link routes --link-id <id> [--json]
ocx link routes add --link-id <id> --route <alias> [--position <n>] [--json]
Expand All @@ -225,6 +228,8 @@ ocx link policy [--updates off|notify|auto-when-idle] [--catalog-fanout auto|man

Una ruta explícita y exclusiva está destinada a quienes configuran por sí mismos la ruta SSH, por ejemplo un hub que aprovisiona un equipo desechable. `ocx link add <alias> --proxy-command <command> --ssh-user <user> --ssh-port <port> --exclusive` pasa ese ProxyCommand, usuario y puerto a ssh en la línea de comandos para cada comando y túnel del enlace, de modo que una edición posterior de `~/.ssh/config` no puede cambiar la ruta del enlace; el enlace también rechaza las modificaciones de `ocx link routes`. El comando debe comenzar con una ruta absoluta y usar solo letras, dígitos y `. _ / : @ + , = -` en palabras separadas por espacios individuales; se rechazan tokens `%`, comillas y caracteres de shell. Nunca incluyas un token, contraseña o clave privada en el comando: todos los usuarios locales pueden verlo en la lista de procesos, se guarda en el archivo PID del túnel y se muestra en `ocx link status --json`. `--exclusive` por sí solo limita el enlace a su único alias sin cambiar cómo ssh llega a él.

`ocx link revoke --force` de un Child desechable (con `ocx-child` instalado) omite la limpieza remota, así que el Home conserva un registro de ese equipo hasta que `ocx link recover --link-id <id>` lo limpie cuando vuelva a responder. `ocx link recover --list` muestra esos registros. Cuando el equipo ya no existe, por ejemplo una VM en la nube destruida, `ocx link recover --forget --link-id <id> --yes`, ejecutado en el Home, elimina su registro sin contactarlo; ejecútelo usted mismo, porque OpenCodex lo rechaza desde un agente de programación o un runner de CI, y mientras el enlace siga existiendo. Pueden esperar como máximo 256 registros; por encima de ese límite se rechaza la revocación forzada de un Child desechable, y su enlace y su clave siguen activos, hasta que recupere u olvide algunos registros. Un Child con un `ocx-child` anterior al del Home no puede leer el registro de propiedad que escribió uno más reciente: instale una compilación actual antes de ejecutar allí cualquier comando del ciclo de vida.

Quien aprovisiona también puede registrar una inscripción: `ocx link add <alias> --expect-fingerprint <fp> --operation-id <id>` registra los identificadores de enlace y clave que creará antes de cambiar nada; repetir el mismo comando devuelve el resultado registrado (`committed`, `failed_clean`, `residual` o `unknown`) en vez de volver a inscribir. `--require-ephemeral` rechaza un Child con cualquier instalación completa de OpenCodex antes de instalar o cambiar nada. `ocx link revoke --operation-id <id>` registra la revocación de igual manera y `ocx link operations` muestra el registro; `ocx link operations resolve --operation-id <id> --yes` deja constancia de que se limpió o aceptó una operación residual o desconocida. Una revocación registrada que llegó al Child y terminó en `unknown` (un tiempo de espera agotado, una purga sin su informe, una escritura del registro que falló) puede haberlo desconectado o purgado, así que el Home mantiene caído el túnel de ese enlace, también tras reiniciarse, hasta que se resuelva la operación: `ocx link status` muestra el enlace como `failed` con el motivo `revoke_unsettled`, y `ocx link reconnect` responde `link_suspended` (código de salida 5) sin detener nada. Resolver la revocación permite que el túnel vuelva a conectarse. Si el Home se detuvo durante la revocación, su entrada queda en `open` y resolve la rechaza con `operation_not_resolvable`: repite la revocación con el mismo `--operation-id` y el mismo indicador `--purge`, y después resuélvela si termina en `unknown`.

<a id="related-guides"></a>
Expand Down
8 changes: 8 additions & 0 deletions docs-site/src/content/docs/es/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,14 @@ ocx link revoke --link-id lnk_0123456789abcdef --force --yes --json

`--force` requiere `--yes`; `--yes` solo no es válido. La revocación ordinaria no cambia. Un éxito forzado devuelve `{linkId,remoteCleanup:"skipped",recovery}`. En su lugar, un link-not-found idempotente informa de `remoteCleanup:"unverified"`. Ambos pueden salir con 0; estos hechos derivan de la intención de la CLI, no de un informe de limpieza del servidor. Ninguno de los dos significa que se intentara o confirmara una desconexión remota. Siga la instrucción de recuperación, `ocx disconnect` en el cliente remoto, cuando esa acción esté autorizada.

Una revocación forzada de un Child ligero (`ocx-child`) al que el Home llegó por SSH deja en el Home un registro (tombstone) con el enlace, su alias y su clave de host fijada; la instrucción de recuperación nombra entonces `ocx link recover`. Cuando ese equipo vuelva a responder, ejecute:

```bash
ocx link recover --link-id lnk_0123456789abcdef --json
```

El Home se conecta por el alias del enlace con la clave de host que registró (una clave cambiada se rechaza con `host_key_changed` antes de conectar) y ejecuta `disconnect --purge --expect-link <id>` del binario instalado. El Child restaura sus archivos de `~/.codex` y elimina el binario instalado solo cuando su estado y su registro de propiedad nombran ese enlace. Un éxito imprime `{linkId,outcome:"clean",purged:true}` y elimina el registro; `purged:false` significa que el Child restauró su estado pero conservó el binario instalado porque otro home de OpenCodex en ese equipo ejecuta un relay desde él, y el registro también se elimina. `child_residual` (salida 5) significa que el Child conserva registros que este comando no restaura, como un registro de propiedad escrito por un `ocx-child` anterior; ejecute `~/.cache/opencodex/bin/ocx-child detach` en ese equipo y vuelva a recuperar. `child_conflict` (salida 5) significa que el Child pertenece a otro enlace o a otro home de OpenCodex, y no se cambió nada. `--operation-id` recupera un Child que dejó una inscripción interrumpida; necesita el registro de operaciones del enlace y, de lo contrario, responde `operation_journal_unavailable`. La automatización puede detectar la compatibilidad con `ocx capabilities --contracts --json`: el array `contracts` contiene `link.recover/1`.

<a id="observe-remote-workspace-from-the-hub"></a>

## Observar el espacio de trabajo remoto desde el Hub
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/fr/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
5 changes: 5 additions & 0 deletions docs-site/src/content/docs/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ ocx link diagnostics [--limit <n>] [--since <iso-time|epoch-ms>] [--json]
ocx link revoke --link-id <id> [--operation-id <id>] [--json]
ocx link operations [--operation-id <id>] [--json]
ocx link operations resolve --operation-id <id> --yes [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link recover --list [--json]
ocx link recover --forget --link-id <id> --yes [--json]
ocx link reconnect --link-id <id> [--json]
ocx link routes --link-id <id> [--json]
ocx link routes add --link-id <id> --route <alias> [--position <n>] [--json]
Expand All @@ -217,6 +220,8 @@ An explicit, exclusive route is for callers that set up the SSH path themselves,

A provisioning caller can also journal an enrollment: `ocx link add <alias> --expect-fingerprint <fp> --operation-id <id>` records the link and key ids it will create before changing anything, and a repeat of the same command returns the recorded outcome (`committed`, `failed_clean`, `residual` or `unknown`) instead of enrolling again. `--require-ephemeral` refuses a Child that has any full OpenCodex install before anything is planted or changed. `ocx link revoke --operation-id <id>` journals a revoke the same way, and `ocx link operations` lists the journal; `ocx link operations resolve --operation-id <id> --yes` records that a residual or unknown operation was cleaned up or accepted. A journalled revoke that reached the Child and ended `unknown` (a timeout, a purge without its report, a journal write that failed) may have disconnected or purged it, so the Home keeps that link's tunnel down, across restarts too, until the operation is resolved: `ocx link status` shows the link `failed` with reason `revoke_unsettled`, and `ocx link reconnect` answers `link_suspended` (exit 5) without stopping anything. Resolving the revoke lets the tunnel reconnect. If the Home stopped during the revoke, its entry stays `open` and resolve refuses it with `operation_not_resolvable`: repeat the revoke with the same `--operation-id` and the same `--purge` flag, then resolve it if it ends `unknown`.

`ocx link revoke --force` of a disposable (planted `ocx-child`) Child skips the remote cleanup, so the Home keeps a record of that machine until `ocx link recover --link-id <id>` cleans it once it answers. `ocx link recover --list` shows those records. When the machine is gone for good, for example a destroyed cloud VM, `ocx link recover --forget --link-id <id> --yes`, run on the Home, drops its record without contacting it; run it yourself, since OpenCodex refuses it from a coding agent or a CI runner, and while the link still exists. At most 256 such records wait; beyond that a forced revoke of a disposable Child is refused, and its link and key stay active, until you recover or forget some records. A Child running an `ocx-child` older than the Home's cannot read the ownership record a newer one wrote: plant a current build on it before running any lifecycle command there.

`ocx link status` needs the local admin token on a listener that only this machine can reach. When the public listener is bound to a non-loopback address, for example a Hub on `0.0.0.0`, no TCP listener qualifies: the hub management listener is reached through Tailscale Serve, so it refuses the raw admin token for link routes. On macOS and Linux the proxy therefore also opens a private Unix socket, `<OPENCODEX_HOME>/run/control-<port>.sock`, in a directory only your user can enter, and `ocx link status` uses it automatically. The socket answers only `GET /api/link/status` and still requires the admin token. Windows and runtimes older than this change keep the TCP path, where the read returns `403` on such a Hub.

## Related guides
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/ja/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
28 changes: 28 additions & 0 deletions docs-site/src/content/docs/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,34 @@ these facts derive from CLI intent, not a server cleanup report. Neither means
remote disconnect was attempted or confirmed. Follow the recovery instruction,
`ocx disconnect` on the remote client, when that action is authorized.

A forced revoke of a lightweight (`ocx-child`) Child that the Home reached over
SSH leaves a tombstone on the Home naming the link, its alias and its pinned host
key; the recovery instruction then names `ocx link recover`. Once that machine
answers again, run:

```bash
ocx link recover --link-id lnk_0123456789abcdef --json
```

The Home connects over the link's alias with the host key it recorded (a changed
key refuses with `host_key_changed` before connecting) and runs the planted
binary's `disconnect --purge --expect-link <id>`. The Child restores its
`~/.codex` files and removes the planted binary only when its state and its
ownership record both name that link. Success prints
`{linkId,outcome:"clean",purged:true}` and removes the tombstone; `purged:false`
means the Child restored its state but kept the planted binary because another
OpenCodex home on that machine runs a relay from it, and the tombstone is removed
too. `child_residual`
(exit 5) means the Child keeps records this command does not restore, such as an
ownership record written by an older `ocx-child`; run
`~/.cache/opencodex/bin/ocx-child detach` on that machine, then recover again.
`child_conflict` (exit 5) means the Child belongs to another link or OpenCodex
home, and nothing was changed. `--operation-id` recovers a Child that an
interrupted enrollment left behind; it needs the link operation journal and
otherwise answers `operation_journal_unavailable`.
Automation can discover support with `ocx capabilities --contracts --json`: the
`contracts` array contains `link.recover/1`.

## Observe Remote Workspace from the Hub

```bash
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/ru/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/tr/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/zh-cn/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/content/docs/zh-tw/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ocx link port [--json]
ocx link issue --alias <alias> --tunnel-port <port> [--json]
ocx link status [--json]
ocx link revoke --link-id <id> [--json]
ocx link recover (--link-id <id> | --operation-id <id>) [--json]
ocx link reconnect --link-id <id> [--json]
ocx link check (--link-id <id> | --all) [--no-wait] [--json]
ocx link update (--link-id <id> | --all) --yes [--no-wait] [--json]
Expand Down
Loading
Loading