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
2 changes: 2 additions & 0 deletions docs-site/src/content/docs/guides/remote-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Connecting restarts OpenCodex on this computer. Codex turns that are already run

The Child waits for its configured port while the old process releases it. If a CLI-managed restart still fails, run `ocx start` on the Child and check `~/.opencodex/restart-handoff.log`. In the desktop app, the app starts and supervises the replacement automatically.

`ocx stop` on a Child stops its proxy and leaves Codex routing, the catalog and the Grok config in place, so `ocx start` (or `ocx service start`) brings the Child back unchanged. If `ocx status` on the Child reports that Codex routing is native, run `ocx sync --restart-codex`; `ocx start` does not rewrite a Child's Codex routing.

If **Child** says to pair this machine first, open this computer's configured literal-loopback HTTP dashboard, for example `http://127.0.0.1:<configured-port>`. The local pairing form appears only when pairing is missing and the dashboard and API use the same loopback origin. Copy the form's `ocx gui pair --origin "http://127.0.0.1:<configured-port>"` command, run it in a terminal on this computer, and paste the one-use code into the form. Use the exact origin shown in the form; a provider API key or admin token is not a pairing code. Missing pairing is separate from a configured-port mismatch.

On a Hub dashboard opened through a non-loopback address, the browser may have no loopback session or may have a shared session that cannot manage machine links. When Remote Link reports that session or permission problem, choose **Connect this dashboard to the hub** in the Remote Link page to open the one-time pairing form. Run the displayed command on the Hub and enter its code. The page validates the new session's Remote Link access before it closes the form.
Expand Down
8 changes: 7 additions & 1 deletion docs-site/src/content/docs/ja/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ ocx start --socks5-off

### `ocx stop`

実行中のプロキシを (PID によって) 停止し、PID ファイルを削除して、ネイティブ Codex を復元します。マネージド バックグラウンド サービスがインストールされている場合、`ocx stop` はそれを最初に停止するため、プロキシを再起動できません。Web ダッシュボードの **停止** ボタンは同じ処理 (`POST /api/stop`) を実行しますが、Windows タスク スケジューラだけは例外です。タスク終了後もラッパーがプロキシを再起動しうるため、ダッシュボードは `respawnable_service` で拒否し、何も変更せずに `ocx stop` の実行を促します。
実行中のプロキシを (PID によって) 停止し、PID ファイルを削除します。スタンドアロンの所有者ではネイティブ Codex を復元します。マネージド バックグラウンド サービスがインストールされている場合、`ocx stop` はそれを最初に停止するため、プロキシを再起動できません。Web ダッシュボードの **停止** ボタンは同じ処理 (`POST /api/stop`) を実行しますが、Windows タスク スケジューラだけは例外です。タスク終了後もラッパーがプロキシを再起動しうるため、ダッシュボードは `respawnable_service` で拒否し、何も変更せずに `ocx stop` の実行を促します。

接続済みの hub クライアントまたは Remote Link Child では、`ocx stop`(成功した API 停止を含む)は接続が所有する Codex のルーティング、モデルカタログ、Grok 設定を保持します。`ocx start` はルーティングを再注入せず、その設定で再び処理します。Codex を自身のアカウントへ戻すには `ocx disconnect`、既にネイティブルーティングへ戻した後の再適用には `ocx sync --restart-codex` を使います。

互換性を確認できない古い通常プロキシは、サービスやプロセスを停止する前に拒否されます。監視元からランタイムを更新・再起動して再試行してください。

既に停止済みのクライアントでは、サービス管理側が非アクティブで、既知のローカル接続先にランタイムが存在しないことを確認してから、通常の未実行結果を返します。

### `ocx restart`

Expand Down
8 changes: 7 additions & 1 deletion docs-site/src/content/docs/ko/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ocx start --socks5-off

### `ocx stop`

실행 중인 프록시를 PID 기준으로 중지하고, PID 파일을 삭제한 뒤 기본 Codex를 복원합니다. 관리형
실행 중인 프록시를 PID 기준으로 중지하고 PID 파일을 삭제합니다. 독립 실행 소유자라면 기본 Codex를 복원합니다. 관리형
백그라운드 서비스가 설치되어 있으면 `ocx stop`이 먼저 그 서비스를 중지하므로 프록시가 다시
올라올 수 없습니다. 웹 대시보드의 **Stop** 버튼도 같은 동작(`POST /api/stop`)을 하지만, Windows 작업 스케줄러는 예외입니다. 작업이 끝나도 래퍼가 프록시를 다시 띄울 수 있어서, 대시보드는 `respawnable_service`로 거절하고 아무것도 바꾸지 않은 채 `ocx stop` 실행을 안내합니다.

Expand All @@ -54,6 +54,12 @@ ocx start --socks5-off
넘어가지 않습니다. 영수증에 근거한 지연 복원도 최종 복원과 영수증 정리를 부모가 담당하며,
부모의 공유 설정 복원이 실패하면 종료 실패로 남기고 미완료 영수증을 보존합니다.

연결된 hub 클라이언트나 Remote Link Child에서는 성공한 API 종료를 포함해 `ocx stop`이 연결 소유의 Codex 라우팅, 모델 카탈로그와 Grok 설정을 보존합니다. `ocx start`는 라우팅을 다시 주입하지 않고 보존한 설정으로 서비스를 재개합니다. Codex를 자체 계정으로 돌리려면 `ocx disconnect`를, 이미 기본 라우팅으로 복원했다면 다시 연결하려고 `ocx sync --restart-codex`를 실행하세요.

보존 기능을 확인할 수 없는 오래된 일반 프록시는 서비스나 프로세스를 중지하기 전에 거절합니다. 런타임을 관리하는 앱이나 서비스에서 업데이트·재시작한 뒤 다시 시도하세요.

이미 중지된 클라이언트는 서비스 관리자가 비활성이고 알려진 로컬 주소에 런타임이 없음을 확인한 뒤 정상적인 미실행 결과를 반환합니다.

### `ocx restart`

프록시가 실행 중이면 확인된 정확한 PID와 포트에 in-place 재시작을 요청하고, 정상 드레인을
Expand Down
13 changes: 12 additions & 1 deletion docs-site/src/content/docs/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,19 @@ ocx start --socks5-off

### `ocx stop [--json]`

Stop the running proxy (by PID), remove the PID file, and restore native Codex. If a managed
Stop the running proxy (by PID), remove the PID file, and restore native Codex for standalone owners. If a managed
background service is installed, `ocx stop` also stops it first so it cannot respawn the proxy.
On a connected client (a Remote Link Child or a hub client), `ocx stop` leaves Codex routing, its
model catalog and the Grok config as they are, including after a successful API stop: the connection
owns them, and `ocx start` serves them again without re-injecting routing. Use `ocx disconnect` to hand Codex back to its own account. If Codex on a connected
client already reads native routing, `ocx status` names `ocx sync --restart-codex` to point it back.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
A connected stop verifies the local runtime before changing its service: a client-role listener
with the matching PID is supported, while an ordinary proxy must explicitly advertise preservation
across API, signal and service shutdown. Older or unverified ordinary runtimes are refused before
stop actions. Update/restart that runtime through its supervisor and retry; use `ocx disconnect`
only when you intend to release the connection-owned integrations.
Repeated stops of an already-stopped client confirm service-manager inactivity and absence at the
known local endpoints before returning the normal not-running result.
While the OpenCodex desktop app is running, `ocx stop` does not keep the proxy down: the app treats
it as an unexpected exit and starts a proxy again, within seconds for one it started and after about
a minute for one it had only attached to. Use the app's tray **Stop proxy** (for a proxy the app
Expand Down
8 changes: 7 additions & 1 deletion docs-site/src/content/docs/ru/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ ocx start --socks5-off

### `ocx stop`

Остановить работающий прокси (по PID), удалить PID-file и восстановить native Codex. Если
Остановить работающий прокси (по PID) и удалить PID-file; для автономного владельца также восстановить native Codex. Если
установлена managed background service, `ocx stop` сначала останавливает и её, чтобы она не
перезапустила прокси обратно. Кнопка **Stop** в веб-дашборде выполняет то же действие (`POST /api/stop`) на всех бэкендах, кроме планировщика заданий Windows: там обёртка может перезапустить прокси после завершения задачи, поэтому дашборд отказывает с `respawnable_service`, ничего не меняет и просит выполнить `ocx stop`.

На подключённом клиенте hub или Remote Link Child команда `ocx stop`, включая успешную остановку через API, сохраняет принадлежащие соединению маршрутизацию Codex, каталог моделей и конфигурацию Grok. `ocx start` снова обслуживает их, не внедряя маршрутизацию заново. Чтобы вернуть Codex к собственному аккаунту, выполните `ocx disconnect`; для повторного применения уже восстановленной нативной маршрутизации используйте `ocx sync --restart-codex`.

Старая обычная версия прокси без подтверждённой поддержки сохранения отклоняется до остановки службы или процесса. Обновите и перезапустите её через управляющий супервизор, затем повторите команду.

Для уже остановленного клиента команда подтверждает неактивность службы и отсутствие рантайма на известных локальных адресах, затем возвращает обычный результат «не запущен».

### `ocx restart`

Если прокси уже работает, команда запрашивает перезапуск на месте у точно аттестованных PID и
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ ocx start --socks5-off

### `ocx stop`

停止正在运行的代理(按 PID),移除 PID 文件,并恢复原生 Codex。如果安装了受管后台服务,`ocx stop` 还会先停止该服务,这样它就无法重新拉起代理。Web 仪表盘的 **Stop** 按钮在多数后端执行同样的操作(`POST /api/stop`),但 Windows 任务计划程序除外:任务结束后包装器仍可能重新拉起代理,只有运行在代理之外的 stop 才能在恢复客户端配置前确认这个重启窗口,因此仪表盘会以 `respawnable_service` 拒绝、不做任何更改,并提示改用 `ocx stop`。
停止正在运行的代理(按 PID),移除 PID 文件;独立运行的所有者还会恢复原生 Codex。如果安装了受管后台服务,`ocx stop` 还会先停止该服务,这样它就无法重新拉起代理。Web 仪表盘的 **Stop** 按钮在多数后端执行同样的操作(`POST /api/stop`),但 Windows 任务计划程序除外:任务结束后包装器仍可能重新拉起代理,只有运行在代理之外的 stop 才能在恢复客户端配置前确认这个重启窗口,因此仪表盘会以 `respawnable_service` 拒绝、不做任何更改,并提示改用 `ocx stop`。

对于已连接的 hub 客户端或 Remote Link Child,`ocx stop`(包括成功的 API 停止)会保留连接所拥有的 Codex 路由、模型目录和 Grok 配置。`ocx start` 使用这些保留的配置恢复服务,不会重新注入路由。要让 Codex 回到自己的账户,请运行 `ocx disconnect`;若已恢复为原生路由,要重新应用连接路由,请运行 `ocx sync --restart-codex`。

若旧版普通代理无法确认支持保留配置,命令会在停止服务或进程前拒绝操作。请通过管理该运行时的应用或服务更新并重启它,然后重试。

对于已停止的客户端,命令会确认服务管理器未活动且已知本地端点没有运行时,然后返回正常的“未运行”结果。

### `ocx restart`

Expand Down
10 changes: 7 additions & 3 deletions skills/ocx/references/01_management_surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ These answer in the CLI head and never reach the proxy, so they work with nothin

| Chapter | Declared capabilities |
|---|---|
| [lifecycle](01_surface_lifecycle.md) | 13 |
| [lifecycle](01_surface_lifecycle.md) | 14 |
| [providers-models](01_surface_providers-models.md) | 49 |
| [accounts](01_surface_accounts.md) | 42 |
| [agents-routing](01_surface_agents-routing.md) | 67 |
Expand Down Expand Up @@ -999,6 +999,10 @@ Original invocation order. These headings preserve links to the previous single-

[Read-oriented task](01_surface_integrations.md#ocx-integration-native-cursor-local-installer)

### `ocx stop`

[State-changing task](01_surface_lifecycle.md#ocx-stop)

### `ocx logs filter`

[Read-oriented task](01_surface_observe-system.md#ocx-logs-filter)
Expand Down Expand Up @@ -1497,6 +1501,6 @@ Original invocation order. These headings preserve links to the previous single-

## Counts

- declared capabilities: 362
- of those, state-changing: 221
- declared capabilities: 363
- of those, state-changing: 222
- head-resolved invocations: 2
23 changes: 22 additions & 1 deletion skills/ocx/references/01_surface_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Use these declarations to choose a task, then check its flags and authority before execution.
Non-mutating probes may still contact providers, consume quota or refresh caches.

Declared capabilities: 13.
Declared capabilities: 14.

### `ocx codex-provider`

Expand Down Expand Up @@ -100,6 +100,27 @@ State-changing: yes. JSON mode: `none`.

- The Aside refresh uses the live server; other catalog synchronization also performs local work.

### `ocx stop`

Usage: `ocx stop [--json]`

Stop the proxy; preserve connected-client integrations, restore native Codex config for standalone owners.

State-changing: yes. JSON mode: `envelope`.

| Method | Route |
|---|---|
| GET | `/api/stop` |
| POST | `/api/stop` |

| Flag | Value | Meaning |
|---|---|---|
| `--json` | boolean | Emit one structured stop summary; human output moves to stderr. |

- Connected clients verify runtime preservation support before stopping; unavailable or unsupported live targets refuse without stopping the service. Proven-stopped clients remain successful when the manager is inactive.
- Siblings and connected clients preserve shared integrations. Standalone owners restore native Codex configuration and remove the managed Grok block.
- JSON uses ocx-stop/1 and retains the same exit codes: 0, 1, 79 (history cleanup incomplete), 80 (teardown deferred).

### `ocx service install`

Usage: `ocx service install [--native|--scheduler]`
Expand Down
Loading
Loading