@bitkyc08/opencodex 2.100.3 → 2.100.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/AGENTS_INSTALL.md +23 -1
  2. package/bin/ocx.mjs +8 -1
  3. package/gui/dist/assets/{App-Dnb6VMsP.js → App-DcpyI78f.js} +20 -19
  4. package/gui/dist/assets/{Tray-BV4ms9U9.js → Tray-CzjPJprT.js} +1 -1
  5. package/gui/dist/assets/brand-mark-BTIi7e69.js +1 -0
  6. package/gui/dist/assets/index-DJxM-imn.css +2 -0
  7. package/gui/dist/assets/index-DVgU6S3y.js +138 -0
  8. package/gui/dist/assets/{segment-thumb-features-DXSidY6D.js → segment-thumb-features-Bn6Y-g3R.js} +1 -1
  9. package/gui/dist/classic/assets/{App-DA-scMPq.js → App-eYJAyNHM.js} +19 -18
  10. package/gui/dist/classic/assets/{Tray-BrHaVRAq.js → Tray-xHMYxLkV.js} +1 -1
  11. package/gui/dist/classic/assets/index-DSaVRW4F.js +138 -0
  12. package/gui/dist/classic/assets/quota-summary-DyzHlkFl.js +1 -0
  13. package/gui/dist/classic/index.html +1 -1
  14. package/gui/dist/index.html +2 -2
  15. package/native/ocx-child/src/cli.rs +5 -3
  16. package/native/ocx-child/src/codex_home.rs +1 -0
  17. package/package.json +2 -2
  18. package/src/adapters/anthropic/per-message-effort.ts +296 -0
  19. package/src/adapters/anthropic.ts +3 -0
  20. package/src/adapters/claude-cli/adapter.ts +1 -0
  21. package/src/adapters/devin/cloud-direct/chat.ts +71 -14
  22. package/src/adapters/google-errors.ts +14 -2
  23. package/src/adapters/qoder/adapter.ts +9 -1
  24. package/src/adapters/zed.ts +4 -2
  25. package/src/claude/desktop-remote-store.ts +60 -10
  26. package/src/cli/account-api.ts +4 -0
  27. package/src/cli/account-auth.ts +30 -2
  28. package/src/cli/account-extended.ts +33 -2
  29. package/src/cli/capabilities-access-remote.ts +3 -3
  30. package/src/cli/capabilities-accounts.ts +3 -3
  31. package/src/cli/capabilities-base.ts +11 -6
  32. package/src/cli/capabilities-observe-system.ts +2 -2
  33. package/src/cli/claude.ts +3 -3
  34. package/src/cli/disconnect-runtime.ts +16 -6
  35. package/src/cli/dispatch.ts +7 -1
  36. package/src/cli/index.ts +2 -2
  37. package/src/cli/link-apply-restart.ts +4 -2
  38. package/src/cli/link-routes.ts +4 -1
  39. package/src/cli/link.ts +5 -4
  40. package/src/cli/preflight-exemptions.ts +3 -0
  41. package/src/cli/registry.ts +5 -2
  42. package/src/cli/resolve.ts +23 -8
  43. package/src/cli/restart-failure.ts +11 -1
  44. package/src/cli/runtime-api.ts +4 -0
  45. package/src/cli/status.ts +4 -1
  46. package/src/cli/system-command.ts +1 -1
  47. package/src/cli/system-restart-client.ts +9 -3
  48. package/src/cli/system-settings-parity.ts +2 -1
  49. package/src/client/connect.ts +63 -9
  50. package/src/client/desktop-refusal.ts +38 -0
  51. package/src/client/lifecycle-lock.ts +29 -4
  52. package/src/client/runtime-restart.ts +27 -15
  53. package/src/client/runtime.ts +4 -2
  54. package/src/client/state.ts +14 -0
  55. package/src/codex/account-pause.ts +4 -0
  56. package/src/codex/account-runtime-state.ts +4 -0
  57. package/src/codex/auth-api/main-account-probe.ts +3 -1
  58. package/src/codex/auth-api/main-hard-lock-refusal-read.ts +172 -0
  59. package/src/codex/auth-context.ts +40 -2
  60. package/src/codex/catalog/build-entries.ts +10 -0
  61. package/src/codex/catalog/derive-entry.ts +7 -0
  62. package/src/codex/catalog/reserve-warn.ts +7 -5
  63. package/src/codex/catalog/reserve.ts +4 -3
  64. package/src/codex/catalog/retained-sync.ts +2 -0
  65. package/src/codex/catalog/routed-defaults.ts +35 -0
  66. package/src/codex/convergence.ts +2 -0
  67. package/src/codex/loopback-target.ts +22 -8
  68. package/src/codex/main-account.ts +88 -29
  69. package/src/codex/native-main-auth-file.ts +14 -0
  70. package/src/codex/native-main-credentials.ts +270 -0
  71. package/src/codex/native-main-owner.ts +3 -0
  72. package/src/codex/native-main-refresh-mode.ts +14 -1
  73. package/src/codex/quota.ts +63 -14
  74. package/src/combos/failover.ts +12 -1
  75. package/src/combos/index.ts +5 -0
  76. package/src/combos/resolve.ts +115 -19
  77. package/src/config/diagnostics.ts +3 -0
  78. package/src/config/live-reconcile.ts +6 -3
  79. package/src/config/load-degrade.ts +2 -0
  80. package/src/config/persisted-mutation.ts +2 -2
  81. package/src/config/persisted-projections.ts +18 -0
  82. package/src/config/process-state.ts +4 -3
  83. package/src/config/reserve-capability.ts +96 -0
  84. package/src/config/schema/config-schema.ts +6 -0
  85. package/src/config/schema/leaf-validators.ts +2 -0
  86. package/src/config/schema/routed-catalog-defaults.ts +49 -0
  87. package/src/config.ts +7 -7
  88. package/src/desktop-update/acquire.ts +202 -0
  89. package/src/desktop-update/cli.ts +168 -0
  90. package/src/desktop-update/drain.ts +40 -0
  91. package/src/desktop-update/headless.ts +285 -0
  92. package/src/desktop-update/image.ts +85 -0
  93. package/src/desktop-update/install.ts +53 -0
  94. package/src/desktop-update/msi.ts +72 -0
  95. package/src/desktop-update/release.ts +128 -0
  96. package/src/desktop-update/runtime.ts +155 -0
  97. package/src/desktop-update/staging.ts +118 -0
  98. package/src/desktop-update/trust.ts +45 -0
  99. package/src/generated/compatibility-version.json +246 -130
  100. package/src/images/fulfill-video.ts +3 -3
  101. package/src/images/loop.ts +6 -2
  102. package/src/images/plan.ts +147 -11
  103. package/src/images/types.ts +13 -4
  104. package/src/images/xai-video-client.ts +72 -10
  105. package/src/lib/gcp-adc.ts +48 -4
  106. package/src/lib/offline-resend.ts +150 -0
  107. package/src/lib/paced-stream.ts +3 -3
  108. package/src/lib/provider-outbound.ts +17 -6
  109. package/src/lib/request-failure-model.ts +2 -0
  110. package/src/lib/response-body-inactivity.ts +23 -1
  111. package/src/lib/upstream-retry.ts +38 -5
  112. package/src/link/explicit-route.ts +4 -4
  113. package/src/link/remote-windows.ts +79 -31
  114. package/src/link/residual-recovery.ts +20 -8
  115. package/src/messaging/budget.ts +23 -5
  116. package/src/messaging/rpc.ts +4 -4
  117. package/src/oauth/antigravity-risk.ts +126 -0
  118. package/src/oauth/generic-account-failover.ts +89 -18
  119. package/src/oauth/generic-session-affinity.ts +10 -3
  120. package/src/oauth/login-cli.ts +35 -1
  121. package/src/oauth/pool-kernel.ts +3 -3
  122. package/src/providers/anthropic-billing-refusal.ts +27 -3
  123. package/src/providers/google-vertex-model-discovery.ts +6 -1
  124. package/src/providers/model-rename-fields.ts +2 -0
  125. package/src/providers/quota/workbuddy.ts +6 -2
  126. package/src/providers/workbuddy-credit-balance.ts +125 -16
  127. package/src/responses/effort-history.ts +732 -0
  128. package/src/routing/history/integrity.ts +41 -4
  129. package/src/server/auth-cors.ts +13 -3
  130. package/src/server/codex-model-list.ts +2 -1
  131. package/src/server/direct-local-http.ts +26 -3
  132. package/src/server/index/link-listener.ts +20 -14
  133. package/src/server/index/serve-options.ts +1 -0
  134. package/src/server/index.ts +3 -2
  135. package/src/server/link-turn.ts +17 -5
  136. package/src/server/management/config-routes.ts +39 -3
  137. package/src/server/management/link-child-preflight.ts +1 -1
  138. package/src/server/management/link-route-edit.ts +20 -1
  139. package/src/server/management/oauth-account-routes.ts +22 -5
  140. package/src/server/management/provider-overwrite-carry.ts +3 -0
  141. package/src/server/management/provider-routes.ts +4 -4
  142. package/src/server/management/static-catalog-probe.ts +33 -0
  143. package/src/server/proxy-liveness.ts +54 -9
  144. package/src/server/relay.ts +6 -1
  145. package/src/server/request-log-conversation.ts +2 -2
  146. package/src/server/request-log.ts +5 -1
  147. package/src/server/reserve-capability-startup.ts +32 -0
  148. package/src/server/responses/adapter-delivery.ts +2 -0
  149. package/src/server/responses/adapter-dispatch.ts +31 -10
  150. package/src/server/responses/antigravity-fault-rotation.ts +24 -0
  151. package/src/server/responses/antigravity-validation-refusal.ts +43 -6
  152. package/src/server/responses/combo-selection-keepalive.ts +254 -0
  153. package/src/server/responses/core-combo.ts +24 -9
  154. package/src/server/responses/core-errors.ts +9 -6
  155. package/src/server/responses/core-options.ts +8 -0
  156. package/src/server/responses/core.ts +21 -0
  157. package/src/server/responses/estimated-usage.ts +115 -0
  158. package/src/server/responses/jev-model-invoke.ts +7 -2
  159. package/src/server/responses/passthrough-completion.ts +6 -3
  160. package/src/server/responses/passthrough-delivery.ts +47 -8
  161. package/src/server/responses/passthrough-dispatch.ts +3 -0
  162. package/src/server/responses/request-prepare.ts +9 -5
  163. package/src/server/responses/sidecar-execution.ts +5 -0
  164. package/src/service/desktop-supervision.d.mts +2 -0
  165. package/src/service/desktop-supervision.mjs +5 -0
  166. package/src/stall-timeout.ts +11 -0
  167. package/src/types/config.ts +15 -92
  168. package/src/types/provider.ts +13 -0
  169. package/src/types/request.ts +19 -0
  170. package/src/types/routed-catalog-defaults.ts +17 -0
  171. package/src/types/routing-profile.ts +90 -0
  172. package/src/types.ts +1 -0
  173. package/src/update/index.ts +1 -1
  174. package/src/usage/log.ts +14 -4
  175. package/src/usage/telemetry-contract.ts +1 -0
  176. package/src/web-search/passthrough-bridge.ts +7 -0
  177. package/gui/dist/assets/brand-mark-XOLJbomA.js +0 -1
  178. package/gui/dist/assets/index-DCdXsMyZ.js +0 -105
  179. package/gui/dist/assets/index-DQtCRNAw.css +0 -2
  180. package/gui/dist/classic/assets/index-BqOaGLf5.js +0 -105
  181. package/gui/dist/classic/assets/quota-summary-Dy5_wfTT.js +0 -1
@@ -35,8 +35,8 @@ export const CAPABILITIES: readonly Capability[] = [
35
35
  bannerLines: ["ocx chatgpt <sub> Experimental app-server shim: launch|restore|status (macOS)"],
36
36
  details: ["Default off; launch requires chatgptDesktop.appServerShim: true. Restore removes the generated launcher."],
37
37
  },
38
- {"command": ["link","probe"],"summary": "Probe an SSH host fingerprint and OpenCodex version without trusting it.","routes": [{"method": "POST","path": "/api/link/probe"}],"flags": [{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder of this user's or of the tool that chose the path; never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--json","value": "boolean","summary": "Emit alias, fingerprint, key type and version as JSON."}],"mutates": true,"json": "payload","usage": "ocx link probe <alias> [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--json]","details": ["Requires loopback admin authority on the Home. Stores only a temporary pending offer; does not persist host trust or issue a link key."]},
39
- {"command": ["link","add"],"summary": "Connect an SSH Child to this Home after confirming its fingerprint.","routes": [{"method": "POST","path": "/api/link/probe"},{"method": "POST","path": "/api/link/confirm-host"},{"method": "POST","path": "/api/link/apply"}],"flags": [{"name": "--expect-fingerprint","value": "string","summary": "Exact SHA256 host fingerprint; required without an interactive TTY."},{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder of this user's or of the tool that chose the path; never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--operation-id","value": "string","summary": "Journal the enrollment under this id (1-128 letters, digits, . _ : -): reserved ids, a mark per Home effect and the outcome; a repeat with the same id and parameters replays it. Needs --expect-fingerprint."},{"name": "--require-ephemeral","value": "boolean","summary": "Refuse (409 full_install_present) a Child where any runnable full ocx exists, before any plant, key or Child change."},{"name": "--json","value": "boolean","summary": "Emit the verified link result as JSON."}],"mutates": true,"json": "payload","usage": "ocx link add <alias> [--expect-fingerprint SHA256:…] [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--operation-id <id>] [--require-ephemeral] [--json]","details": ["Requires loopback admin authority on the Home. Without a fingerprint, requires a TTY and explicit yes after showing the offered fingerprint. Never prints the link key.","Preflights bound Child restart support and curl, connects, restarts once and verifies a fresh authenticated catalog relay before success. Post-connect failures can leave Child config; the failure names the attempt's link id, so run ocx disconnect --expect-link <id> there (the planted ocx-child's detach --expect-link <id> on a lightweight Child, ~/.cache/opencodex/bin/ocx-child or %LOCALAPPDATA%\\opencodex\\bin\\ocx-child.exe, which need not be on PATH) and, if it disconnected, ocx restart, before retrying: it acts only while the Child belongs to that link."]},
38
+ {"command": ["link","probe"],"summary": "Probe an SSH host fingerprint and OpenCodex version without trusting it.","routes": [{"method": "POST","path": "/api/link/probe"}],"flags": [{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder this user owns (its own, or one a tool made for it); never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--json","value": "boolean","summary": "Emit alias, fingerprint, key type and version as JSON."}],"mutates": true,"json": "payload","usage": "ocx link probe <alias> [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--json]","details": ["Requires loopback admin authority on the Home. Stores only a temporary pending offer; does not persist host trust or issue a link key."]},
39
+ {"command": ["link","add"],"summary": "Connect an SSH Child to this Home after confirming its fingerprint.","routes": [{"method": "POST","path": "/api/link/probe"},{"method": "POST","path": "/api/link/confirm-host"},{"method": "POST","path": "/api/link/apply"}],"flags": [{"name": "--expect-fingerprint","value": "string","summary": "Exact SHA256 host fingerprint; required without an interactive TTY."},{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder this user owns (its own, or one a tool made for it); never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--operation-id","value": "string","summary": "Journal the enrollment under this id (1-128 letters, digits, . _ : -): reserved ids, a mark per Home effect and the outcome; a repeat with the same id and parameters replays it. Needs --expect-fingerprint."},{"name": "--require-ephemeral","value": "boolean","summary": "Refuse (409 full_install_present) a Child where any runnable full ocx exists, before any plant, key or Child change."},{"name": "--json","value": "boolean","summary": "Emit the verified link result as JSON."}],"mutates": true,"json": "payload","usage": "ocx link add <alias> [--expect-fingerprint SHA256:…] [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--operation-id <id>] [--require-ephemeral] [--json]","details": ["Requires loopback admin authority on the Home. Without a fingerprint, requires a TTY and explicit yes after showing the offered fingerprint. Never prints the link key.","Preflights bound Child restart support and curl, connects, restarts once and verifies a fresh authenticated catalog relay before success. Post-connect failures can leave Child config; the failure names the attempt's link id. Before retrying, on a full install run ocx disconnect --expect-link <id> and, if it disconnected, ocx restart. A lightweight Child has no ocx: run its planted ocx-child's detach --expect-link <id> instead (~/.cache/opencodex/bin/ocx-child; in Command Prompt on Windows %LOCALAPPDATA%\\opencodex\\bin\\ocx-child.exe, or %USERPROFILE%\\.cache\\opencodex\\bin\\ocx-child.exe where LOCALAPPDATA is not set; a copy placed by hand in ~/.local/bin, or %USERPROFILE%\\.local\\bin on Windows; none need be on PATH). Either acts only while the Child belongs to that link. A build older than --expect-link refuses it before it acts: then leave a lightweight Child as it is, and on a full install run ocx disconnect and ocx restart only if ocx connect status --json shows that id, right after that check, and otherwise leave it as it is."]},
40
40
  {
41
41
  command: ["link","port"],
42
42
  summary: "Allocate a free loopback port for a remote home link.",
@@ -247,10 +247,15 @@ export const CAPABILITIES: readonly Capability[] = [
247
247
  { name: "--version", value: "string", summary: "Select an exact version for a plan or apply." },
248
248
  { name: "--expect-plan", value: "string", summary: "Require the apply plan to match this planToken." },
249
249
  { name: "--not-after", value: "string", summary: "Refuse mutation after this Unix millisecond deadline." },
250
+ { name: "--desktop", value: "boolean", summary: "Update a Windows Desktop installation headlessly (signature-verified MSI)." },
251
+ { name: "--check", value: "boolean", summary: "With --desktop, report the published and serving versions without installing." },
250
252
  ],
251
253
  mutates: true,
252
254
  json: "envelope",
253
- details: ["Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 previous version verified; 12 uncertain; 64 usage."],
255
+ details: [
256
+ "Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 previous version verified; 12 uncertain; 64 usage.",
257
+ "--desktop exit codes: 0 done or up to date; 1 nothing installed; 2 old runtime still serving or reboot pending; 3 installer uncertain; 64 usage.",
258
+ ],
254
259
  },
255
260
  {
256
261
  command: ["capabilities"],
@@ -313,11 +318,11 @@ export const CAPABILITIES: readonly Capability[] = [
313
318
  command: ["account","login"],
314
319
  summary: "Log in to an OAuth provider; Kiro can add a native device account.",
315
320
  routes: [{"method":"POST","path":"/api/oauth/login"},{"method":"GET","path":"/api/oauth/status"},{"method":"POST","path":"/api/oauth/login/code"},{"method":"POST","path":"/api/codex-auth/login"},{"method":"GET","path":"/api/codex-auth/login-status"},{"method":"POST","path":"/api/codex-auth/login/code"}],
316
- flags: [{"name":"--id","value":"string","summary":"Account ID; provider OAuth requires --reauth when supplied."},{"name":"--reauth","value":"boolean","summary":"Reauthenticate an existing account."},{"name":"--device","value":"boolean","summary":"Codex device flow or xAI device authorization; a no-op for already-device-native kimi, nous and github-copilot."},{"name":"--method","value":"string","summary":"Kiro only: builder-id, google or github; add-only and incompatible with --reauth, --id, --device or --code."},{"name":"--code","value":"string","summary":"Use - to read authorization material from stdin."},{"name":"--no-wait","value":"boolean","summary":"Return after flow start."},{"name":"--json","value":"boolean","summary":"Emit the command result as JSON; xAI --device requires --no-wait."},{"name":"--open-browser","value":"string","summary":"on or off for browser-capable login; rejected for explicit/native device flows."},{"name":"--add-account","value":"string","summary":"Fresh generic OAuth login only: on forces a fresh flow, off permits existing import preference. Not supported with reauth/Codex/Kiro method."}],
321
+ flags: [{"name":"--id","value":"string","summary":"Account ID; provider OAuth requires --reauth when supplied."},{"name":"--reauth","value":"boolean","summary":"Reauthenticate an existing account."},{"name":"--device","value":"boolean","summary":"Codex device flow or xAI device authorization; a no-op for already-device-native kimi, nous and github-copilot."},{"name":"--method","value":"string","summary":"Kiro only: builder-id, google or github; add-only and incompatible with --reauth, --id, --device or --code."},{"name":"--code","value":"string","summary":"Use - to read authorization material from stdin."},{"name":"--no-wait","value":"boolean","summary":"Return after flow start."},{"name":"--json","value":"boolean","summary":"Emit the command result as JSON; xAI --device requires --no-wait."},{"name":"--open-browser","value":"string","summary":"on or off for browser-capable login; rejected for explicit/native device flows."},{"name":"--add-account","value":"string","summary":"Fresh generic OAuth login only: on forces a fresh flow, off permits existing import preference. Not supported with reauth/Codex/Kiro method."},{"name":"--accept-antigravity-risk","value":"boolean","summary":"google-antigravity only: accept the Google account-ban risk without the interactive y/N prompt."}],
317
322
  mutates: true,
318
323
  json: "payload",
319
- usage: "ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method <builder-id|google|github>] [--code -] [--no-wait] [--open-browser <on|off>] [--add-account <on|off>] [--json]",
320
- details: ["openai, codex and chatgpt address the Codex pool. Native main uses the separate account main reauth flow.","Login is a human authorization handoff. Codes, verification material and credentials must not be copied into agent transcripts. Legacy argv code input warns about exposure; use stdin.","No --live flag is implemented. Provider OAuth --id requires --reauth; --method is Kiro add-only.","Omitted options preserve each flow's existing defaults. Explicit browser flags are refused for Codex device, known native-device providers and native Kiro method; add-account is refused for reauth/Codex/Kiro method.","Start/code/poll are pinned; human verification remains required. Only public handoff/flow/state fields are printed. Completed-but-validation/catalog-pending outcomes remain visible and nonzero."],
324
+ usage: "ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method <builder-id|google|github>] [--code -] [--no-wait] [--open-browser <on|off>] [--add-account <on|off>] [--accept-antigravity-risk] [--json]",
325
+ details: ["openai, codex and chatgpt address the Codex pool. Native main uses the separate account main reauth flow.","google-antigravity (login and reauth) prints an account-ban warning and needs a y answer on a terminal or --accept-antigravity-risk; otherwise it is refused before any request. Agent-driven runs are refused even with the flag (AGENTS_INSTALL.md).","Login is a human authorization handoff. Codes, verification material and credentials must not be copied into agent transcripts. Legacy argv code input warns about exposure; use stdin.","No --live flag is implemented. Provider OAuth --id requires --reauth; --method is Kiro add-only.","Omitted options preserve each flow's existing defaults. Explicit browser flags are refused for Codex device, known native-device providers and native Kiro method; add-account is refused for reauth/Codex/Kiro method.","Start/code/poll are pinned; human verification remains required. Only public handoff/flow/state fields are printed. Completed-but-validation/catalog-pending outcomes remain visible and nonzero."],
321
326
  },
322
327
  {
323
328
  command: ["account","history"],
@@ -439,9 +439,9 @@ export const OBSERVE_SYSTEM_CAPABILITIES: readonly Capability[] = [
439
439
  {
440
440
  command: ["system","settings"],
441
441
  summary: "Read or update supported runtime settings.",
442
- usage: "ocx system settings [--auto-start <on|off>] [--stream-mode <auto|legacy-tee|eager-relay>] [--desktop-authless <on|off>] [--client-compaction <on|off>] [--show-codex-credits <on|off>] [--account-picker <on|off>] [--main-account-hard-lock <on|off>] [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--json]",
442
+ usage: "ocx system settings [--auto-start <on|off>] [--stream-mode <auto|legacy-tee|eager-relay>] [--desktop-authless <on|off>] [--client-compaction <on|off>] [--show-codex-credits <on|off>] [--account-picker <on|off>] [--main-account-hard-lock <on|off>] [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--reserve <on|off>] [--json]",
443
443
  routes: [{"method":"GET","path":"/api/settings"},{"method":"PUT","path":"/api/settings"}],
444
- flags: [{"name":"--auto-start","value":"string","summary":"on | off for Codex autostart."},{"name":"--stream-mode","value":"string","summary":"auto | legacy-tee | eager-relay."},{"name":"--desktop-authless","value":"string","summary":"on | off for Codex Desktop authless."},{"name":"--client-compaction","value":"string","summary":"on | off for native replay portability; summaries may consume provider quota."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--show-codex-credits","value":"string","summary":"on/off display preference only; never paid-credit permission."},{"name":"--account-picker","value":"string","summary":"on/off Codex account picker visibility."},{"name":"--main-account-hard-lock","value":"string","summary":"on/off routing ownership policy; does not rotate native login."},{"name":"--ultra-fast-tier","value":"string","summary":"on/off routing tier; confirmed by same-target read-back."},{"name":"--fast-rows","value":"string","summary":"on/off Fast model rows, separate from provider Fast."}],
444
+ flags: [{"name":"--auto-start","value":"string","summary":"on | off for Codex autostart."},{"name":"--stream-mode","value":"string","summary":"auto | legacy-tee | eager-relay."},{"name":"--desktop-authless","value":"string","summary":"on | off for Codex Desktop authless."},{"name":"--client-compaction","value":"string","summary":"on | off for native replay portability; summaries may consume provider quota."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--show-codex-credits","value":"string","summary":"on/off display preference only; never paid-credit permission."},{"name":"--account-picker","value":"string","summary":"on/off Codex account picker visibility."},{"name":"--main-account-hard-lock","value":"string","summary":"on/off routing ownership policy; does not rotate native login."},{"name":"--ultra-fast-tier","value":"string","summary":"on/off routing tier; confirmed by same-target read-back."},{"name":"--fast-rows","value":"string","summary":"on/off Fast model rows, separate from provider Fast."},{"name":"--reserve","value":"string","summary":"on/off Luna Reserve compatibility; independent of desktop authless, grants no entitlement."}],
445
445
  mutates: true,
446
446
  json: "envelope",
447
447
  details: ["Mixed read/write: no setting flags reads; setting flags write only submitted fields. Stored, effective and config-apply states can differ.","New-option writes use narrow fields and actual observed values. ultraFastTier is read back because the PUT response omits it; missing/mismatching evidence stays saved-but-unverified and nonzero.","catalogRefreshPending is not a full catalog disposition. Native apply can remain deferred/refused separately. Old no-new-option settings output remains compatible."],
package/src/cli/claude.ts CHANGED
@@ -41,9 +41,9 @@ import { withoutSupervisorMarkers } from "../lib/supervisor-markers";
41
41
 
42
42
  /**
43
43
  * The environment of the detached `ocx start` that `ocx claude` launches (the spawn adds the runtime
44
- * provenance stamp): an ordinary owner. It
45
- * carries OCX_SERVICE=1 but no service manager's marker, which is how a restart tells it apart from
46
- * a manager-launched process (src/client/runtime-restart.ts classifyClientRestartSupervisor).
44
+ * provenance stamp): an ordinary owner. It carries OCX_SERVICE=1 but no service manager's marker, so a
45
+ * manager-launched process is told apart from it; a client runtime cannot tell it from a service registered before
46
+ * the marker existed, and its restart is refused as legacy-flag (src/client/runtime-restart.ts, #8545).
47
47
  */
48
48
  export function claudeProxyStartEnv(base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
49
49
  return withoutSupervisorMarkers(withoutSiblingMarker({ ...base, OCX_SERVICE: "1" }));
@@ -5,10 +5,14 @@
5
5
  * therefore restarts that runtime itself (the same restart as `ocx restart`, which a disconnected
6
6
  * client runtime hands to whichever owner holds it), bound to the runtime generation it observed,
7
7
  * and exits 0 only when no client runtime remained or a live standalone runtime answers afterwards.
8
- * Every other outcome exits 1, so a Home-driven leave stops before its own `ocx restart`.
8
+ * Every other outcome exits 1, so a Home-driven leave stops before its own `ocx restart`. One
9
+ * exception keeps the runtime on purpose: a record stating `legacy-flag` (only a bare OCX_SERVICE=1, so
10
+ * its owner cannot be proven; #8545) gets no restart request and exits 0 with the re-register advice,
11
+ * because the disconnect itself completed and a later `ocx restart` refuses it with the same advice.
9
12
  */
10
13
  import type { ProxyRestartIo, ProxyRestartLive, ProxyRestartRequestOutcome } from "./tray-proxy";
11
- import { RESTART_OWNERS, type RestartOwner } from "../client/runtime-restart";
14
+ import { LEGACY_FLAG_RESTART_OWNER, RESTART_OWNERS, type RestartOwner } from "../client/runtime-restart";
15
+ import { LEGACY_FLAG_OWNER_ADVICE } from "./restart-failure";
12
16
 
13
17
  function isHandledRestartOwner(value: string | undefined): value is RestartOwner {
14
18
  return value !== undefined && (RESTART_OWNERS as readonly string[]).includes(value);
@@ -24,7 +28,7 @@ export interface RuntimeGeneration {
24
28
  port: number;
25
29
  hostname?: string;
26
30
  attestationSecret: string;
27
- /** The owner the runtime classified from positive evidence; absent for a bare flag or an older runtime. */
31
+ /** The owner the runtime classified from positive evidence, legacy-flag for a bare flag; absent for an older runtime. */
28
32
  restartOwner?: string;
29
33
  }
30
34
 
@@ -127,10 +131,16 @@ export async function restartRuntimeAfterDisconnect(deps: DisconnectRuntimeDeps)
127
131
  if (client && !target) {
128
132
  return fail(`Disconnected, but this machine could not identify the running client runtime${client.pid ? ` (pid ${client.pid})` : ""}: its runtime record is missing or names another process, so it was not restarted.`, { kind: "unknown" });
129
133
  }
134
+ // A bare OCX_SERVICE=1 runtime is kept and nothing is stopped on inference (#8545 owner decision): no
135
+ // restart request, the disconnect's own exit 0, and the advice to re-register the service once.
136
+ if (target?.restartOwner === LEGACY_FLAG_RESTART_OWNER) {
137
+ error(`Disconnected, but the client runtime${client?.pid ? ` (pid ${client.pid})` : ""} was kept and still serves the old connection; nothing was stopped. ${LEGACY_FLAG_OWNER_ADVICE}`);
138
+ return 0;
139
+ }
130
140
  // Only a record that states an owner this step handles (written by a runtime with this change:
131
- // the desktop app, a service manager with a current marker, or no supervisor) is restarted. Any
132
- // other record, a bare OCX_SERVICE=1 runtime or one started before this change, is left exactly
133
- // as origin/dev's `ocx disconnect` left it: no restart request, the disconnect's own exit 0.
141
+ // the desktop app, a service manager with a current marker, or no supervisor) is restarted. A
142
+ // record from a runtime started before restartOwner existed, or naming a later value, is left
143
+ // exactly as origin/dev's `ocx disconnect` left it: no restart request, the disconnect's own exit 0.
134
144
  if (target && !isHandledRestartOwner(target.restartOwner)) return 0;
135
145
  const before = deps.connectionState();
136
146
  if (before.kind !== "disconnected") {
@@ -387,6 +387,7 @@ const commandRunners: Record<string, CommandRunner> = {
387
387
  // It is deliberately not `--code`: that name carries a secret value everywhere else in the
388
388
  // CLI (`ocx account login <provider> --code <value>`) and its operand is scrubbed from stderr.
389
389
  const codeMode = loginArgs.includes("--headless");
390
+ const acceptAntigravityRisk = loginArgs.includes("--accept-antigravity-risk");
390
391
  const positional = loginArgs.filter(arg => !arg.startsWith("--"));
391
392
  // 'ocx login codex' is the command people type first, and until now it answered with
392
393
  // the full provider wall because the Codex pool lives behind 'ocx account login'.
@@ -407,7 +408,7 @@ const commandRunners: Record<string, CommandRunner> = {
407
408
  return code ?? 1;
408
409
  }
409
410
  const { handleLogin } = await import("../oauth/login-cli");
410
- await handleLogin(positional[0], {}, { codeMode });
411
+ await handleLogin(positional[0], {}, { codeMode, acceptAntigravityRisk });
411
412
  return 0;
412
413
  },
413
414
  logout: async deps => {
@@ -650,6 +651,11 @@ const commandRunners: Record<string, CommandRunner> = {
650
651
  return 0;
651
652
  },
652
653
  update: async deps => {
654
+ // #8246: the headless Windows Desktop updater has its own grammar (including --json) and never
655
+ // reaches the package or orchestrated updater.
656
+ if (deps.args.slice(1).includes("--desktop") && !hasHelpFlag(deps.args.slice(1))) {
657
+ return (await import("../desktop-update/cli")).runHeadlessDesktopUpdateCommand(deps.args.slice(1));
658
+ }
653
659
  const { isOrchestratedUpdateArgv, parseOrchestratedChildArgs } = await import("../update/orchestrated-arguments.mjs");
654
660
  if (process.env.OCX_UPDATE_ORCHESTRATED_CHILD === "1" && deps.args.slice(1).some(arg => /^--orchestrated-(expect|result)(?:=|$)/.test(arg))) {
655
661
  const child = parseOrchestratedChildArgs(deps.args.slice(1), process.env);
package/src/cli/index.ts CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  runCodexHistoryJob,
51
51
  } from "../codex/history-job";
52
52
  import { findCrossHomeOwner, markCrossHomeSibling, markLiveHomeSibling } from "./cross-home-owner";
53
- import { inspectClientRotationRecoveryGate, readClientConnectionState } from "../client/state";
53
+ import { clientStartupRefusalMessage, inspectClientRotationRecoveryGate, readClientConnectionState } from "../client/state";
54
54
  import {
55
55
  codexAutoStartEnabled,
56
56
  getConfigDir,
@@ -489,7 +489,7 @@ async function handleStart(options: { block?: boolean } = {}) {
489
489
  const rotationGate = inspectClientRotationRecoveryGate(clientState);
490
490
  if (clientState.kind === "connected") {
491
491
  if (rotationGate.kind === "recovery-required" || rotationGate.kind === "unsafe") {
492
- throw new Error(`client startup refused: ${rotationGate.reason}`);
492
+ throw new Error(clientStartupRefusalMessage(rotationGate.reason));
493
493
  }
494
494
  const { startClientRuntime } = await import("../client/runtime");
495
495
  // Same lease-held owner recheck as the server path below: this branch binds and publishes too.
@@ -11,7 +11,7 @@
11
11
  import type { HomeCodexSettingsRecord } from "../client/link-home";
12
12
  import { findLiveProxy, probeHostname, type LiveProxy } from "../server/proxy-liveness";
13
13
  import type { ProxyRestartStartOutcome } from "./tray-proxy";
14
- import type { RestartSupervisor } from "./restart-failure";
14
+ import { LEGACY_FLAG_OWNER_ADVICE, type RestartSupervisor } from "./restart-failure";
15
15
 
16
16
  export type ApplyRestartOutcome =
17
17
  | { kind: "current" }
@@ -73,7 +73,9 @@ export function applyRestartMessage(outcome: ApplyRestartOutcome): string {
73
73
  case "restarted": return "Client runtime restarted after applying the Home's settings.";
74
74
  case "deferred-supervisor": return outcome.supervisor === "desktop"
75
75
  ? "Client runtime restart deferred; the settings take effect when OpenCodex Desktop restarts it. Use Quit in the OpenCodex tray menu, then reopen OpenCodex."
76
- : "Client runtime restart deferred; the settings take effect when the background service restarts it. Run `ocx service restart`.";
76
+ : outcome.supervisor === "legacy-flag"
77
+ ? `Client runtime restart deferred; nothing was stopped, and the settings take effect when the runtime restarts. ${LEGACY_FLAG_OWNER_ADVICE}`
78
+ : "Client runtime restart deferred; the settings take effect when the background service restarts it. Run `ocx service restart`.";
77
79
  case "failed": return "The client runtime restart did not complete; the previous runtime keeps serving. If a background service or the desktop app owns it, restart it there; otherwise retry with 'ocx restart' or 'ocx sync'.";
78
80
  }
79
81
  }
@@ -76,7 +76,10 @@ export async function runLinkRoutes(args: string[], deps: LinkCliDeps, request:
76
76
  const code = error.body.error.code;
77
77
  const cause = error.body.error.cause;
78
78
  const known = typeof cause === "string" && ROUTE_CAUSES.has(cause) ? " (" + cause + ")" : "";
79
- const note = code === "routes_stored_reload_failed" ? "; the routes were stored (ocx link routes --link-id " + linkId + " reads them), restart the proxy to apply them" : "";
79
+ const note = code === "routes_stored_reload_failed" ? "; the routes were stored (ocx link routes --link-id " + linkId + " reads them), restart the proxy to apply them"
80
+ // An edit now would leave the removal's copy of the record stale and the link unremovable (#8678).
81
+ : code === "link_retirement_pending" ? "; an unfinished removal holds this link, so its routes cannot change: finish that removal by repeating the revoke that started it (ocx link operations --json shows each entry's linkId), or end it with ocx link revoke --link-id " + linkId + " --force --yes without --operation-id"
82
+ : "";
80
83
  throw new RuntimeApiError("Link routes request refused (" + error.status + "): " + code + known + note, error.status, error.body);
81
84
  }
82
85
  throw error;
package/src/cli/link.ts CHANGED
@@ -698,13 +698,14 @@ const NEXT_STEP: Record<string, string> = {
698
698
  // A resumed owner can meet the same live write failure again and keep its receipt, so a repeat proves nothing: the same id after
699
699
  // the fix, and a new id only through link_retirement_owned's guidance if one is tried.
700
700
  operation_journal_failed: "The journal could not record a step: fix what keeps it from being written (disk space, permissions), then repeat the revoke with the same operation id. If it keeps answering operation_journal_failed, a new operation id can be tried; if that answers link_retirement_owned, this id may still own the removal: follow that answer",
701
- // A stale retirement receipt (the record was edited after a removal claimed it, for example by ocx link routes, which does not
702
- // check for a receipt: #8678) answers link_changed to every revoke, this id's resume included, until the record matches the
703
- // receipt's copy again. A claim that met a changed record (no receipt for this id) is journalled, so this id replays it while a
701
+ // A stale retirement receipt (the record was edited after a removal claimed it) answers link_changed to every revoke, this id's
702
+ // resume included, until the record matches the receipt's copy again. A current Home refuses a route edit while a receipt is
703
+ // outstanding (link_retirement_pending, #8678), so only an older Home's ocx link routes, which did not check, or an edit by
704
+ // hand leaves one stale. A claim that met a changed record (no receipt for this id) is journalled, so this id replays it while a
704
705
  // new id reads the record afresh; a commit that met one leaves this id's receipt, so its repeat resumes the removal and meets
705
706
  // the same comparison. In one runtime a revoke and a route edit hold the same Child-job reservation, so the code never proves
706
707
  // that the link changed while this revoke ran.
707
- link_changed: "The link, or the record of its unfinished removal, no longer matches what this removal started from: read ocx link status, then repeat the revoke with the same operation id. If it answers link_changed again, the link may have been edited after its removal began (for example with ocx link routes). A new operation id can remove it only when no unfinished removal of this link remains; while one remains, no revoke finishes it until the link matches that removal's copy again",
708
+ link_changed: "The link, or the record of its unfinished removal, no longer matches what this removal started from: read ocx link status, then repeat the revoke with the same operation id. If it answers link_changed again, the link was edited after its removal began, by ocx link routes on an older Home that did not refuse route edits during a removal or by hand. A new operation id can remove it only when no unfinished removal of this link remains; while one remains, no revoke finishes it until the link matches that removal's copy again",
708
709
  };
709
710
 
710
711
  /**
@@ -8,6 +8,9 @@ export function skipsCodexShimAutoRestore(command: string | undefined, args: str
8
8
  // Reading the bounded link diagnostics file must not repair, harden or create anything first.
9
9
  if (command === "link" && args[1] === "diagnostics") return true;
10
10
  if (command === "update" && isOrchestratedUpdateArgv(args)) return true;
11
+ // The headless Desktop updater validates its installation before anything changes; with or
12
+ // without --json it must not repair a shim first.
13
+ if (command === "update" && args.includes("--desktop")) return true;
11
14
  if (command === "sync") return true;
12
15
  if (command === "status" || command === "doctor") return true;
13
16
  // Explicit orphan-token recovery must not mutate Codex before its guards run.
@@ -255,11 +255,12 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
255
255
  },
256
256
  {
257
257
  name: "login",
258
- usage: "ocx login <provider> [--headless]",
258
+ usage: "ocx login <provider> [--headless] [--accept-antigravity-risk]",
259
259
  summary: "OAuth or API-key login for a provider.",
260
260
  details: [
261
261
  "--headless (anthropic, anthropic2): no browser and no local port; approve in any browser and paste the displayed code.",
262
262
  "--headless (xai): device authorization instead of the loopback callback; no local port, confirm the printed short code in any browser, nothing to paste.",
263
+ "google-antigravity: Google can disable the whole Google account for this sign-in. The warning always prints; a terminal must answer y, and a non-interactive run needs --accept-antigravity-risk or is refused. Runs driven by a coding agent or CI are always refused.",
263
264
  "Codex/ChatGPT: ocx login codex runs the Codex account-pool login (same flow as ocx account login codex).",
264
265
  "That one needs a running proxy; the OAuth and API-key providers log in locally.",
265
266
  "'chatgpt' and 'openai' are the same route; an OpenAI platform API key is 'ocx login openai-apikey'.",
@@ -310,11 +311,13 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
310
311
  },
311
312
  {
312
313
  name: "update",
313
- usage: "ocx update [--tag latest|preview] | --plan --json [--tag latest|preview | --version <version>] | --yes --json [--tag latest|preview | --version <version>] [--expect-plan <token>] [--not-after <unix-ms>]",
314
+ usage: "ocx update [--tag latest|preview] | --plan --json [--tag latest|preview | --version <version>] | --yes --json [--tag latest|preview | --version <version>] [--expect-plan <token>] [--not-after <unix-ms>] | --desktop [--check] [--json]",
314
315
  summary: "Update opencodex. Preview installs stay on the preview tag unless overridden.",
315
316
  details: [
316
317
  "--plan --json previews an orchestrated update; --yes --json applies it. --expect-plan binds apply to the returned planToken; --not-after sets a Unix millisecond mutation deadline.",
317
318
  "Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 failed with previous version verified; 12 unverified or still running; 64 invalid usage.",
319
+ "--desktop updates a Windows OpenCodex Desktop installation without its window: it verifies the published MSI with the app's updater key, installs it silently and restarts the runtime that still serves the old version. Run it with that installation's ocx.exe from an elevated terminal. --check only reports.",
320
+ "Desktop exit codes: 0 done or up to date; 1 nothing installed; 2 installed but the old runtime still serves (or a reboot is pending); 3 installer outcome uncertain; 64 invalid usage or not a Desktop installation.",
318
321
  ],
319
322
  },
320
323
  {
@@ -21,6 +21,8 @@
21
21
  * - exit 1 when the CLI cannot resolve: an invalid config.json must NOT be answered
22
22
  * with `loadConfig`'s repair-to-defaults behaviour, because that hands the caller
23
23
  * a guessed port; and unknown liveness must not be answered as absence.
24
+ * Under `--json` that exit still prints its one document: a `ResolveFailureJson`
25
+ * (`ok: false` plus a fixed `reason`) beside the unchanged stderr line (#8318).
24
26
  * - exit 64 for any argument, pre-parsed in src/cli/root.ts before preflight side
25
27
  * effects, mirroring `ocx ready`. The verb is read-only and listed in
26
28
  * skipsCodexShimAutoRestore, so a lookup made to populate a consent surface never
@@ -136,6 +138,18 @@ export type ResolveTakeover =
136
138
  | { kind: "supported"; protocolVersion: number; minimumCliVersion: string; token: string }
137
139
  | { kind: "blocked"; reason: string; detail: string; minimumCliVersion: string };
138
140
 
141
+ /**
142
+ * The document `--json` prints when resolve exits 1 (#8318). It carries no liveness, port or
143
+ * ownership field, so nothing in it can be read as absence; `error` repeats the stderr line.
144
+ * A shell that keys on the exit status, as the desktop does, can ignore it.
145
+ */
146
+ export interface ResolveFailureJson {
147
+ schema: typeof RESOLVE_SCHEMA;
148
+ ok: false;
149
+ reason: "config_unreadable" | "config_invalid" | "discovery_failed" | "liveness_unknown";
150
+ error: string;
151
+ }
152
+
139
153
  export interface ResolveArgs {
140
154
  json: boolean;
141
155
  }
@@ -273,28 +287,30 @@ export async function runResolve(args: ResolveArgs, io: ResolveIo = {}): Promise
273
287
  const resolveState = io.resolveState ?? resolveServiceState;
274
288
  const observeManagers = io.observeManagers ?? observeManagingClis;
275
289
  const configHome = configDir();
290
+ const fail = (reason: ResolveFailureJson["reason"], error: string): number => {
291
+ stderr.error(error);
292
+ if (args.json) stdout.log(JSON.stringify({ schema: RESOLVE_SCHEMA, ok: false, reason, error } satisfies ResolveFailureJson));
293
+ return 1;
294
+ };
276
295
  let diagnostics: ConfigDiagnostics;
277
296
  try {
278
297
  diagnostics = readDiagnostics();
279
298
  } catch (error) {
280
299
  // A resolution that could not run must not read as "no proxy": the caller has to
281
300
  // refuse to guess (D5) rather than treat this as a proven-absent verdict.
282
- stderr.error(`resolve failed: ${error instanceof Error ? error.message : String(error)}`);
283
- return 1;
301
+ return fail("config_unreadable", `resolve failed: ${error instanceof Error ? error.message : String(error)}`);
284
302
  }
285
303
  if (diagnostics.source === "fallback") {
286
304
  // An invalid config must not resolve to defaults: the effective port would be a
287
305
  // guess at 10100 while the operator's config.port is unread. The repair-to-defaults
288
306
  // policy in loadConfig is for interactive recovery, not for a shell contract.
289
- stderr.error(`resolve failed: the config in ${configHome} is invalid (${diagnostics.error ?? "unknown error"}); refusing to guess.`);
290
- return 1;
307
+ return fail("config_invalid", `resolve failed: the config in ${configHome} is invalid (${diagnostics.error ?? "unknown error"}); refusing to guess.`);
291
308
  }
292
309
  let live: LiveProxy | null;
293
310
  try {
294
311
  live = await findLive();
295
312
  } catch (error) {
296
- stderr.error(`resolve failed: ${error instanceof Error ? error.message : String(error)}`);
297
- return 1;
313
+ return fail("discovery_failed", `resolve failed: ${error instanceof Error ? error.message : String(error)}`);
298
314
  }
299
315
  if (!live) {
300
316
  // findLiveProxy collapses "definitely nothing" and "could not tell" into the same
@@ -310,8 +326,7 @@ export async function runResolve(args: ResolveArgs, io: ResolveIo = {}): Promise
310
326
  provenDown = false;
311
327
  }
312
328
  if (!provenDown) {
313
- stderr.error("resolve: liveness is unknown (a probe timed out or a listener withheld /healthz); refusing to treat unknown as absent.");
314
- return 1;
329
+ return fail("liveness_unknown", "resolve: liveness is unknown (a probe timed out or a listener withheld /healthz); refusing to treat unknown as absent.");
315
330
  }
316
331
  }
317
332
  let ownership: ServiceOwnershipResolution;
@@ -1,6 +1,13 @@
1
1
  import type { ProxyRestartResult } from "./tray-proxy";
2
2
 
3
- export type RestartSupervisor = "desktop" | "service" | "service-unproven";
3
+ export type RestartSupervisor = "desktop" | "service" | "service-unproven" | "legacy-flag";
4
+
5
+ /**
6
+ * Why a client runtime with only a bare OCX_SERVICE=1 is kept (#8545 owner decision, 2026-11-16), and the one-time fix.
7
+ * `ocx service repair` rewrites a legacy registration with the current ownership marker (OCX_SERVICE_MANAGED or the
8
+ * Windows wrapper marker) and reloads it, after which restart, disconnect and sync hand the runtime to that service.
9
+ */
10
+ export const LEGACY_FLAG_OWNER_ADVICE = "It carries only the bare OCX_SERVICE=1 flag, which a background service registered before OpenCodex 2.49 and the proxies started by ocx claude, ocx codex and ocx opencode all share, so its owner cannot be proven. If a background service runs it, re-register the service once with `ocx service repair` (this writes the current ownership marker and restarts it). If ocx claude, ocx codex or ocx opencode started it, run `ocx stop` and start it again.";
4
11
 
5
12
  /** Only the bound client's explicit refusal establishes a supervisor for sync. */
6
13
  export function supervisedRestartRefusal(result: ProxyRestartResult): RestartSupervisor | null {
@@ -8,6 +15,7 @@ export function supervisedRestartRefusal(result: ProxyRestartResult): RestartSup
8
15
  if (result.error.message === "restart_supervised_desktop") return "desktop";
9
16
  if (result.error.message === "restart_supervised_service") return "service";
10
17
  if (result.error.message === "restart_supervised_service-unproven") return "service-unproven";
18
+ if (result.error.message === "restart_supervised_legacy-flag") return "legacy-flag";
11
19
  return null;
12
20
  }
13
21
 
@@ -38,6 +46,8 @@ export function reportRestartFailure(result: Extract<ProxyRestartResult, { ok: f
38
46
  console.error("Restart not performed; the running client runtime was kept. Its background service owns it: run `ocx service restart`.");
39
47
  } else if (code === "restart_supervised_service-unproven") {
40
48
  console.error("Restart not performed; the running client runtime was kept. A service manager started it (systemd opencodex-proxy.service, launchd com.opencodex.proxy or the Windows OpenCodex service), but it is not enabled or its relaunch could not be verified: restart it through the manager with 'ocx service restart', or check 'ocx service status'.");
49
+ } else if (code === "restart_supervised_legacy-flag") {
50
+ console.error(`Restart not performed; the running client runtime was kept and nothing was stopped. ${LEGACY_FLAG_OWNER_ADVICE}`);
41
51
  } else if (code === "restart_supervised_desktop") {
42
52
  console.error("Restart not performed; the running client runtime was kept. The OpenCodex desktop app owns it while its connection is current: use Quit in the OpenCodex tray menu, then reopen it. After `ocx disconnect`, `ocx restart` hands it to the app.");
43
53
  } else {
@@ -20,6 +20,8 @@ export type CliStdin = NodeJS.ReadableStream & { isTTY?: boolean; readableEnded?
20
20
 
21
21
  export const MAX_LINK_CREDENTIAL_BYTES = 4 * 1024;
22
22
 
23
+ import type { AntigravityRiskSeams } from "../oauth/antigravity-risk";
24
+
23
25
  export interface RuntimeApiDeps {
24
26
  baseUrl?: string;
25
27
  fetchImpl?: typeof fetch;
@@ -32,6 +34,8 @@ export interface RuntimeApiDeps {
32
34
  findLiveProxy?: (io?: LivenessIo) => Promise<LiveProxy | null>;
33
35
  /** Remote Link Child: how allowlisted reads reach the Home (#6957). */
34
36
  linkHome?: LinkHomeDeps;
37
+ /** Test seams for the Google Antigravity acknowledgement (agent detection, prompt visibility). */
38
+ antigravityRisk?: AntigravityRiskSeams;
35
39
  }
36
40
 
37
41
  export class CliUsageError extends Error {
package/src/cli/status.ts CHANGED
@@ -38,6 +38,7 @@ import { LOCAL_MANAGEMENT_READ_PATHS } from "../lib/local-management-capability"
38
38
  import { fetchBoundLocalManagementRead } from "../server/local-management-read-client";
39
39
  import { collectAppliedCodexSettingsStatus, type CliAppliedCodexSettingsStatus } from "./status-codex-settings";
40
40
  import { installDetectionStatus, type InstallDetectionStatus } from "./status-install";
41
+ import { windowsDesktopInstall, withDesktopSkewAdvice } from "../desktop-update/install";
41
42
  import { collectLocalCredentials, type LocalCredentialSnapshot } from "../local-credentials/inventory";
42
43
  import { collectLinkConnectionGeneration } from "./status-link";
43
44
 
@@ -944,7 +945,9 @@ export async function collectStatus(options: { mainAccountPolicy?: boolean } = {
944
945
  const pid = resolveStatusPid(live, pidFile);
945
946
  // No extra request: findLiveProxy's identity probe already parsed and validated the
946
947
  // healthz body, so the version came back with the liveness result.
947
- const versionSkew = computeVersionSkew(packageVersion(), live?.version);
948
+ // #8246: on a Windows Desktop installation a newer CLI means the MSI installed an update that the
949
+ // running runtime has not picked up; the warning says so with the command that finishes it.
950
+ const versionSkew = withDesktopSkewAdvice(computeVersionSkew(packageVersion(), live?.version), windowsDesktopInstall(), live?.source);
948
951
  // OCX-6: what this machine applied and, on a Child, when its runtime started. Additive and
949
952
  // always present (null when unknown), so `schemaVersion` stays 1.
950
953
  const appliedCodexSettings = await collectAppliedCodexSettingsStatus(config, live);
@@ -19,7 +19,7 @@ const USAGE = `Usage:
19
19
  ocx system settings [--auto-start <on|off>] [--stream-mode <auto|legacy-tee|eager-relay>]
20
20
  [--desktop-authless <on|off>] [--client-compaction <on|off>]
21
21
  [--show-codex-credits <on|off>] [--account-picker <on|off>] [--main-account-hard-lock <on|off>]
22
- [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--json]
22
+ [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--reserve <on|off>] [--json]
23
23
  ocx system startup <health|install-service|install-shim> [--json]
24
24
  ocx system diagnostics [--json]
25
25
  ocx system sync [--json]
@@ -44,6 +44,12 @@ export interface BoundSystemRestartDeps {
44
44
  /** Invoking CLI version for the skew guard; defaults to this bundle's package version. */
45
45
  cliVersion?: string;
46
46
  readUpdateHome?: typeof readUpdateRestartHome;
47
+ /**
48
+ * The caller proved the runtime's image is the installed executable whose version is
49
+ * `cliVersion` (the headless Desktop updater, #8246). Its in-place respawn then runs those
50
+ * installed bytes, so a CLI-newer skew is the expected state rather than a reason to refuse.
51
+ */
52
+ respawnRunsInstalledImage?: boolean;
47
53
  }
48
54
 
49
55
  function rejected(code: string): ProxyRestartRequestOutcome {
@@ -162,7 +168,7 @@ export async function requestBoundSystemRestart(
162
168
  return rejected("restart_target_recheck_failed");
163
169
  }
164
170
  if (!sameRestartTarget(target, observed)) return rejected("restart_target_changed");
165
- if (skew.relation === "cli-newer") {
171
+ if (skew.relation === "cli-newer" && !deps.respawnRunsInstalledImage) {
166
172
  if (!updateHome) return rejected("update_restart_home_unverified");
167
173
  try {
168
174
  if (JSON.stringify((deps.readUpdateHome ?? readUpdateRestartHome)()) !== JSON.stringify(updateHome)) {
@@ -226,14 +232,14 @@ export async function requestBoundSystemRestart(
226
232
  * A client runtime under the desktop app or a service answers 409 `restart_supervised` and keeps
227
233
  * serving (OCX-6). Read that small body and return the validated supervisor, or null.
228
234
  */
229
- async function supervisedRefusal(response: Response): Promise<"service" | "desktop" | "service-unproven" | null> {
235
+ async function supervisedRefusal(response: Response): Promise<"service" | "desktop" | "service-unproven" | "legacy-flag" | null> {
230
236
  try {
231
237
  const read = await readBoundedResponseBytes(response, { maxBytes: 1024, signal: AbortSignal.timeout(SYSTEM_RESTART_REQUEST_TIMEOUT_MS) });
232
238
  if (read.oversized) return null;
233
239
  const body = JSON.parse(new TextDecoder().decode(read.bytes)) as { error?: { code?: unknown; supervisor?: unknown } } | null;
234
240
  if (body?.error?.code !== RESTART_SUPERVISED_ERROR) return null;
235
241
  const supervisor = body.error.supervisor;
236
- return supervisor === "service" || supervisor === "desktop" || supervisor === "service-unproven" ? supervisor : null;
242
+ return supervisor === "service" || supervisor === "desktop" || supervisor === "service-unproven" || supervisor === "legacy-flag" ? supervisor : null;
237
243
  } catch {
238
244
  return null;
239
245
  }
@@ -3,10 +3,11 @@ import { serializeManagementJson } from "./json-input";
3
3
  import { printSettingsResult, projectSettingsApply } from "./settings-result";
4
4
  import { CliUsageError, runtimeBaseUrl, runtimeRequest, takeFlag, takeOptionWithSyntax, type RuntimeApiDeps } from "./runtime-api";
5
5
 
6
- export const SYSTEM_PARITY_OPTIONS = ["--show-codex-credits", "--account-picker", "--main-account-hard-lock", "--ultra-fast-tier", "--fast-rows"] as const;
6
+ export const SYSTEM_PARITY_OPTIONS = ["--show-codex-credits", "--account-picker", "--main-account-hard-lock", "--ultra-fast-tier", "--fast-rows", "--reserve"] as const;
7
7
  const BOOLEAN_FIELDS: Readonly<Record<string, string>> = {
8
8
  "--show-codex-credits": "showCodexCredits", "--account-picker": "codexAccountPickerEnabled",
9
9
  "--main-account-hard-lock": "codexMainAccountHardLock", "--ultra-fast-tier": "ultraFastTier", "--fast-rows": "fastRows",
10
+ "--reserve": "codexReserveEnabled",
10
11
  "--auto-start": "codexAutoStart", "--desktop-authless": "codexDesktopAuthless", "--client-compaction": "codexClientCompaction",
11
12
  };
12
13
  function record(value: unknown): value is Record<string, unknown> {