@bitkyc08/opencodex 2.96.0 → 2.98.0-preview.20261107
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.
- package/bin/ocx.mjs +215 -20
- package/gui/dist/assets/App-6TFtZsUF.css +1 -0
- package/gui/dist/assets/App-B8_sOxoz.js +59 -0
- package/gui/dist/assets/Tray-DpWEp6ee.js +1 -0
- package/gui/dist/assets/WantedSansVariable.split.0-Dwvb1WRx.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.1-1wKD2RxI.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.10-CAKA6LIP.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.11-k5H85R4b.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.12-BHboLsUv.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.13-9GV377ix.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.14-DovDXnrj.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.15-DTdykCig.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.16-CKz2ccgK.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.17-Z2RD_KRZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.18-BcKtfonJ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.19-DEQPOSZn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.2-DryboyuA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.20-Bia5JMls.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.21-Cr4jFw-E.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.22-DjjB69TZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.23-CvUzJskt.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.24-i_eMg5ox.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.25-2aKHwPX-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.26-B6wXoCEL.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.27-D4h1WfGM.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.28-kvRPCStd.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.29-DHAiwleD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.3-7H--eyZi.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.30-C66cfAY2.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.31-FDmtiNim.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.32-DouHt2Dd.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.33-B8HVvkJX.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.34-BtkRu1FN.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.35-DBylQbtk.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.36-Sg089Kgh.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.37-CYtvbriS.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.38-DKkSLf8Z.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.39-CecotKZD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.4-Bv8O3ZMb.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.40-DdCvkmOU.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.41-ESn674Hc.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.42-DL9V7NNV.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.43-yipO0cyk.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.44-6rTmLZhm.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.45-BJAj8lrm.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.46-BDTzMn2c.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.47-Bxd4wGgi.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.48-DxnFBLnH.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.49-DnVD0aOD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.5-B1wI2pp5.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.50-D9JlkZd6.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.51-D9Vw6Bu3.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.52-ClEJk4kn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.53-BSXU0vh-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.54-EcuxkR9v.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.55-CYiFhQX8.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.56--Gk9g8BK.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.57-DnkOPZcy.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.58-9MB8504z.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.59-ByxIsN72.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.6-Bmk0dRVw.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.60-Bxwx_aWQ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.61-DA2z5sm7.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.62-C5iJPJZn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.63-DAqrmaEc.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.64-BgXFsljb.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.65-DKiWujvu.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.66-8po4vUZ4.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.67-Cy5qyI9O.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.68-BKny7Fy3.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.69-B4VU4u_b.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.7-BuqwNpgA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.70-BCd4n346.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.71-CkQppaWn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.72-Db7vaoFs.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.73-DI80TYWl.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.74-tMCtDAHB.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.75-Ciw0D5WG.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.76-DoLjFgp-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.77-CpT2uvMy.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.78-CkcJ4iZ1.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.79-DsOUJjEM.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.8-DsjypPd6.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.80-C0VwHTte.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.81-DTelu57i.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.82-BiMndGN1.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.83-CVcC6eDG.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.84-DlhZVt_O.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.85-S8I2D3pA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.86-DozXXpH5.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.87-Dsn0Vuuo.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.88-iNwxxDCr.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.89-B63u_9CZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.9-Bi3IzpMI.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.90-ByeH1Pqf.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.91-UQLlagpm.woff2 +0 -0
- package/gui/dist/assets/brand-mark-VPhzz-WE.js +1 -0
- package/gui/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/gui/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/gui/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/gui/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/gui/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/gui/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/gui/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/gui/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/gui/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/gui/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/gui/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/gui/dist/assets/index-5REODpG3.css +2 -0
- package/gui/dist/assets/index-BWKBeK77.js +94 -0
- package/gui/dist/assets/segment-thumb-features-BQYzrze9.js +1 -0
- package/gui/dist/classic/assets/App-Bz65x1J6.js +58 -0
- package/gui/dist/{assets/Tray-BOPQyDbH.js → classic/assets/Tray-kk7mdO6I.js} +1 -1
- package/gui/dist/classic/assets/index-Dp2j8bSc.js +94 -0
- package/gui/dist/classic/assets/quota-summary-CvamtHjB.js +1 -0
- package/gui/dist/classic/index.html +47 -0
- package/gui/dist/favicon.png +0 -0
- package/gui/dist/favicon.svg +14 -0
- package/gui/dist/index.html +15 -2
- package/package.json +1 -1
- package/src/adapters/anthropic.ts +17 -8
- package/src/adapters/command-code.ts +15 -16
- package/src/adapters/cursor/transport-retry.ts +2 -2
- package/src/adapters/devin/cloud-direct/chat.ts +15 -6
- package/src/adapters/google.ts +7 -7
- package/src/adapters/kiro/adapter.ts +18 -3
- package/src/adapters/kiro/conversation.ts +8 -8
- package/src/adapters/kiro/payload.ts +45 -12
- package/src/adapters/kiro/stream.ts +230 -14
- package/src/adapters/kiro/structured-output-json.ts +191 -0
- package/src/adapters/kiro/structured-output-schema.ts +542 -0
- package/src/adapters/kiro/structured-output.ts +367 -0
- package/src/adapters/kiro-constants.ts +24 -1
- package/src/adapters/kiro-events.ts +31 -1
- package/src/adapters/kiro-retry.ts +3 -3
- package/src/adapters/kiro-tools.ts +14 -9
- package/src/adapters/kiro-wire.ts +9 -5
- package/src/adapters/ollama-native.ts +11 -1
- package/src/adapters/openai-chat/messages.ts +58 -5
- package/src/adapters/openai-chat/mistral-image-limit.ts +50 -0
- package/src/adapters/openai-chat/passthrough.ts +5 -3
- package/src/adapters/openai-chat/tool-schema.ts +83 -13
- package/src/adapters/openai-responses/empty-assistant.ts +15 -3
- package/src/adapters/openai-responses/opengateway-input.ts +18 -6
- package/src/adapters/openai-responses/passthrough.ts +5 -4
- package/src/adapters/openai-responses/reasoning.ts +9 -4
- package/src/adapters/openai-responses/request-strips.ts +1 -1
- package/src/adapters/openai-responses/tool-output-recovery.ts +79 -0
- package/src/adapters/physical-send.ts +3 -3
- package/src/adapters/qoder/live-models.ts +115 -1
- package/src/adapters/zed-openai-stream.ts +2 -1
- package/src/bridge/errors.ts +11 -2
- package/src/bridge/response-json.ts +2 -1
- package/src/bridge/sse.ts +14 -6
- package/src/chat/failure-verdict.ts +21 -0
- package/src/chat/outbound.ts +139 -21
- package/src/claude/failure-verdict.ts +21 -0
- package/src/claude/inbound-content-options.ts +15 -2
- package/src/claude/inbound-model-options.ts +2 -1
- package/src/claude/inbound-records.ts +2 -0
- package/src/claude/inbound.ts +17 -11
- package/src/claude/outbound.ts +98 -22
- package/src/cli/capabilities-access-remote.ts +13 -0
- package/src/cli/capabilities-base.ts +26 -3
- package/src/cli/capabilities-command.ts +12 -3
- package/src/cli/capabilities-provider-models.ts +3 -3
- package/src/cli/capability-contracts.ts +2 -0
- package/src/cli/codex-launch-auth.ts +30 -1
- package/src/cli/codex-launcher.ts +12 -5
- package/src/cli/codex-shim-autorestore.ts +12 -4
- package/src/cli/config-command.ts +11 -2
- package/src/cli/connect.ts +17 -2
- package/src/cli/dispatch.ts +14 -177
- package/src/cli/doctor.ts +95 -7
- package/src/cli/help.ts +2 -2
- package/src/cli/index.ts +17 -8
- package/src/cli/link-apply-restart.ts +9 -2
- package/src/cli/link.ts +1 -1
- package/src/cli/models.ts +124 -38
- package/src/cli/registry.ts +12 -4
- package/src/cli/restart-failure.ts +17 -0
- package/src/cli/root.ts +8 -0
- package/src/cli/stop-approval.ts +2 -2
- package/src/cli/sync-command.ts +243 -0
- package/src/cli/sync-fanout-process.ts +92 -0
- package/src/cli/sync-fanout.ts +161 -0
- package/src/cli/sync-flags.ts +10 -0
- package/src/cli/sync-link-status.ts +39 -0
- package/src/cli/sync-update-guard.ts +18 -0
- package/src/cli/system-restart-client.ts +5 -0
- package/src/cli/uninstall-client-state.ts +12 -1
- package/src/cli/update-restart-child.ts +13 -3
- package/src/cli/update-restart-home.ts +6 -3
- package/src/cli/update-restart.ts +36 -19
- package/src/client/connect.ts +35 -15
- package/src/client/hub-client.ts +5 -0
- package/src/client/link-home.ts +3 -2
- package/src/client/link-management-relay.ts +39 -2
- package/src/client/link-readiness.ts +3 -1
- package/src/client/machine-api.ts +2 -1
- package/src/client/machine-listener.ts +10 -0
- package/src/client/orphan-token-recovery.ts +322 -0
- package/src/client/restore-ownership.ts +19 -1
- package/src/client/runtime-restart.ts +12 -4
- package/src/client/runtime.ts +40 -11
- package/src/client/stop-routing.ts +62 -0
- package/src/client/sync-runtime.ts +65 -0
- package/src/clients/config-export.ts +32 -3
- package/src/codex/auth-context.ts +49 -103
- package/src/codex/catalog/antigravity-discovery.ts +16 -5
- package/src/codex/catalog/provider-models.ts +18 -12
- package/src/codex/forward-transport-headers.ts +35 -6
- package/src/codex/inject/config-toml.ts +88 -0
- package/src/codex/inject/multi-agent-v2.ts +30 -4
- package/src/codex/inject/plan.ts +34 -7
- package/src/codex/inject-coordination.ts +11 -0
- package/src/codex/inject.ts +18 -7
- package/src/codex/lineage.ts +13 -7
- package/src/codex/native-profile-api.ts +27 -1
- package/src/codex/quota.ts +22 -6
- package/src/codex/request-owned-affinity-key.ts +11 -0
- package/src/codex/request-owned-affinity.ts +118 -0
- package/src/codex/request-owned-main-pin.ts +86 -0
- package/src/codex/role-capability.ts +52 -41
- package/src/codex/routing/active-account.ts +13 -5
- package/src/codex/routing/selection.ts +40 -1
- package/src/codex/routing/thread-affinity-store.ts +916 -0
- package/src/codex/routing/thread-affinity.ts +90 -12
- package/src/codex/shim-diagnostics.ts +7 -0
- package/src/codex/shim-legacy-record.ts +290 -0
- package/src/codex/shim-windows-refresh.ts +9 -2
- package/src/codex/shim-wrapper-write.ts +7 -0
- package/src/codex/shim.ts +80 -21
- package/src/codex/toml-source-lines.ts +72 -13
- package/src/combos/failover.ts +6 -109
- package/src/combos/request.ts +2 -2
- package/src/combos/resolve.ts +29 -11
- package/src/config/diagnostics.ts +9 -9
- package/src/config/load-degrade.ts +27 -27
- package/src/config/process-state.ts +5 -0
- package/src/config/provider-validation.ts +9 -2
- package/src/config/removed-opencode-free-backup.ts +6 -3
- package/src/config/schema/leaf-validators.ts +1 -0
- package/src/config/tracked-runtime-inspection.ts +3 -3
- package/src/generated/compatibility-version.json +595 -255
- package/src/images/loop.ts +4 -3
- package/src/lib/client-error-body.ts +215 -0
- package/src/lib/client-retry-after.ts +66 -0
- package/src/lib/config-ownership-removal.ts +422 -0
- package/src/lib/config-ownership.ts +650 -81
- package/src/lib/context-overflow-verdict.ts +113 -0
- package/src/lib/crash-guard.ts +4 -2
- package/src/lib/desktop-cli-handoff.d.mts +4 -5
- package/src/lib/desktop-cli-handoff.mjs +18 -17
- package/src/lib/empty-tool-catalog.ts +25 -3
- package/src/lib/error-destination.ts +47 -0
- package/src/lib/errors.ts +1 -0
- package/src/lib/failure-detail.ts +66 -0
- package/src/lib/local-management-capability.ts +3 -1
- package/src/lib/messages-error-body.ts +162 -0
- package/src/lib/messages-sse-error-presentation.ts +93 -0
- package/src/lib/model-identity.ts +44 -0
- package/src/lib/passive-read.ts +9 -4
- package/src/lib/private-sqlite-path.ts +124 -0
- package/src/lib/response-service-tier.ts +17 -0
- package/src/lib/retry-after.ts +3 -0
- package/src/lib/socks5-fetch.ts +21 -9
- package/src/lib/spend-ledger-owner.ts +43 -4
- package/src/lib/upstream-condition.ts +142 -0
- package/src/lib/upstream-retry.ts +95 -12
- package/src/lib/windows-owner-acl.ts +22 -9
- package/src/lib/winsw.ts +5 -5
- package/src/lib/workflow-budget.ts +3 -1
- package/src/link/remote-platform.ts +14 -0
- package/src/link/remote-windows.ts +51 -9
- package/src/link/ssh-argv.ts +63 -10
- package/src/oauth/generic-account-failover.ts +13 -11
- package/src/oauth/index.ts +42 -73
- package/src/oauth/oauth-errors.ts +67 -0
- package/src/oauth/store.ts +21 -11
- package/src/protocols/codecs/messages-ir.ts +15 -9
- package/src/protocols/codecs/ollama.ts +197 -0
- package/src/protocols/encoders/adapter-events.ts +30 -7
- package/src/protocols/encoders/chat.ts +18 -10
- package/src/protocols/encoders/messages.ts +72 -28
- package/src/protocols/trace.ts +18 -0
- package/src/providers/antigravity-models.ts +45 -12
- package/src/providers/fastwire.ts +3 -2
- package/src/providers/free-directory.ts +2 -2
- package/src/providers/quota/anthropic-usage-windows.ts +13 -3
- package/src/providers/quota/vendor-probes-key.ts +60 -24
- package/src/providers/reasoning-metadata.ts +2 -1
- package/src/providers/registry/entries-extended.ts +9 -0
- package/src/providers/request-pacing.ts +3 -2
- package/src/reasoning-effort.ts +7 -2
- package/src/remote/hub-usage.ts +3 -0
- package/src/responses/apply-patch-envelope.ts +45 -19
- package/src/responses/compaction-history-framing.ts +5 -1
- package/src/responses/freeform-wrapper-scan.ts +5 -3
- package/src/responses/progressive-freeform-input.ts +354 -45
- package/src/routing/fallback-policy.ts +3 -1
- package/src/server/admission-model-scope.ts +17 -6
- package/src/server/admitted-http-turn.ts +57 -0
- package/src/server/anthropic-rate-limit-headers.ts +75 -3
- package/src/server/auth-cors.ts +5 -0
- package/src/server/chat-completions.ts +45 -20
- package/src/server/chat-native-sse.ts +52 -7
- package/src/server/chat-native.ts +60 -35
- package/src/server/claude-bridge-pool-session.ts +59 -0
- package/src/server/claude-messages.ts +174 -84
- package/src/server/context-history.ts +5 -1
- package/src/server/gui-static.ts +4 -1
- package/src/server/hub-usage.ts +7 -2
- package/src/server/inbound-body-admission.ts +11 -4
- package/src/server/index/link-management.ts +8 -0
- package/src/server/index/ollama-routes.ts +91 -0
- package/src/server/index/serve-options.ts +44 -24
- package/src/server/index/startup-warnings.ts +5 -12
- package/src/server/index/websocket-handler.ts +5 -2
- package/src/server/index.ts +6 -36
- package/src/server/inference/client-encoder-delivery.ts +9 -3
- package/src/server/json-serialized-bytes.ts +44 -0
- package/src/server/management/agent-settings-routes.ts +24 -21
- package/src/server/management/codex-cli-update-routes.ts +2 -1
- package/src/server/management/logs-usage-routes.ts +89 -4
- package/src/server/management/provider-routes.ts +2 -22
- package/src/server/management/qoder-provider-probe.ts +105 -0
- package/src/server/management/route-registry.ts +4 -1
- package/src/server/management/usage-aggregate-cache.ts +15 -5
- package/src/server/management/usage-source-facets.ts +38 -0
- package/src/server/messages-native-scope.ts +2 -1
- package/src/server/messages-native-tool-guard.ts +12 -4
- package/src/server/messages-native.ts +123 -47
- package/src/server/messages-response-headers.ts +25 -11
- package/src/server/messages-shared.ts +99 -65
- package/src/server/messages-sse-error-filter.ts +199 -0
- package/src/server/native-final-log.ts +93 -0
- package/src/server/ollama-inbound.ts +349 -0
- package/src/server/ollama-native-paths.ts +21 -0
- package/src/server/ollama-route-policy.ts +73 -0
- package/src/server/relay.ts +22 -3
- package/src/server/request-decompress.ts +4 -2
- package/src/server/request-log-failure-attribution.ts +22 -0
- package/src/server/request-log-failure-detail.ts +80 -0
- package/src/server/request-log-terminal-status.ts +4 -2
- package/src/server/request-log.ts +91 -42
- package/src/server/response-log-body.ts +6 -1
- package/src/server/responses/account-change-state.ts +17 -6
- package/src/server/responses/adapter-continuation.ts +17 -6
- package/src/server/responses/adapter-delivery.ts +17 -10
- package/src/server/responses/adapter-dispatch.ts +32 -31
- package/src/server/responses/anthropic-thinking-recovery.ts +3 -0
- package/src/server/responses/codex-auth-error.ts +24 -19
- package/src/server/responses/codex-ws-exchange.ts +11 -8
- package/src/server/responses/codex-ws-metadata.ts +94 -21
- package/src/server/responses/codex-ws-request.ts +3 -1
- package/src/server/responses/codex-ws-wire.ts +19 -3
- package/src/server/responses/compact.ts +57 -24
- package/src/server/responses/compaction-recovery.ts +4 -2
- package/src/server/responses/compaction-routing.ts +9 -4
- package/src/server/responses/core-auth.ts +32 -14
- package/src/server/responses/core-codex-account.ts +17 -6
- package/src/server/responses/core-combo-failure.ts +7 -1
- package/src/server/responses/core-combo-native.ts +2 -1
- package/src/server/responses/core-combo.ts +43 -27
- package/src/server/responses/core-errors.ts +24 -21
- package/src/server/responses/core-lifetime.ts +6 -3
- package/src/server/responses/core-normalize.ts +1 -0
- package/src/server/responses/core-options.ts +9 -0
- package/src/server/responses/core-pipeline.ts +4 -3
- package/src/server/responses/empty-completion-guard.ts +4 -1
- package/src/server/responses/fetch-helpers.ts +7 -1
- package/src/server/responses/input-admission.ts +28 -2
- package/src/server/responses/native-injection.ts +1 -1
- package/src/server/responses/native-response-json.ts +13 -4
- package/src/server/responses/native-response-output.ts +1 -2
- package/src/server/responses/non-replayable-error.ts +2 -1
- package/src/server/responses/pacing-overload.ts +3 -2
- package/src/server/responses/passthrough-delivery.ts +55 -14
- package/src/server/responses/passthrough-dispatch.ts +20 -18
- package/src/server/responses/passthrough-error.ts +9 -9
- package/src/server/responses/policy-fallback.ts +2 -1
- package/src/server/responses/request-prepare.ts +69 -48
- package/src/server/responses/request-transport.ts +36 -31
- package/src/server/responses/response-effects.ts +3 -2
- package/src/server/responses/run-turn-execution.ts +6 -6
- package/src/server/responses/sidecar-execution.ts +16 -12
- package/src/server/responses/spend-storage-error.ts +2 -1
- package/src/server/responses/terminal-guard.ts +30 -0
- package/src/server/responses/ws-upstream.ts +9 -0
- package/src/server/responses-custom-tool-repair.ts +14 -3
- package/src/server/responses-terminal-repair.ts +5 -2
- package/src/server/responses-undeclared-tool-guard.ts +39 -16
- package/src/server/restart-replacement.ts +3 -1
- package/src/server/safe-response-headers.ts +162 -13
- package/src/server/sse-payload-rewrite.ts +23 -11
- package/src/server/turn-state-handles.ts +164 -0
- package/src/server/workflow-refusal.ts +2 -1
- package/src/server/ws-bridge.ts +4 -0
- package/src/service/definition.ts +36 -4
- package/src/service/launchd.ts +89 -32
- package/src/service/logging.ts +34 -7
- package/src/service/ownership-mutation-lease.d.mts +11 -2
- package/src/service/ownership-mutation-lease.mjs +53 -11
- package/src/service/plist-xml.ts +59 -0
- package/src/service/state.ts +8 -0
- package/src/service/systemd-env.ts +2 -0
- package/src/service/systemd.ts +31 -7
- package/src/service/windows-taskxml.ts +16 -7
- package/src/service-manager-probe.ts +4 -10
- package/src/types/config.ts +2 -0
- package/src/types/provider.ts +2 -0
- package/src/types/request.ts +13 -1
- package/src/update/config-preflight.ts +48 -0
- package/src/update/index.ts +148 -26
- package/src/update/npm-install.d.mts +8 -0
- package/src/update/npm-install.mjs +20 -1
- package/src/update/orchestrated-admission.d.mts +4 -0
- package/src/update/orchestrated-admission.mjs +12 -0
- package/src/update/orchestrated-arguments.d.mts +12 -0
- package/src/update/orchestrated-arguments.mjs +64 -0
- package/src/update/orchestrated-child.d.mts +12 -0
- package/src/update/orchestrated-child.mjs +70 -0
- package/src/update/orchestrated-entry.ts +234 -0
- package/src/update/orchestrated-identity-probe-entry.ts +20 -0
- package/src/update/orchestrated-identity.ts +53 -0
- package/src/update/orchestrated-live-identity.ts +48 -0
- package/src/update/orchestrated-node-driver.mjs +99 -0
- package/src/update/orchestrated-outcome.d.mts +21 -0
- package/src/update/orchestrated-outcome.mjs +40 -0
- package/src/update/orchestrated-plan.ts +49 -0
- package/src/update/orchestrated-pnpm.d.mts +8 -0
- package/src/update/orchestrated-pnpm.mjs +33 -0
- package/src/update/orchestrated-session.d.mts +37 -0
- package/src/update/orchestrated-session.mjs +264 -0
- package/src/update/orchestrated-token.d.mts +10 -0
- package/src/update/orchestrated-token.mjs +21 -0
- package/src/update/orchestrated-token.ts +3 -0
- package/src/update/orchestrated-tree.d.mts +1 -0
- package/src/update/orchestrated-tree.mjs +14 -0
- package/src/update/pnpm-global-install.d.mts +6 -0
- package/src/update/pnpm-global-install.mjs +9 -2
- package/src/update/posix-install-supervisor-entry.mjs +6 -0
- package/src/update/posix-install-supervisor.d.mts +10 -0
- package/src/update/posix-install-supervisor.mjs +88 -0
- package/src/update/sync-update-mutex.d.mts +10 -0
- package/src/update/sync-update-mutex.mjs +164 -0
- package/src/update/sync-update-mutex.ts +1 -0
- package/src/update/test-home-guard.mjs +33 -0
- package/src/update/transactional-install.mjs +2 -2
- package/src/usage/client.ts +43 -0
- package/src/usage/error-detail.ts +225 -0
- package/src/usage/log.ts +64 -27
- package/src/usage/source-facets.ts +51 -0
- package/src/usage/source-filter.ts +65 -0
- package/src/usage/summary.ts +50 -8
- package/src/web-search/anthropic-executor.ts +105 -24
- package/src/web-search/executor.ts +5 -3
- package/src/web-search/loop.ts +33 -6
- package/src/web-search/progress-stream.ts +64 -5
- package/gui/dist/assets/App-bwugJRKn.js +0 -58
- package/gui/dist/assets/index-ebuVUtB7.js +0 -94
- package/gui/dist/assets/quota-summary-6HsrHQAy.js +0 -1
- /package/gui/dist/{assets → classic/assets}/App-B4j-Txmb.css +0 -0
- /package/gui/dist/{assets → classic/assets}/index-CHWwDo9L.css +0 -0
|
@@ -34,7 +34,7 @@ import { selfLaunchArgv } from "../lib/self-launch-argv";
|
|
|
34
34
|
import { loadServiceTokenFromFile, serviceApiTokenFilePath } from "../lib/service-secrets";
|
|
35
35
|
import { findExecutableOnPath } from "../remote-control/workspace-executable";
|
|
36
36
|
import { findLiveProxy, type LiveProxy } from "../server/proxy-liveness";
|
|
37
|
-
import { codexCredentialDestinationIsTrusted, resolveCodexLaunchHome } from "./codex-launch-auth";
|
|
37
|
+
import { attestCodexRuntime, codexCredentialDestinationIsTrusted, resolveCodexLaunchHome, type CodexRuntimeAttestation } from "./codex-launch-auth";
|
|
38
38
|
import { codexCommandCanBypass, CODEX_UNVERIFIED_SHIM } from "./codex-launch-command";
|
|
39
39
|
import { codexTokenArgsAreSafe, codexTokenEnvironmentIsSafe } from "./codex-launch-policy";
|
|
40
40
|
import { codexTokenWithheldDiagnostic, type CodexTokenRefusal, type CodexTokenRefusalReporter } from "./codex-launch-diagnostics";
|
|
@@ -158,7 +158,9 @@ export type CodexLaunchEnvDeps = {
|
|
|
158
158
|
args?: readonly string[];
|
|
159
159
|
/** Test seam; production reads the hardened service token file. */
|
|
160
160
|
serviceToken?: (base: CodexLaunchEnv) => string | null;
|
|
161
|
-
credentialDestination?: (home: string, report?: CodexTokenRefusalReporter) => boolean;
|
|
161
|
+
credentialDestination?: (home: string, report?: CodexTokenRefusalReporter, runtimeAttestation?: CodexRuntimeAttestation | null) => boolean;
|
|
162
|
+
/** Exact origin that proved this home's runtime-record secret. */
|
|
163
|
+
runtimeAttestation?: CodexRuntimeAttestation | null;
|
|
162
164
|
};
|
|
163
165
|
|
|
164
166
|
/** Read the client admission credential from this installation's service-token file. */
|
|
@@ -186,6 +188,7 @@ export function buildCodexLaunchEnv(
|
|
|
186
188
|
};
|
|
187
189
|
if (!codexTokenArgsAreSafe(deps.args ?? [])) return withhold("args");
|
|
188
190
|
if (!codexTokenEnvironmentIsSafe(env)) return withhold("environment");
|
|
191
|
+
if (!deps.runtimeAttestation) return withhold("destination");
|
|
189
192
|
// NO_PROXY parsing and precedence vary across native HTTP/WebSocket transports.
|
|
190
193
|
// Without proving bypass, preserve the user's transport but never load a secret.
|
|
191
194
|
const home = resolveCodexLaunchHome(env);
|
|
@@ -193,8 +196,8 @@ export function buildCodexLaunchEnv(
|
|
|
193
196
|
let refusal: CodexTokenRefusal = "destination";
|
|
194
197
|
const report: CodexTokenRefusalReporter = reason => { refusal = reason; };
|
|
195
198
|
const trusted = deps.credentialDestination
|
|
196
|
-
? deps.credentialDestination(home, report)
|
|
197
|
-
: codexCredentialDestinationIsTrusted(home, undefined, report);
|
|
199
|
+
? deps.credentialDestination(home, report, deps.runtimeAttestation)
|
|
200
|
+
: codexCredentialDestinationIsTrusted(home, undefined, report, deps.runtimeAttestation);
|
|
198
201
|
if (!trusted) return withhold(refusal);
|
|
199
202
|
const token = (deps.serviceToken ?? defaultServiceToken)(env);
|
|
200
203
|
if (!token) return withhold("credential");
|
|
@@ -318,5 +321,9 @@ export async function cmdCodex(args: string[]): Promise<number> {
|
|
|
318
321
|
// what the session does next; `ocx doctor` names the autostart failure.
|
|
319
322
|
console.error(CODEX_SHIM_ENSURE_FAILED_DIAGNOSTIC);
|
|
320
323
|
}
|
|
321
|
-
|
|
324
|
+
// A public health marker proves liveness, not ownership of the listener. Never read the
|
|
325
|
+
// persisted service token until the exact runtime-record endpoint answers a fresh challenge.
|
|
326
|
+
const runtimeAttestation = plan.kind === "routed" && live !== null
|
|
327
|
+
? await attestCodexRuntime(live) : null;
|
|
328
|
+
return spawnCodex(args, buildCodexLaunchEnv(process.env, { routingKind, args, runtimeAttestation }));
|
|
322
329
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { autoRestoreCodexShim, autoRestoreCodexShimAsync } from "../codex/shim";
|
|
2
2
|
import { codexShimAutoRestoreEnabled, readConfigDiagnostics } from "../config";
|
|
3
|
+
import { isOrchestratedUpdateArgv } from "../update/orchestrated-arguments.mjs";
|
|
3
4
|
|
|
4
5
|
export interface CodexShimAutoRestoreCliDeps {
|
|
5
6
|
env: NodeJS.ProcessEnv;
|
|
@@ -18,7 +19,13 @@ const DEFAULT_DEPS: CodexShimAutoRestoreCliDeps = {
|
|
|
18
19
|
/** Identify command namespaces whose execution must not trigger automatic shim repair. */
|
|
19
20
|
export function skipsCodexShimAutoRestore(command: string | undefined, args: string[]): boolean {
|
|
20
21
|
if (command === "uninstall" || command === "remove") return true;
|
|
22
|
+
// Contract discovery and orchestrated update must validate before any repair.
|
|
23
|
+
if (command === "capabilities") return true;
|
|
24
|
+
if (command === "update" && isOrchestratedUpdateArgv(args)) return true;
|
|
25
|
+
if (command === "sync") return true;
|
|
21
26
|
if (command === "status" || command === "doctor") return true;
|
|
27
|
+
// Explicit orphan-token recovery must not mutate Codex before its guards run.
|
|
28
|
+
if (command === "disconnect" && args.includes("--orphaned-token")) return true;
|
|
22
29
|
// The launcher owns shim handoff after classifying routing, including native fast paths.
|
|
23
30
|
if (command === "codex") return true;
|
|
24
31
|
// Exec admission only observes the selected target; it must never repair a shim first.
|
|
@@ -30,6 +37,11 @@ export function skipsCodexShimAutoRestore(command: string | undefined, args: str
|
|
|
30
37
|
// `resolve` is read-only inspection for embedding shells: a lookup made to populate
|
|
31
38
|
// a consent surface must not trigger a shim repair side effect first.
|
|
32
39
|
if (command === "resolve") return true;
|
|
40
|
+
// Local model inventory is read-only; mutations and live commands keep preflight.
|
|
41
|
+
if (command === "models" || command === "model") {
|
|
42
|
+
const subcommand = args[1];
|
|
43
|
+
if (!subcommand || subcommand.startsWith("-") || subcommand === "list" || subcommand === "list-custom") return true;
|
|
44
|
+
}
|
|
33
45
|
// `service status --json` is a passive inventory read for peers such as GOAT: a shim repair
|
|
34
46
|
// before dispatch would change the installation it was asked only to describe.
|
|
35
47
|
// Flags may precede the verb (`ocx service --json status`), exactly as parseServiceArgs reads it.
|
|
@@ -38,10 +50,6 @@ export function skipsCodexShimAutoRestore(command: string | undefined, args: str
|
|
|
38
50
|
// The desktop's approval-bound stop must validate its snapshot before any unrelated
|
|
39
51
|
// CLI repair changes the installation it was approved against.
|
|
40
52
|
if (command === "stop" && args.some(arg => arg.startsWith("--expect-"))) return true;
|
|
41
|
-
// A pinned sync (#7694) must change nothing when its expected Home or hub key does not hold,
|
|
42
|
-
// so the root preflight may not repair the shim first; the sync runner repairs it only after
|
|
43
|
-
// the locked identity check passed (runCodexShimAutoRestore in src/cli/dispatch.ts).
|
|
44
|
-
if (command === "sync" && args.some(arg => /^--expect-(link|hub-key)(=|$)/.test(arg))) return true;
|
|
45
53
|
// The entire updater-inspection namespace is zero-effect, including malformed
|
|
46
54
|
// or future actions. A later `apply` implementation must own its preflight.
|
|
47
55
|
if (command === "system" && args[1] === "codex-cli-update") return true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { clearCodexAccountPin } from "../codex/account-priority";
|
|
3
|
-
import { getConfigPath, mutatePersistedConfig, readConfigDiagnostics, sanitizeModelCostsForDisplay, saveConfig, validateConfigCandidate } from "../config";
|
|
3
|
+
import { getConfigPath, mutatePersistedConfig, readConfigDiagnostics, sanitizeModelCostsForDisplay, saveConfig, validateConfigCandidate, withConfigMutationLockSync } from "../config";
|
|
4
|
+
import { readClientConnectionState } from "../client/state";
|
|
4
5
|
import { getConfigDir, withConfigDirHardeningSettled } from "../config/paths";
|
|
5
6
|
import { readCliConfigForMutation } from "./config-mutation";
|
|
6
7
|
import { VISION_REASONING_EFFORTS, isVisionReasoningEffort } from "../reasoning-effort";
|
|
@@ -331,7 +332,15 @@ export async function handleConfigCommand(argv: string[]): Promise<number> {
|
|
|
331
332
|
rejectArgs(args, USAGE);
|
|
332
333
|
await withConfigDirHardeningSettled(getConfigDir(), () => {
|
|
333
334
|
readCliConfigForMutation();
|
|
334
|
-
|
|
335
|
+
const imported = validate(loadInput(path));
|
|
336
|
+
withConfigMutationLockSync(() => {
|
|
337
|
+
const client = readClientConnectionState();
|
|
338
|
+
if (client.kind === "connected" && (imported.runtimeRole !== "client"
|
|
339
|
+
|| JSON.stringify(imported.client) !== JSON.stringify(client.value))) {
|
|
340
|
+
throw new Error("config import refused: disconnect the active client before replacing its connection");
|
|
341
|
+
}
|
|
342
|
+
saveConfig(imported);
|
|
343
|
+
});
|
|
335
344
|
});
|
|
336
345
|
printData({ ok: true, source: path }, wantsJson, [`Imported config from ${path}. Restart or run ocx sync if needed.`]);
|
|
337
346
|
return;
|
package/src/cli/connect.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { teardownClientLink } from "../client/link-teardown";
|
|
|
20
20
|
import { reapOrphanTunnel } from "../client/link-tunnel";
|
|
21
21
|
import { readServiceApiTokenState } from "../lib/service-secrets";
|
|
22
22
|
import type { ClientLifecycleLockDeps } from "../client/lifecycle-lock";
|
|
23
|
+
import { recoverOrphanedTokens, type OrphanTokenRecoveryDeps } from "../client/orphan-token-recovery";
|
|
23
24
|
import { linkKnownHostsPath } from "../link/paths";
|
|
24
25
|
import { createSshRunner, type SshRunner } from "../link/ssh-runner";
|
|
25
26
|
import type { OrphanTunnelResult } from "../client/link-tunnel";
|
|
@@ -83,7 +84,8 @@ export const CONNECT_USAGE = `Usage:
|
|
|
83
84
|
ocx connect revoke --admin-token-stdin [--json]`;
|
|
84
85
|
|
|
85
86
|
export const DISCONNECT_USAGE = `Usage:
|
|
86
|
-
ocx disconnect [--keep-catalog] [--json]
|
|
87
|
+
ocx disconnect [--keep-catalog] [--json]
|
|
88
|
+
ocx disconnect --orphaned-token --yes [--json]`;
|
|
87
89
|
|
|
88
90
|
export type ClientConnectionStatus = {
|
|
89
91
|
state: "disconnected" | "connected" | "invalid" | "mismatched";
|
|
@@ -529,13 +531,26 @@ export async function handleConnectCommand(argv: string[], deps: ClientCommandDe
|
|
|
529
531
|
|
|
530
532
|
export async function handleDisconnectCommand(
|
|
531
533
|
argv: string[],
|
|
532
|
-
deps: Pick<ClientCommandDeps, "lifecycleLockDeps" | "linkTeardownDeps"> = {},
|
|
534
|
+
deps: Pick<ClientCommandDeps, "lifecycleLockDeps" | "linkTeardownDeps"> & { orphanRecoveryDeps?: OrphanTokenRecoveryDeps } = {},
|
|
533
535
|
): Promise<number> {
|
|
534
536
|
return runCliAction(async () => {
|
|
535
537
|
const args = [...argv];
|
|
536
538
|
const keepCatalog = takeFlag(args, "--keep-catalog");
|
|
537
539
|
const wantsJson = takeFlag(args, "--json");
|
|
540
|
+
const orphanedToken = takeFlag(args, "--orphaned-token");
|
|
541
|
+
const yes = takeFlag(args, "--yes");
|
|
538
542
|
rejectArgs(args, DISCONNECT_USAGE, { redactValues: true });
|
|
543
|
+
if (orphanedToken) {
|
|
544
|
+
if (!yes || keepCatalog) throw new CliUsageError("--orphaned-token requires --yes and cannot be combined with --keep-catalog", DISCONNECT_USAGE);
|
|
545
|
+
const backup = await recoverOrphanedTokens({ ...deps.orphanRecoveryDeps, lifecycleLockDeps: deps.lifecycleLockDeps });
|
|
546
|
+
const restore = "Stop OpenCodex and move the saved files back into its config directory only if the destination names are absent.";
|
|
547
|
+
printData({ ...backup, restore }, wantsJson, [
|
|
548
|
+
`Preserved token files in ${backup.backupDir}.`,
|
|
549
|
+
`To restore: ${restore}`,
|
|
550
|
+
]);
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
if (yes) throw new CliUsageError("--yes requires --orphaned-token", DISCONNECT_USAGE);
|
|
539
554
|
const teardown = await teardownClientLink({
|
|
540
555
|
readSidecar: readClientLinkState,
|
|
541
556
|
connectedLinkId: () => {
|
package/src/cli/dispatch.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProxyRestartStartOutcome } from "./tray-proxy";
|
|
2
|
+
import type { RestartSupervisor } from "./restart-failure";
|
|
2
3
|
/**
|
|
3
4
|
* Registry-driven command dispatch (Phase 3 of the CLI deepening).
|
|
4
5
|
*
|
|
@@ -15,7 +16,6 @@ import { uninstallArgsError, type CliHead } from "./root";
|
|
|
15
16
|
import type { ReadyArgs } from "./ready";
|
|
16
17
|
import type { LivenessIo, LiveProxy } from "../server/proxy-liveness";
|
|
17
18
|
import type { OcxConfig } from "../types";
|
|
18
|
-
import type { OwnedIntegrationRefreshOutcome } from "../integrations/owned-refresh";
|
|
19
19
|
import { hasHelpFlag, printSubcommandUsage, printUsage } from "./help";
|
|
20
20
|
import { printUnknownCommand } from "./help-recovery";
|
|
21
21
|
import {
|
|
@@ -30,9 +30,9 @@ import { syncModelsToCodex } from "../codex/sync";
|
|
|
30
30
|
import { collectOrcaCodexHomeDiagnostic } from "../codex/home";
|
|
31
31
|
import { restoreNativeCodexAsync, type CodexNativeRestoreResult } from "../codex/inject";
|
|
32
32
|
import { stripGrokConfig } from "../grok/inject";
|
|
33
|
-
import { handleRestartScopeAfterWrite, readRestartScope
|
|
33
|
+
import { handleRestartScopeAfterWrite, readRestartScope } from "./restart-scope";
|
|
34
34
|
import { normalizeUpdateChannel, runGuiUpdateWorker } from "../update/job";
|
|
35
|
-
import { isJsonOption, takeFlag
|
|
35
|
+
import { isJsonOption, takeFlag } from "./runtime-api";
|
|
36
36
|
import { printStopSummary, type StopOutcome } from "./stop-report";
|
|
37
37
|
import { parseStopApproval, type StopApproval } from "./stop-approval";
|
|
38
38
|
import type { ResolveArgs } from "./resolve";
|
|
@@ -60,7 +60,7 @@ export interface CliDispatchDeps {
|
|
|
60
60
|
handleTrayProxyStart: (existingIsSuccess?: boolean) => Promise<boolean>;
|
|
61
61
|
handleTrayProxyRestart: () => Promise<void>;
|
|
62
62
|
handleRestartStartWhenStopped: (recoveringLiveRestart?: boolean) => Promise<ProxyRestartStartOutcome>;
|
|
63
|
-
handleProxyRestart: (startWhenStopped: (recoveringLiveRestart: boolean) => Promise<ProxyRestartStartOutcome
|
|
63
|
+
handleProxyRestart: (startWhenStopped: (recoveringLiveRestart: boolean) => Promise<ProxyRestartStartOutcome>, onSupervised?: (supervisor: RestartSupervisor) => void) => Promise<boolean>;
|
|
64
64
|
handleUninstall: () => Promise<void>;
|
|
65
65
|
handleStatus: () => Promise<void>;
|
|
66
66
|
handleRecoverHistory: () => Promise<void>;
|
|
@@ -404,171 +404,7 @@ const commandRunners: Record<string, CommandRunner> = {
|
|
|
404
404
|
const { handleLogoutCommand } = await import("./logout-command");
|
|
405
405
|
return handleLogoutCommand(deps.args.slice(1), { findLiveProxy: deps.findLiveProxy });
|
|
406
406
|
},
|
|
407
|
-
sync: async deps =>
|
|
408
|
-
const syncArgs = deps.args.slice(1);
|
|
409
|
-
// #7694: parse the expected identity before anything else reads or writes state.
|
|
410
|
-
const { parseSyncExpectation, reportSyncExpectationMismatch, SYNC_EXPECTATION_USAGE_EXIT } = await import("./sync-expectation");
|
|
411
|
-
const parsedExpectation = parseSyncExpectation(syncArgs);
|
|
412
|
-
if (!parsedExpectation.ok) {
|
|
413
|
-
console.error(parsedExpectation.message);
|
|
414
|
-
return SYNC_EXPECTATION_USAGE_EXIT;
|
|
415
|
-
}
|
|
416
|
-
const expectation = parsedExpectation.expectation;
|
|
417
|
-
const restartScope = readRestartScope(syncArgs, console);
|
|
418
|
-
// The wire field keeps APP-SERVER-ONLY meaning and is deliberately not widened. A
|
|
419
|
-
// remote hub must not end a local user's conversations because a field name acquired
|
|
420
|
-
// a wider meaning underneath it; the maintainer decision widened a local CLI flag and
|
|
421
|
-
// said nothing about remote callers. syncConnectedClient ignores it either way.
|
|
422
|
-
const restartCodex = restartScope.appServers;
|
|
423
|
-
const { readClientConnectionState } = await import("../client/state");
|
|
424
|
-
const clientState = readClientConnectionState();
|
|
425
|
-
// With an expectation the unlocked read decides nothing: the connected sync re-reads under its
|
|
426
|
-
// lock and refuses there, so a state that changes in between can never reach the local path.
|
|
427
|
-
if (!expectation && (clientState.kind === "invalid" || clientState.kind === "mismatched")) {
|
|
428
|
-
console.error(`Client state is ${clientState.kind}: ${clientState.reason}`);
|
|
429
|
-
return 1;
|
|
430
|
-
}
|
|
431
|
-
if (expectation || clientState.kind === "connected") {
|
|
432
|
-
try {
|
|
433
|
-
const { syncConnectedClient } = await import("../client/connect");
|
|
434
|
-
const result = await syncConnectedClient(expectation ? { restartCodex, expect: expectation } : { restartCodex });
|
|
435
|
-
if (expectation) {
|
|
436
|
-
// The root preflight skipped the shim repair for a pinned sync; the identity held, so
|
|
437
|
-
// run it now, as an unpinned sync would have.
|
|
438
|
-
const { runCodexShimAutoRestoreAsync } = await import("./codex-shim-autorestore");
|
|
439
|
-
await runCodexShimAutoRestoreAsync();
|
|
440
|
-
}
|
|
441
|
-
// The connection the sync ran under, read inside its lock; the read above may be stale.
|
|
442
|
-
const link = result.connection.transport === "link";
|
|
443
|
-
console.log(result.stale
|
|
444
|
-
? `${link ? "Home" : "Hub"} unavailable; retained and applied the last-known-good remote catalog (stale).`
|
|
445
|
-
: link ? "Remote Link Home catalog synchronized." : "Remote hub catalog synchronized.");
|
|
446
|
-
if (result.homeSettings) {
|
|
447
|
-
const { describeHomeCodexSettings } = await import("../link/codex-settings");
|
|
448
|
-
const settings = result.homeSettings;
|
|
449
|
-
if (settings.source === "local") {
|
|
450
|
-
console.log(`Codex settings: kept this machine's local values (${terminalSafeText(settings.reason)}).`);
|
|
451
|
-
} else {
|
|
452
|
-
console.log(settings.source === "home"
|
|
453
|
-
? `Codex settings applied from Home ${terminalSafeText(settings.document.home.name)}:`
|
|
454
|
-
: `Codex settings applied from the last recorded Home read (${terminalSafeText(settings.reason)}):`);
|
|
455
|
-
for (const line of describeHomeCodexSettings(settings.document.settings)) console.log(` ${terminalSafeText(line)}`);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
await handleConnectedSyncCatalogWrite(result, restartScope);
|
|
459
|
-
if (result.applyRecordFailed) {
|
|
460
|
-
console.error("The Home's Codex settings were applied, but the apply record could not be written; the client runtime was not restarted. Run 'ocx sync' again.");
|
|
461
|
-
process.exitCode = 1;
|
|
462
|
-
}
|
|
463
|
-
// OCX-6: a link Child's runtime must have started after the apply it serves under.
|
|
464
|
-
if (link && result.appliedRecord) {
|
|
465
|
-
const { applyRestartMessage, restartRuntimeAfterApply } = await import("./link-apply-restart");
|
|
466
|
-
const { sameClientConnectionOwner } = await import("../client/state");
|
|
467
|
-
const applied = result.connection;
|
|
468
|
-
const outcome = await restartRuntimeAfterApply(result.appliedRecord, {
|
|
469
|
-
restart: startWhenStopped => deps.handleProxyRestart(startWhenStopped),
|
|
470
|
-
recoveryStart: recovering => deps.handleRestartStartWhenStopped(recovering),
|
|
471
|
-
connectionUnchanged: () => {
|
|
472
|
-
const current = readClientConnectionState();
|
|
473
|
-
return current.kind === "connected" && sameClientConnectionOwner(current.value, applied)
|
|
474
|
-
&& current.value.link?.linkId === applied.link?.linkId;
|
|
475
|
-
},
|
|
476
|
-
});
|
|
477
|
-
const message = applyRestartMessage(outcome);
|
|
478
|
-
if (outcome.kind === "failed" || outcome.kind === "connection-changed") {
|
|
479
|
-
console.error(message);
|
|
480
|
-
process.exitCode = 1;
|
|
481
|
-
} else {
|
|
482
|
-
console.log(message);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
// `process.exitCode` rather than a literal 0, for the same reason every other
|
|
486
|
-
// runner does it (tests/cli/cli-transport-honesty.test.ts): the catalog-write helper
|
|
487
|
-
// drives app-server restarts, and one of those recording a failure must not be
|
|
488
|
-
// erased by the value this runner returns. It reads 0 on the ordinary path. Node
|
|
489
|
-
// types it as `number | string`; only a numeric code means anything here.
|
|
490
|
-
return typeof process.exitCode === "number" ? process.exitCode : 0;
|
|
491
|
-
} catch (error) {
|
|
492
|
-
const { ClientSyncExpectationError } = await import("../client/sync-expectation");
|
|
493
|
-
if (error instanceof ClientSyncExpectationError) return reportSyncExpectationMismatch(error, console);
|
|
494
|
-
// The refresh path reaches the same hub catalog `ocx connect` validates, so a rejected
|
|
495
|
-
// reasoning level arrives here as hub-supplied text. Rendering it through the shared
|
|
496
|
-
// terminal boundary is what keeps the routine refresh from forging output; the domain
|
|
497
|
-
// error itself is left alone for callers that inspect it.
|
|
498
|
-
console.error(`Connected sync failed without local fallback: ${terminalSafeError(error).message}`);
|
|
499
|
-
return 1;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
const live = await deps.findLiveProxy();
|
|
503
|
-
const synced = await syncModelsToCodex(
|
|
504
|
-
live?.port,
|
|
505
|
-
undefined,
|
|
506
|
-
undefined,
|
|
507
|
-
undefined,
|
|
508
|
-
{ catalogEvenWhenNotInjected: true },
|
|
509
|
-
);
|
|
510
|
-
let code = 0;
|
|
511
|
-
if (synced.status === "skipped") {
|
|
512
|
-
console.log(synced.skippedReason === "hub-gated"
|
|
513
|
-
? `${HUB_GATED_SKIP_MESSAGE} sync skipped and no Codex files changed.`
|
|
514
|
-
: "Codex integration is OFF; sync skipped and no Codex files changed.");
|
|
515
|
-
} else if (synced.status === "catalog-only") {
|
|
516
|
-
// Explicit sync with the integration OFF still refreshes the catalog/cache
|
|
517
|
-
// for side profiles that consume the proxy without injection.
|
|
518
|
-
console.log(synced.message ?? "Codex integration is OFF; catalog refreshed, Codex config untouched.");
|
|
519
|
-
if (!synced.ok) code = 1;
|
|
520
|
-
} else if (!synced.ok) {
|
|
521
|
-
code = 1;
|
|
522
|
-
console.error("Codex sync did not complete. Fix the reported Codex config issue and retry.");
|
|
523
|
-
}
|
|
524
|
-
// Catalog/model-cache writes retain their warning/restart handling. This is
|
|
525
|
-
// deliberately not an `else`: refreshCodexModelCatalog runs before injectCodexConfig,
|
|
526
|
-
// so a sync can fail (`ok: false`) after the catalog was already rewritten — which is
|
|
527
|
-
// exactly when a long-lived app-server is holding the stale list.
|
|
528
|
-
// A configuration-only change also needs a reload, but only when explicitly
|
|
529
|
-
// requested. A successful no-op or refused write is never restart authority.
|
|
530
|
-
const requestedConfigRestart = (restartScope.appServers || restartScope.desktopApp)
|
|
531
|
-
&& synced.ok && synced.configChanged === true;
|
|
532
|
-
if (synced.catalogWritten || synced.cacheSynced || requestedConfigRestart) {
|
|
533
|
-
await handleRestartScopeAfterWrite(restartScope, console);
|
|
534
|
-
}
|
|
535
|
-
// `ocx sync` is a direct CLI path; it does not call the management
|
|
536
|
-
// `/api/sync` route. Refresh already-connected file integrations here too,
|
|
537
|
-
// after Codex has published the catalog that supplies its capabilities.
|
|
538
|
-
if (synced.status !== "refused") {
|
|
539
|
-
const results: OwnedIntegrationRefreshOutcome[] = [];
|
|
540
|
-
if (live) {
|
|
541
|
-
try {
|
|
542
|
-
const config = deps.loadConfig();
|
|
543
|
-
const { refreshOwnedCatalogIntegrations } = await import("../integrations/catalog-refresh");
|
|
544
|
-
results.push(...await refreshOwnedCatalogIntegrations({
|
|
545
|
-
models: async () => {
|
|
546
|
-
const { loadExportModels } = await import("../server/management/model-rows");
|
|
547
|
-
return loadExportModels(config);
|
|
548
|
-
},
|
|
549
|
-
config,
|
|
550
|
-
port: live.port,
|
|
551
|
-
}, ["mcode", "pi", "raycast", "omo", "cline", "commandcode", "droid", "opencode", "kilo", "qoder", "qoder-cn", "workbuddy", "workbuddy-ai", "hermes", "t3code"]));
|
|
552
|
-
} catch (error) {
|
|
553
|
-
console.warn(`Client integrations were not refreshed: ${error instanceof Error ? error.message : String(error)}`);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
// Even without a live proxy, report why Aside could not sync. Its server
|
|
557
|
-
// owner is never bypassed, and another client's failure cannot hide it.
|
|
558
|
-
try {
|
|
559
|
-
const { refreshAsideProfilesThroughServer } = await import("./aside-profiles");
|
|
560
|
-
results.push(...await refreshAsideProfilesThroughServer({ findLiveProxy: async () => live }));
|
|
561
|
-
} catch (error) {
|
|
562
|
-
console.warn(`Aside profiles were not refreshed: ${error instanceof Error ? error.message : String(error)}`);
|
|
563
|
-
}
|
|
564
|
-
for (const result of results) {
|
|
565
|
-
const label = result.profileId === undefined ? result.client : `${result.client}:${result.profileId}`;
|
|
566
|
-
if (result.changed) console.log(`${label} integration refreshed from the current catalog.`);
|
|
567
|
-
else if (result.reason) console.warn(`${label} integration was not refreshed: ${result.reason}${result.residual ? " Recovery did not finish." : ""}${result.snapshotPath ? ` Backup: ${result.snapshotPath}` : ""}`);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
return code;
|
|
571
|
-
},
|
|
407
|
+
sync: async deps => (await import("./sync-update-guard")).withSyncUpdateGuard(async () => (await import("./sync-command")).runSyncCommand(deps), deps.args),
|
|
572
408
|
v2: async deps => {
|
|
573
409
|
const { cmdV2 } = await import("./v2");
|
|
574
410
|
return await cmdV2(deps.args.slice(1), { runtimeApi: { findLiveProxy: deps.findLiveProxy } }, async () => (await deps.findLiveProxy())?.port);
|
|
@@ -766,6 +602,7 @@ const commandRunners: Record<string, CommandRunner> = {
|
|
|
766
602
|
case "remove": {
|
|
767
603
|
const r = await uninstallCodexShimAsync();
|
|
768
604
|
console.log(r.removed ? `✅ ${r.message}` : `⚠️ ${r.message}`);
|
|
605
|
+
if (r.refused) return 1;
|
|
769
606
|
break;
|
|
770
607
|
}
|
|
771
608
|
default:
|
|
@@ -775,6 +612,14 @@ const commandRunners: Record<string, CommandRunner> = {
|
|
|
775
612
|
return 0;
|
|
776
613
|
},
|
|
777
614
|
update: async deps => {
|
|
615
|
+
const { isOrchestratedUpdateArgv, parseOrchestratedChildArgs } = await import("../update/orchestrated-arguments.mjs");
|
|
616
|
+
if (process.env.OCX_UPDATE_ORCHESTRATED_CHILD === "1" && deps.args.slice(1).some(arg => /^--orchestrated-(expect|result)(?:=|$)/.test(arg))) {
|
|
617
|
+
const child = parseOrchestratedChildArgs(deps.args.slice(1), process.env);
|
|
618
|
+
if (!child.ok) return 64;
|
|
619
|
+
await (await import("../update")).runUpdate(child);
|
|
620
|
+
return Number(process.exitCode ?? 0);
|
|
621
|
+
}
|
|
622
|
+
if (isOrchestratedUpdateArgv(deps.args.slice(1))) return (await import("../update/orchestrated-entry")).runOrchestratedUpdate(deps.args.slice(1));
|
|
778
623
|
// `ocx update --help` must print usage and exit WITHOUT side effects — running the
|
|
779
624
|
// real self-update stops the proxy and drops in-flight routed streams (issue #168).
|
|
780
625
|
if (hasHelpFlag(deps.args.slice(1))) {
|
|
@@ -1254,14 +1099,6 @@ export async function dispatchCommand(head: CliHead, deps: CliDispatchDeps): Pro
|
|
|
1254
1099
|
return await runner(deps);
|
|
1255
1100
|
}
|
|
1256
1101
|
|
|
1257
|
-
async function handleConnectedSyncCatalogWrite(
|
|
1258
|
-
result: { catalogWritten: boolean; cacheSynced: boolean },
|
|
1259
|
-
scope: RestartScope,
|
|
1260
|
-
): Promise<void> {
|
|
1261
|
-
if (!result.catalogWritten && !result.cacheSynced) return;
|
|
1262
|
-
await handleRestartScopeAfterWrite(scope, console);
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
1102
|
async function reconcileClientJournalBeforeLifecycle(
|
|
1266
1103
|
state: ClientConnectionState,
|
|
1267
1104
|
): Promise<void> {
|
package/src/cli/doctor.ts
CHANGED
|
@@ -80,6 +80,84 @@ import {
|
|
|
80
80
|
fetchBoundLocalManagementRead,
|
|
81
81
|
type LocalManagementReadDeps,
|
|
82
82
|
} from "../server/local-management-read-client";
|
|
83
|
+
|
|
84
|
+
/** The live proxy’s native-main admission report, or why it could not be read. */
|
|
85
|
+
export type NativeMainAdmissionBlockReason =
|
|
86
|
+
| "foreign-ownership"
|
|
87
|
+
| "ownership-unknown"
|
|
88
|
+
| "recovery-pending"
|
|
89
|
+
| "manual-recovery"
|
|
90
|
+
| "owner-conflict"
|
|
91
|
+
| "owner-unavailable"
|
|
92
|
+
| "stage-cleanup-required";
|
|
93
|
+
|
|
94
|
+
export type NativeMainAdmissionReport =
|
|
95
|
+
| { status: "ready" }
|
|
96
|
+
| { status: "blocked"; reason: NativeMainAdmissionBlockReason }
|
|
97
|
+
| { status: "unavailable"; reason: string };
|
|
98
|
+
|
|
99
|
+
const NATIVE_MAIN_ADMISSION_BLOCK_REASONS: ReadonlySet<string> = new Set([
|
|
100
|
+
"foreign-ownership", "ownership-unknown", "recovery-pending", "manual-recovery",
|
|
101
|
+
"owner-conflict", "owner-unavailable", "stage-cleanup-required",
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
function isNativeMainAdmissionBlockReason(value: unknown): value is NativeMainAdmissionBlockReason {
|
|
105
|
+
return typeof value === "string" && NATIVE_MAIN_ADMISSION_BLOCK_REASONS.has(value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Read native-main admission from the running proxy, never this doctor process.
|
|
110
|
+
*
|
|
111
|
+
* A separate `ocx doctor` run has its own process-global gate, usually `ready`, while the
|
|
112
|
+
* proxy answering native traffic can be fenced. The proxy's side-effect-free admission
|
|
113
|
+
* endpoint carries its own admissionStatus; the bound read stays on the existing short-lived,
|
|
114
|
+
* path-signed capability rather than exposing the admin token to doctor. An older proxy
|
|
115
|
+
* without that route answers 404, which is reported as unavailable.
|
|
116
|
+
*/
|
|
117
|
+
export async function fetchNativeMainAdmission(
|
|
118
|
+
target: LiveProxy,
|
|
119
|
+
deps: LocalManagementReadDeps = {},
|
|
120
|
+
): Promise<NativeMainAdmissionReport> {
|
|
121
|
+
const read = await fetchBoundLocalManagementRead(
|
|
122
|
+
target,
|
|
123
|
+
LOCAL_MANAGEMENT_READ_PATHS.nativeMainAdmission,
|
|
124
|
+
{ timeoutMs: 4_000, ...deps, requireResponseProof: true },
|
|
125
|
+
);
|
|
126
|
+
if (read.kind !== "response") return { status: "unavailable", reason: read.reason };
|
|
127
|
+
if (read.response.status === 401 || read.response.status === 403) return { status: "unavailable", reason: "unauthorized" };
|
|
128
|
+
if (!read.response.ok) return { status: "unavailable", reason: `http ${read.response.status}` };
|
|
129
|
+
let payload: unknown;
|
|
130
|
+
try { payload = await read.response.json(); } catch { return { status: "unavailable", reason: "malformed" }; }
|
|
131
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return { status: "unavailable", reason: "malformed" };
|
|
132
|
+
const row = payload as Record<string, unknown>;
|
|
133
|
+
if (row.admissionStatus !== "ready" && row.admissionStatus !== "blocked") return { status: "unavailable", reason: "malformed" };
|
|
134
|
+
if (row.admissionStatus === "ready") return { status: "ready" };
|
|
135
|
+
if (!isNativeMainAdmissionBlockReason(row.admissionBlockReason)) return { status: "unavailable", reason: "malformed" };
|
|
136
|
+
return { status: "blocked", reason: row.admissionBlockReason };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function formatNativeMainAdmissionLines(report: NativeMainAdmissionReport): string[] {
|
|
140
|
+
if (report.status === "blocked") {
|
|
141
|
+
const homeGuidance = report.reason === "foreign-ownership"
|
|
142
|
+
? "Repair the service definition and restart the proxy so it uses the recorded CODEX_HOME."
|
|
143
|
+
: report.reason === "ownership-unknown"
|
|
144
|
+
? "Resolve native Codex ownership evidence, then restart the proxy."
|
|
145
|
+
: report.reason === "owner-conflict" || report.reason === "owner-unavailable"
|
|
146
|
+
? "Ensure exactly one OpenCodex proxy owns CODEX_HOME, then restart the proxy."
|
|
147
|
+
: report.reason === "recovery-pending" || report.reason === "manual-recovery"
|
|
148
|
+
? "Run `ocx account main recover` and inspect native-profile doctor before retrying."
|
|
149
|
+
: "Inspect native-profile doctor and clean up the pending staging state before retrying.";
|
|
150
|
+
return [
|
|
151
|
+
` !! native-main admission is fenced (reason: ${report.reason})`,
|
|
152
|
+
` Native model requests return 503 until this clears. ${homeGuidance}`,
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
if (report.status === "unavailable") {
|
|
156
|
+
return [" -- native-main admission unavailable from the running proxy"];
|
|
157
|
+
}
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
|
|
83
161
|
export { resolveCodexHomeDir } from "../codex/home";
|
|
84
162
|
|
|
85
163
|
/**
|
|
@@ -1142,7 +1220,7 @@ export interface DefaultModelExposureDeps {
|
|
|
1142
1220
|
* data-plane admission on a non-loopback bind (`isApiAuthRequired`), and doctor deliberately
|
|
1143
1221
|
* holds no data-plane key, so a remote-bound proxy always falls through to the catalog.
|
|
1144
1222
|
*/
|
|
1145
|
-
async function fetchExposedModelIds(live: LiveProxy, fetchFn: ExposedModelsFetch): Promise<Set<string> | null> {
|
|
1223
|
+
async function fetchExposedModelIds(live: LiveProxy, fetchFn: ExposedModelsFetch): Promise<Set<string> | null | "timeout"> {
|
|
1146
1224
|
try {
|
|
1147
1225
|
// directLocalHttpFetch never follows redirects and aborts past its byte cap, so the
|
|
1148
1226
|
// unbounded-body and redirect cases are covered below the JSON parse, not by options here.
|
|
@@ -1167,8 +1245,10 @@ async function fetchExposedModelIds(live: LiveProxy, fetchFn: ExposedModelsFetch
|
|
|
1167
1245
|
}
|
|
1168
1246
|
}
|
|
1169
1247
|
return ids;
|
|
1170
|
-
} catch {
|
|
1171
|
-
|
|
1248
|
+
} catch (error) {
|
|
1249
|
+
// Past the deadline the proxy is usually still gathering, for example a provider CLI that is
|
|
1250
|
+
// still listing models (#8115); the caller says so instead of implying a failed check.
|
|
1251
|
+
return error instanceof Error && error.name === "TimeoutError" ? "timeout" : null;
|
|
1172
1252
|
}
|
|
1173
1253
|
}
|
|
1174
1254
|
|
|
@@ -1220,14 +1300,18 @@ export async function collectDefaultModelExposure(
|
|
|
1220
1300
|
}
|
|
1221
1301
|
|
|
1222
1302
|
const live = deps.live ?? null;
|
|
1223
|
-
const
|
|
1303
|
+
const proxyRead = live ? await fetchExposedModelIds(live, deps.fetchFn ?? directLocalHttpFetch) : null;
|
|
1304
|
+
const proxyIds = proxyRead === "timeout" ? null : proxyRead;
|
|
1305
|
+
const stillGathering = proxyRead === "timeout"
|
|
1306
|
+
? ` (the running proxy was still gathering its model list after ${EXPOSED_MODELS_TIMEOUT_MS / 1000} s; a provider may still be discovering models)`
|
|
1307
|
+
: "";
|
|
1224
1308
|
const catalogIds = catalogExposedModelIds((deps.readCatalogModelsFn ?? defaultCatalogModels)());
|
|
1225
1309
|
if (proxyIds === null && catalogIds === null) {
|
|
1226
1310
|
return {
|
|
1227
1311
|
status: "undeterminable",
|
|
1228
1312
|
model,
|
|
1229
1313
|
source: null,
|
|
1230
|
-
detail: `could not read the exposed model set, so Codex \`model = "${model}"\` was not checked`,
|
|
1314
|
+
detail: `could not read the exposed model set, so Codex \`model = "${model}"\` was not checked${stillGathering}`,
|
|
1231
1315
|
action: "Start the proxy with 'ocx start', or run 'ocx sync' to write the Codex catalog, then re-run 'ocx doctor'",
|
|
1232
1316
|
};
|
|
1233
1317
|
}
|
|
@@ -1243,7 +1327,7 @@ export async function collectDefaultModelExposure(
|
|
|
1243
1327
|
status: "exposed",
|
|
1244
1328
|
model,
|
|
1245
1329
|
source: matched,
|
|
1246
|
-
detail: `Codex \`model = "${model}"\` is exposed by this install`,
|
|
1330
|
+
detail: `Codex \`model = "${model}"\` is exposed by this install${matched === "catalog" ? stillGathering : ""}`,
|
|
1247
1331
|
};
|
|
1248
1332
|
}
|
|
1249
1333
|
// Name only the surfaces that actually answered: claiming a check that did not happen is the
|
|
@@ -1256,7 +1340,7 @@ export async function collectDefaultModelExposure(
|
|
|
1256
1340
|
status: "not_exposed",
|
|
1257
1341
|
model,
|
|
1258
1342
|
source,
|
|
1259
|
-
detail: `Codex \`model = "${model}"\` is NOT exposed by this install (checked ${checked}), so every new Codex session starts on a model this proxy does not serve`,
|
|
1343
|
+
detail: `Codex \`model = "${model}"\` is NOT exposed by this install (checked ${checked})${stillGathering}, so every new Codex session starts on a model this proxy does not serve`,
|
|
1260
1344
|
action: "Expose that model (enable it in the dashboard or drop it from 'disabledModels') and run 'ocx sync', or pin an exposed id as 'model' in CODEX_HOME/config.toml",
|
|
1261
1345
|
};
|
|
1262
1346
|
}
|
|
@@ -1441,6 +1525,10 @@ export async function runDoctor(args: string[] = []): Promise<void> {
|
|
|
1441
1525
|
const resolution = await resolveNativeMainRefreshMode(loadConfig());
|
|
1442
1526
|
for (const line of formatNativeMainRefreshDoctorLines(resolution)) console.log(line);
|
|
1443
1527
|
}
|
|
1528
|
+
const admission = live
|
|
1529
|
+
? await fetchNativeMainAdmission(live)
|
|
1530
|
+
: { status: "unavailable" as const, reason: "proxy-not-found" };
|
|
1531
|
+
for (const line of formatNativeMainAdmissionLines(admission)) console.log(line);
|
|
1444
1532
|
|
|
1445
1533
|
// Mirrors `ocx status` through the same comparison rather than a second implementation:
|
|
1446
1534
|
// two diagnostics disagreeing about whether an install is stale is worse than one (#2701).
|
package/src/cli/help.ts
CHANGED
|
@@ -49,7 +49,7 @@ Usage:
|
|
|
49
49
|
ocx connect <url> Connect this machine to a remote OpenCodex hub (credential via stdin)
|
|
50
50
|
ocx remote-workspace <sub> Pair/run an OCX-only remote execution computer
|
|
51
51
|
ocx disconnect Restore local state and clear the hub connection
|
|
52
|
-
ocx sync [--restart-codex]
|
|
52
|
+
ocx sync [--local-only] [--json] [--restart-codex] Sync models and linked Children
|
|
53
53
|
--expect-link <id> | --expect-hub-key <id>: only from that Home/hub key (exit 5 otherwise)
|
|
54
54
|
ocx sync-cache [--restart-codex]
|
|
55
55
|
Refresh Codex's model cache from the active catalog
|
|
@@ -72,7 +72,7 @@ Usage:
|
|
|
72
72
|
ocx restart Stop and restart the proxy
|
|
73
73
|
ocx v2 <sub> multi_agent_v2 surface (status|on|off|mode|keep-native-v1|threads|mode-hint)
|
|
74
74
|
ocx health [--json] Check proxy health (exit 0=healthy, 1=not)
|
|
75
|
-
ocx capabilities [--json]
|
|
75
|
+
ocx capabilities [--json] [--contracts] List capabilities and contracts
|
|
76
76
|
ocx ready [--json] [--wait [--timeout <s>]] Check post-sync readiness (exit 0 only when ready)
|
|
77
77
|
ocx resolve [--json] Config home, effective port, and liveness (JSON for shells)
|
|
78
78
|
ocx provider <sub> Providers, connectivity, quota, and selected models
|