@openclaw/codex 2026.9.4 → 2026.9.6

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 (160) hide show
  1. package/assets/activity.svg +30 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/account-usage-runtime-Eem_WGqY.mjs +75 -0
  4. package/dist/{apply-CvT8tW5i.js → .setup/apply-DDOi8uNx.mjs} +24 -30
  5. package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
  6. package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-CEv1cKwF.mjs} +79 -49
  7. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
  8. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
  9. package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
  10. package/dist/{auth-cache-key-7orQae_j.js → .setup/auth-cache-key-B2mpaI9D.mjs} +9 -81
  11. package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
  12. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  13. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  14. package/dist/.setup/binding-connection-ThoatDcb.mjs +50 -0
  15. package/dist/.setup/binding-connection.runtime-yoHrABt-.mjs +48 -0
  16. package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-B2HScEgT.mjs} +143 -32
  17. package/dist/{build-state-BCmg9-5p.js → .setup/build-state-C7EnDVgr.mjs} +1 -1
  18. package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-CDXOOFdZ.mjs} +1 -1
  19. package/dist/{client-B57KWPQx.js → .setup/client-Cs08OXVQ.mjs} +705 -512
  20. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  21. package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-B4JuOsOk.mjs} +8 -4
  22. package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-Bmqvr9tO.mjs} +8 -4
  23. package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-DW7Lx9oH.mjs} +137 -186
  24. package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DixIj3HW.mjs} +47 -23
  25. package/dist/{compact-B_H3AOd7.js → .setup/compact-Du5UvtxA.mjs} +29 -51
  26. package/dist/{config-oIORaQ5T.js → .setup/config-BoTP_mrL.mjs} +5 -4
  27. package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BvaRs51b.mjs} +50 -446
  28. package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
  29. package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-C8Rw1m1m.mjs} +2 -2
  30. package/dist/.setup/config-security-BEReZ6go.mjs +380 -0
  31. package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DP-gMrBP.mjs} +29 -38
  32. package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
  33. package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-uK9Jomlc.mjs} +32 -67
  34. package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
  35. package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
  36. package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-BDXl-8Cw.mjs} +936 -620
  37. package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  38. package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-poidXgek.mjs} +9 -7
  39. package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-BsruvNrH.mjs} +8 -7
  40. package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-C6L_5ZiT.mjs} +42 -8
  41. package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-CnBS8Wa3.mjs} +102 -9
  42. package/dist/{harness-C7rRa7bm.js → .setup/harness-a_MsE4-_.mjs} +81 -21
  43. package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-D96l9-ew.mjs} +1 -1
  44. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  45. package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-BIZFhTNG.mjs} +18 -11
  46. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  47. package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-BnshlFag.mjs} +14 -3
  48. package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
  49. package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-CfXJf9Ay.mjs} +36 -12
  50. package/dist/{models-PCKOim-h.js → .setup/models-KnqBv0hE.mjs} +3 -3
  51. package/dist/.setup/native-auth-rWbGbMn3.mjs +57 -0
  52. package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-0nYYgo0k.mjs} +43 -35
  53. package/dist/.setup/native-subagent-monitor-D3filLY2.mjs +4859 -0
  54. package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-wb8CKZGN.mjs} +98 -44
  55. package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-r3avj02l.mjs} +86 -68
  56. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  57. package/dist/{plan-7uG-Fp36.js → .setup/plan-CN3VwfNU.mjs} +133 -119
  58. package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-DT3MNtqj.mjs} +7 -16
  59. package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-B2CsSdnV.mjs} +32 -44
  60. package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  61. package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-BoRei8Z4.mjs} +21 -11
  62. package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  63. package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-Ctmo83k_.mjs} +226 -141
  64. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  65. package/dist/{provider-MQ8PVkuE.js → .setup/provider-BOsxQHOM.mjs} +9 -5
  66. package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-BfE88FZ5.mjs} +31 -3
  67. package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-CMU3DUD0.mjs} +174 -151
  68. package/dist/{request-B7hEkBGq.js → .setup/request-D2L0zMrq.mjs} +130 -42
  69. package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-BHu11r7h.mjs} +1628 -966
  70. package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
  71. package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-CLZ8udh-.mjs} +29 -45
  72. package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-C2sRMOEY.mjs} +3 -3
  73. package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-Cm0apEbd.mjs} +36 -83
  74. package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-BGoz8wOK.mjs} +202 -5
  75. package/dist/.setup/session-binding-sidecars-BlB5EvIS.mjs +546 -0
  76. package/dist/.setup/session-catalog-Pno1xGcl.mjs +2764 -0
  77. package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-BI6UTDZT.mjs} +58 -26
  78. package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-lHBqzhaO.mjs} +6 -6
  79. package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +347 -0
  80. package/dist/.setup/session-catalog-index-B9_VQIUz.mjs +1170 -0
  81. package/dist/.setup/session-catalog-index-order-hcdz07yN.mjs +48 -0
  82. package/dist/.setup/session-catalog-index-state-Dgh8ORJm.mjs +183 -0
  83. package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-DowriLid.mjs} +223 -95
  84. package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-ITddWx_X.mjs} +25 -13
  85. package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-6g6qi4A9.mjs} +24 -15
  86. package/dist/.setup/session-catalog-projection-zK_PUsiE.mjs +422 -0
  87. package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-irrD-uo7.mjs} +3 -3
  88. package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-BrqhSCf9.mjs} +19 -19
  89. package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-D-3wAgOP.mjs} +4 -4
  90. package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
  91. package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CaCh0xF_.mjs} +10 -24
  92. package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-rcgbZiid.mjs} +2 -2
  93. package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-BI1QK_98.mjs} +2 -2
  94. package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-BH-S6qkJ.mjs} +26 -7
  95. package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
  96. package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-DiAi6Kx6.mjs} +12 -12
  97. package/dist/{shared-client-CscigXXL.js → .setup/shared-client-DA4VR4Eb.mjs} +332 -221
  98. package/dist/{side-question-BGMJQf4U.js → .setup/side-question-BJ1wSDcB.mjs} +183 -230
  99. package/dist/{source-CElXU0Oy.js → .setup/source-CUzJq5WN.mjs} +11 -10
  100. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  101. package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-C9frICzX.mjs} +10 -3
  102. package/dist/.setup/thread-history-page-DoVpnHim.mjs +83 -0
  103. package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-B3mfz1TG.mjs} +347 -2318
  104. package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-DcTtAcXj.mjs} +6 -4
  105. package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-DGuQsuFC.mjs} +19 -3
  106. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  107. package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-DIBXwOpE.mjs} +8 -5
  108. package/dist/.setup/timeout-C910MdAB.mjs +80 -0
  109. package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-ZZpkFkJ_.mjs} +96 -61
  110. package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-BtHDBp1G.mjs} +224 -195
  111. package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
  112. package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-h2VHOskC.mjs} +274 -89
  113. package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-BUr4OUbC.mjs} +51 -42
  114. package/dist/{usage-tCk-mg_x.js → .setup/usage-BML0r-ua.mjs} +5 -4
  115. package/dist/.setup/usage-limit-error-DUMbefVY.mjs +166 -0
  116. package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  117. package/dist/api.js +23 -12
  118. package/dist/catalog-page-worker-entrypoint.js +12 -0
  119. package/dist/catalog-page.worker.js +9 -0
  120. package/dist/cli-metadata.js +1 -1
  121. package/dist/doctor-contract-api.js +8 -528
  122. package/dist/harness.js +1 -1
  123. package/dist/index.js +306 -215
  124. package/dist/media-understanding-provider.js +3 -3
  125. package/dist/migration-provider-api.js +1 -1
  126. package/dist/native-tool-policy.js +12 -0
  127. package/dist/provider-discovery.js +18 -0
  128. package/dist/session-history-worker-runtime.js +36 -35
  129. package/dist/session-history.worker.js +2 -2
  130. package/dist/web-search-contract-api.js +1 -1
  131. package/openclaw.plugin.json +354 -69
  132. package/package.json +14 -8
  133. package/dist/attempt-context-D44yeDII.js +0 -636
  134. package/dist/binding-connection-D3udKbIE.js +0 -60
  135. package/dist/event-projector-usage-BfXmpOec.js +0 -102
  136. package/dist/inference-proxy-HGXKUIre.js +0 -311
  137. package/dist/launch-args-RXQwn8zV.js +0 -90
  138. package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
  139. package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
  140. package/dist/node-exec-server.runtime-Cl2vapEi.js +0 -226
  141. package/dist/rpc-error-ttN_QjEm.js +0 -30
  142. package/dist/session-catalog-ct-AH01I.js +0 -1477
  143. package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
  144. package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
  145. package/dist/timeout-BVw8aaM1.js +0 -33
  146. package/dist/version-omm6IPI3.js +0 -12
  147. /package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
  148. /package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
  149. /package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
  150. /package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
  151. /package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
  152. /package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
  153. /package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
  154. /package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
  155. /package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-umd0tgh4.mjs} +0 -0
  156. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  157. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  158. /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
  159. /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
  160. /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
@@ -1,102 +1,91 @@
1
- import { n as isCodexFastServiceTier } from "./config-utils-DujwEnhg.js";
2
- import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary } from "./plugin-inventory-oL4Na1ZG.js";
3
- import { l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, r as bindingStoreKey } from "./session-binding-record-Bcvslnhf.js";
4
- import { o as isJsonObject } from "./protocol-5bh1G-H7.js";
5
- import { _ as assertCodexThreadAcceptsDirectInput, s as isCodexAppServerIndeterminateRequestCancellationError, u as isCodexAppServerPrewriteRequestCancellationError, y as assertCodexThreadResumeResponse } from "./client-B57KWPQx.js";
6
- import { c as resolveCodexAppServerPreparedApiKeyCacheKey, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-7orQae_j.js";
7
- import { r as withCodexConversationThreadActivity, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
8
- import { a as CODEX_HOST_INSPECTION_AUTH_ERROR, c as hasCodexAdminScope, i as CODEX_FULL_PERMISSIONS_AUTH_ERROR, n as filterCodexMarketplacePlugins, o as CODEX_NATIVE_EXECUTION_AUTH_ERROR, r as parseCodexPluginMarketplaceId, s as canMutateCodexHost, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-P-Vndfqq.js";
9
- import { s as summarizeCodexAccountUsage } from "./rate-limits-CBMmWBr9.js";
10
- import { a as formatCodexAccountLine, c as formatCodexTextForDisplay, d as formatModels, f as formatSkills, i as formatAccount, l as formatComputerUseStatus, n as buildHelp, o as formatCodexDisplayText, p as formatThreads, r as escapeCodexChatText, s as formatCodexStatus, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatList } from "./command-formatters-lxlkNZgU.js";
11
- import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-BiodpIzq.js";
12
- import { t as CodexAppServerRpcError } from "./rpc-error-ttN_QjEm.js";
13
- import { t as CODEX_CONTROL_METHODS } from "./capabilities-8vx68WLH.js";
14
- import { i as formatCodexCliSessions } from "./node-cli-sessions-DKaOmVUh.js";
15
- import { r as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-d0eKxy7b.js";
16
- import { o as withCodexAppServerJsonClient } from "./request-B7hEkBGq.js";
17
- import "./config-oIORaQ5T.js";
18
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-D0zGNIHu.js";
19
- import { n as fingerprintCodexAppServerAuthBinding } from "./auth-binding-CWlKVccJ.js";
20
- import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-D3udKbIE.js";
21
- import { a as resolveCodexAppServerAuthProfileStore, i as resolveCodexAppServerAuthProfileIdForAgent, n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CwzO4_RG.js";
22
- import { R as consumeCodexAppServerLiveThread, V as hasCodexAppServerLiveThread, c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CscigXXL.js";
23
- import { a as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-DKHzbwt5.js";
24
- import { t as listAllCodexAppServerModels } from "./models-PCKOim-h.js";
25
- import { n as refreshCodexAppRuntimeState, r as refreshCodexPluginRuntimeState } from "./plugin-activation-BYQculil.js";
26
- import { n as createCodexSessionGenerationSupersededError, o as resolveCodexSessionBinding } from "./session-binding-CI8UuilT.js";
27
- import { r as assertCodexSupervisionThreadLineage } from "./thread-policy-BuEQfE0g.js";
28
- import { a as rollbackCodexAppServerBindingSubscription, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-BsDRTsyp.js";
29
- import { n as resolveCodexNativeSandboxBlock, t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BxgyoM8M.js";
30
- import { i as readCodexComputerUseStatus, r as installCodexComputerUse, t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-ClPJpRio.js";
31
- import { a as requestOptions, i as readCodexStatusProbes, o as safeCodexControlRequest, r as prepareCodexControlSessionAuth, t as codexControlRequest } from "./command-rpc-CR5EOEZX.js";
32
- import { a as setCodexConversationFastMode, c as steerCodexConversationTurn, i as readCodexConversationActiveTurn, l as stopCodexConversationTurn, n as parseCodexFastModeArg, o as setCodexConversationModel, r as parseCodexPermissionsModeArg, s as setCodexConversationPermissions, t as formatPermissionsMode } from "./conversation-control-CtUu1b3m.js";
1
+ import { n as isCodexFastServiceTier } from "./config-utils-DujwEnhg.mjs";
2
+ import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary } from "./plugin-inventory-BoRei8Z4.mjs";
3
+ import { m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, r as bindingStoreKey } from "./session-binding-record-BGoz8wOK.mjs";
4
+ import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
5
+ import { c as resolveCodexAppServerPreparedApiKeyCacheKey, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-B2mpaI9D.mjs";
6
+ import { r as withCodexConversationThreadActivity, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.mjs";
7
+ import { a as CODEX_HOST_INSPECTION_AUTH_ERROR, c as canMutateCodexHost, i as CODEX_FULL_PERMISSIONS_AUTH_ERROR, l as hasCodexAdminScope, n as filterCodexMarketplacePlugins, o as CODEX_NATIVE_EXECUTION_AUTH_ERROR, r as parseCodexPluginMarketplaceId, s as assertCodexHostOwnerCurrent, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-CDOi8IFs.mjs";
8
+ import { s as summarizeCodexAccountUsage } from "./rate-limits-CMU3DUD0.mjs";
9
+ import { a as formatCodexAccountLine, c as formatCodexTextForDisplay, d as formatModels, f as formatSkills, i as formatAccount, l as formatComputerUseStatus, n as buildHelp, o as formatCodexDisplayText, p as formatThreads, r as escapeCodexChatText, s as formatCodexStatus, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatList } from "./command-formatters-Bmqvr9tO.mjs";
10
+ import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-CrcyZk6O.mjs";
11
+ import { o as CodexAppServerRpcError } from "./timeout-C910MdAB.mjs";
12
+ import { t as CODEX_CONTROL_METHODS } from "./capabilities-CDXOOFdZ.mjs";
13
+ import { o as formatCodexCliSessions } from "./node-cli-sessions-r3avj02l.mjs";
14
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-B2CsSdnV.mjs";
15
+ import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-ThoatDcb.mjs";
16
+ import { o as withCodexAppServerJsonClient } from "./request-D2L0zMrq.mjs";
17
+ import "./config-BoTP_mrL.mjs";
18
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
19
+ import { a as resolveCodexAppServerAuthProfileStore, i as resolveCodexAppServerAuthProfileIdForAgent, n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-WqZtZfXN.mjs";
20
+ import { I as hasCodexAppServerLiveThread, N as consumeCodexAppServerLiveThread, X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-DA4VR4Eb.mjs";
21
+ import { b as assertCodexThreadResumeResponse, s as isCodexAppServerIndeterminateRequestCancellationError, u as isCodexAppServerPrewriteRequestCancellationError, v as assertCodexThreadAcceptsDirectInput } from "./client-Cs08OXVQ.mjs";
22
+ import { o as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-CEv1cKwF.mjs";
23
+ import { n as fingerprintCodexAppServerAuthBinding } from "./auth-binding-DhLWa_7K.mjs";
24
+ import { t as listAllCodexAppServerModels } from "./models-KnqBv0hE.mjs";
25
+ import { n as refreshCodexAppRuntimeState, r as refreshCodexPluginRuntimeState } from "./plugin-activation-DT3MNtqj.mjs";
26
+ import { n as createCodexSessionGenerationSupersededError, o as resolveCodexSessionBinding } from "./session-binding-Cm0apEbd.mjs";
27
+ import { i as assertCodexSupervisionThreadLineage } from "./thread-policy-DGuQsuFC.mjs";
28
+ import { a as rollbackCodexAppServerBindingSubscription, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DcTtAcXj.mjs";
29
+ import { n as resolveCodexNativeSandboxBlock, t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-C2sRMOEY.mjs";
30
+ import { i as readCodexComputerUseStatus, r as installCodexComputerUse, t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-Ctmo83k_.mjs";
31
+ import { a as requestOptions, i as readCodexStatusProbes, o as safeCodexControlRequest, r as prepareCodexControlSessionAuth, t as codexControlRequest } from "./command-rpc-DixIj3HW.mjs";
32
+ import { a as setCodexConversationFastMode, c as steerCodexConversationTurn, i as readCodexConversationActiveTurn, l as stopCodexConversationTurn, n as parseCodexFastModeArg, o as setCodexConversationModel, r as parseCodexPermissionsModeArg, s as setCodexConversationPermissions, t as formatPermissionsMode } from "./conversation-control-uK9Jomlc.mjs";
33
33
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
34
34
  import crypto from "node:crypto";
35
+ import { isDeepStrictEqual } from "node:util";
35
36
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
36
37
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
37
38
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
39
+ import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
38
40
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
39
41
  import { ensureAuthProfileStore, resolveAgentDir as resolveAgentDir$1, resolveAgentWorkspaceDir, resolveAuthProfileEligibility, resolveProfileUnusableUntilForDisplay } from "openclaw/plugin-sdk/agent-runtime";
40
- import { isDeepStrictEqual } from "node:util";
41
- import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
42
42
  import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
43
43
  import { findNormalizedProviderValue, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
44
44
  import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
45
45
  import { MODEL_SELECTION_LOCKED_MESSAGE, isModelSelectionLocked, resolvePersistedSessionRuntimeId } from "openclaw/plugin-sdk/model-session-runtime";
46
46
  //#region extensions/codex/src/command-account.ts
47
47
  const OPENAI_PROVIDER_ID = "openai";
48
- const OPENAI_CODEX_PROVIDER_ID = OPENAI_PROVIDER_ID;
49
48
  async function readCodexAccountAuthOverview(params) {
49
+ if (!params.account.ok && !params.limits.ok) return;
50
50
  const config = params.ctx.config;
51
51
  const agentDir = params.agentDir;
52
52
  const store = ensureAuthProfileStore(agentDir, {
53
53
  allowKeychainPrompt: false,
54
54
  config
55
55
  });
56
- const { order, explicit: explicitOrder } = resolveDisplayAuthOrder({
56
+ const order = resolveDisplayAuthOrder({
57
57
  config,
58
58
  store
59
59
  });
60
+ const activeProfileId = params.authProfileId ?? void 0;
61
+ if (activeProfileId && !order.includes(activeProfileId)) order.unshift(activeProfileId);
60
62
  if (order.length === 0) return;
61
63
  const now = Date.now();
62
- const activeProfileId = resolveActiveProfileId({
63
- store,
64
- order,
65
- explicitOrder,
66
- config,
67
- account: params.account,
68
- limits: params.limits,
69
- now
70
- });
71
64
  const activeIsSubscription = activeProfileId !== void 0 && isChatGptSubscriptionProfile(store.profiles[activeProfileId]);
72
- const subscriptionProfileId = activeIsSubscription ? activeProfileId : order.find((profileId) => isChatGptSubscriptionProfile(store.profiles[profileId]));
65
+ const subscriptionProfileId = activeIsSubscription ? activeProfileId : activeProfileId ? order.find((profileId) => isChatGptSubscriptionProfile(store.profiles[profileId])) : void 0;
73
66
  const activeUsage = activeIsSubscription && params.limits.ok ? summarizeCodexAccountUsage(params.limits.value, now) : void 0;
74
- const subscriptionUsage = subscriptionProfileId && (!activeIsSubscription || subscriptionProfileId !== activeProfileId) ? await readSubscriptionUsage({
67
+ const subscriptionUsage = subscriptionProfileId && !activeIsSubscription ? await readSubscriptionUsage({
75
68
  ...params,
76
69
  agentDir,
77
70
  config,
78
71
  subscriptionProfileId,
79
72
  now
80
73
  }) : activeUsage;
81
- if (!params.account.ok && !params.limits.ok && !subscriptionUsage) return;
82
- const rows = order.map((profileId, index) => buildProfileRow({
74
+ const rows = order.map((profileId) => buildProfileRow({
83
75
  store,
84
76
  config,
85
77
  profileId,
86
78
  activeProfileId,
87
- activeIndex: activeProfileId ? order.indexOf(activeProfileId) : -1,
88
- index,
89
79
  now,
90
80
  usage: profileId === subscriptionProfileId ? subscriptionUsage : void 0
91
81
  }));
92
82
  const activeRow = rows.find((row) => row.active);
93
83
  if (!activeRow) return {
94
- currentLine: "OpenAI credentials: no working credential",
95
84
  orderTitle: "Auth order",
96
85
  rows
97
86
  };
98
87
  const activeIsApiKey = store.profiles[activeRow.profileId]?.type === "api_key";
99
- const subscriptionLabel = subscriptionProfileId ? formatProfileLabel(subscriptionProfileId, store.profiles[subscriptionProfileId]) : activeIsSubscription ? activeRow.label : void 0;
88
+ const subscriptionLabel = subscriptionProfileId ? formatProfileLabel(subscriptionProfileId, store.profiles[subscriptionProfileId]) : void 0;
100
89
  const subscriptionUsageLine = formatSubscriptionUsageLine(subscriptionUsage);
101
90
  return {
102
91
  ...activeIsApiKey ? { currentLine: buildApiKeyActiveLine(activeRow, subscriptionUsage) } : {},
@@ -107,92 +96,13 @@ async function readCodexAccountAuthOverview(params) {
107
96
  };
108
97
  }
109
98
  function resolveDisplayAuthOrder(params) {
110
- const codexOrder = resolveOrder(params.store.order, OPENAI_CODEX_PROVIDER_ID) ?? resolveOrder(params.config?.auth?.order, OPENAI_CODEX_PROVIDER_ID);
111
- if (codexOrder && codexOrder.length > 0) return {
112
- order: normalizeUniqueStringEntries(codexOrder),
113
- explicit: true
114
- };
115
- return {
116
- order: resolveAuthProfileOrder({
117
- cfg: params.config,
118
- store: params.store,
119
- provider: OPENAI_CODEX_PROVIDER_ID
120
- }),
121
- explicit: hasExplicitOpenAiAuthOrder(params)
122
- };
123
- }
124
- function hasExplicitOpenAiAuthOrder(params) {
125
- const sources = [params.store.order, params.config?.auth?.order];
126
- for (const source of sources) {
127
- const codex = resolveOrder(source, OPENAI_CODEX_PROVIDER_ID);
128
- if (codex && codex.length > 0) return true;
129
- const openai = resolveOrder(source, OPENAI_PROVIDER_ID);
130
- if (openai && openai.length > 0) return true;
131
- }
132
- return false;
133
- }
134
- function resolveOrder(order, provider) {
135
- return findNormalizedProviderValue(order, provider);
136
- }
137
- function resolveActiveProfileId(params) {
138
- const liveProfileId = resolveLiveAccountProfileId({
139
- account: params.account,
140
- store: params.store,
141
- order: params.order
142
- });
143
- if (liveProfileId) return liveProfileId;
144
- if (params.explicitOrder) return params.order.find((profileId) => isActiveProfileCandidate(params, profileId) && resolveAuthProfileEligibility({
145
- cfg: params.config,
146
- store: params.store,
147
- provider: OPENAI_CODEX_PROVIDER_ID,
148
- profileId,
149
- now: params.now
150
- }).eligible);
151
- const lastGood = [params.store.lastGood?.[OPENAI_PROVIDER_ID], params.store.lastGood?.[OPENAI_CODEX_PROVIDER_ID]].find((profileId) => typeof profileId === "string" && params.order.includes(profileId) && isActiveProfileCandidate(params, profileId));
152
- if (lastGood) return lastGood;
153
- const mostRecent = params.order.map((profileId) => ({
154
- profileId,
155
- lastUsed: params.store.usageStats?.[profileId]?.lastUsed ?? 0
156
- })).filter((entry) => entry.lastUsed > 0 && isActiveProfileCandidate(params, entry.profileId)).toSorted((left, right) => right.lastUsed - left.lastUsed)[0]?.profileId;
157
- if (mostRecent) return mostRecent;
158
- if (shouldInferApiKeyActiveFromRateLimitProbe(params.limits)) {
159
- const apiKeyProfile = params.order.find((profileId) => params.store.profiles[profileId]?.type === "api_key");
160
- if (apiKeyProfile) return apiKeyProfile;
161
- }
99
+ const explicitOrder = findNormalizedProviderValue(params.store.order, OPENAI_PROVIDER_ID) ?? findNormalizedProviderValue(params.config?.auth?.order, OPENAI_PROVIDER_ID);
100
+ if (explicitOrder && explicitOrder.length > 0) return normalizeUniqueStringEntries(explicitOrder);
162
101
  return resolveAuthProfileOrder({
163
102
  cfg: params.config,
164
103
  store: params.store,
165
- provider: OPENAI_CODEX_PROVIDER_ID
166
- })[0];
167
- }
168
- function isActiveProfileCandidate(params, profileId) {
169
- return !isActiveUntil(resolveProfileUnusableUntilForDisplay(params.store, profileId) ?? void 0, params.now);
170
- }
171
- function resolveLiveAccountProfileId(params) {
172
- if (!params.account.ok || !isJsonObject(params.account.value)) return;
173
- const account = isJsonObject(params.account.value.account) ? params.account.value.account : params.account.value;
174
- const type = normalizeOptionalString(account.type)?.toLowerCase();
175
- if (type === "chatgpt") {
176
- const email = normalizeOptionalString(account.email)?.toLowerCase();
177
- const accountId = normalizeOptionalString(account.accountId ?? account.chatgptAccountId);
178
- const subscriptionProfiles = params.order.filter((profileId) => isChatGptSubscriptionProfile(params.store.profiles[profileId]));
179
- if (accountId) {
180
- const exactWorkspace = subscriptionProfiles.find((profileId) => {
181
- const credential = params.store.profiles[profileId];
182
- return credential && "accountId" in credential && credential.accountId === accountId;
183
- });
184
- if (exactWorkspace) return exactWorkspace;
185
- }
186
- const matchingProfiles = email ? subscriptionProfiles.filter((profileId) => {
187
- return (params.store.profiles[profileId]?.email?.trim().toLowerCase() ?? extractEmailFromProfileId(profileId))?.toLowerCase() === email;
188
- }) : subscriptionProfiles;
189
- const lastGood = params.store.lastGood?.[OPENAI_PROVIDER_ID];
190
- return (lastGood && matchingProfiles.includes(lastGood) ? lastGood : void 0) ?? matchingProfiles[0] ?? subscriptionProfiles[0];
191
- }
192
- if (type === "apikey" || type === "api_key") return params.order.find((profileId) => params.store.profiles[profileId]?.type === "api_key");
193
- }
194
- function shouldInferApiKeyActiveFromRateLimitProbe(limits) {
195
- return !limits.ok && limits.error.toLowerCase().includes("chatgpt authentication required");
104
+ provider: OPENAI_PROVIDER_ID
105
+ });
196
106
  }
197
107
  async function readSubscriptionUsage(params) {
198
108
  const limits = await params.safeCodexControlRequest(params.pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
@@ -209,13 +119,12 @@ function buildProfileRow(params) {
209
119
  const label = formatProfileLabel(params.profileId, credential);
210
120
  const kind = formatProfileKind(credential);
211
121
  const active = params.profileId === params.activeProfileId;
212
- const status = active ? "active now" : params.usage?.blocked ? formatUsageBlockedStatus(params.usage) : describeInactiveProfileStatus({
122
+ const status = active ? "active now" : params.usage?.blocked ? "rate-limited" : describeInactiveProfileStatus({
213
123
  store: params.store,
214
124
  config: params.config,
215
125
  profileId: params.profileId,
216
126
  credential,
217
- now: params.now,
218
- afterActive: params.activeIndex >= 0 && params.index > params.activeIndex
127
+ now: params.now
219
128
  });
220
129
  return {
221
130
  profileId: params.profileId,
@@ -223,13 +132,9 @@ function buildProfileRow(params) {
223
132
  kind,
224
133
  status,
225
134
  active,
226
- ...credential?.type === "api_key" && active ? { billingNote: "billed per token" } : {},
227
- ...params.usage?.usageLine ? { usage: params.usage.usageLine } : {}
135
+ ...credential?.type === "api_key" && active ? { billingNote: "billed per token" } : {}
228
136
  };
229
137
  }
230
- function formatUsageBlockedStatus(usage) {
231
- return usage.blocked ? "rate-limited" : "available if needed";
232
- }
233
138
  function describeInactiveProfileStatus(params) {
234
139
  const stats = params.store.usageStats?.[params.profileId];
235
140
  const blockedUntil = stats?.blockedUntil;
@@ -238,7 +143,7 @@ function describeInactiveProfileStatus(params) {
238
143
  const eligibility = resolveAuthProfileEligibility({
239
144
  cfg: params.config,
240
145
  store: params.store,
241
- provider: OPENAI_CODEX_PROVIDER_ID,
146
+ provider: OPENAI_PROVIDER_ID,
242
147
  profileId: params.profileId,
243
148
  now: params.now
244
149
  });
@@ -1573,7 +1478,15 @@ async function resolvePreparedCodexCommandAuthority(deps, ctx) {
1573
1478
  sessionKey,
1574
1479
  storePath,
1575
1480
  assertHostCurrent,
1576
- assertCurrent
1481
+ assertCurrent,
1482
+ assertMutationCurrent: () => {
1483
+ assertCodexHostOwnerCurrent(ctx);
1484
+ assertCurrent();
1485
+ },
1486
+ assertHostMutationCurrent: () => {
1487
+ assertCodexHostOwnerCurrent(ctx);
1488
+ assertHostCurrent();
1489
+ }
1577
1490
  };
1578
1491
  }
1579
1492
  async function resolveCommandAppServerContext(deps, ctx, pluginConfig) {
@@ -1586,10 +1499,13 @@ async function resolveCommandAppServerContext(deps, ctx, pluginConfig) {
1586
1499
  agentDir,
1587
1500
  config: ctx.config
1588
1501
  });
1589
- const connection = resolveCodexBindingAppServerConnection({
1502
+ const connection = await resolveCodexBindingAppServerConnection({
1590
1503
  binding,
1591
1504
  authProfileId,
1592
- pluginConfig
1505
+ pluginConfig,
1506
+ agentDir,
1507
+ config: ctx.config,
1508
+ assertCurrent: authority.assertCurrent
1593
1509
  });
1594
1510
  return {
1595
1511
  scope: {
@@ -1628,7 +1544,8 @@ function resolveCodexConversationControlScope(ctx) {
1628
1544
  }
1629
1545
  //#endregion
1630
1546
  //#region extensions/codex/src/command-diagnostics.ts
1631
- async function handleCodexDiagnosticsFeedback(deps, ctx, pluginConfig, args, commandPrefix) {
1547
+ async function handleCodexDiagnosticsFeedback(deps, context, pluginConfig, args, commandPrefix) {
1548
+ const ctx = { ...context };
1632
1549
  if (ctx.senderIsOwner !== true) return { text: "Only an owner can send Codex diagnostics." };
1633
1550
  const parsed = parseDiagnosticsArgs(args);
1634
1551
  if (parsed.action === "usage") return { text: formatDiagnosticsUsage(commandPrefix) };
@@ -1754,12 +1671,20 @@ async function sendCodexDiagnosticsFeedbackForTargets(deps, ctx, pluginConfig, n
1754
1671
  const sent = [];
1755
1672
  const failed = [];
1756
1673
  for (const target of targets) {
1674
+ const assertCurrent = () => {
1675
+ ctx.assertOwnerCurrent?.();
1676
+ const current = resolvePendingCodexDiagnosticsTargets(deps, [target], ctx.config);
1677
+ if (!codexDiagnosticsTargetsMatch([target], current)) throw new Error("The Codex diagnostics session changed before upload; request it again.");
1678
+ };
1757
1679
  let connection;
1758
1680
  try {
1759
- connection = resolveCodexBindingAppServerConnection({
1681
+ connection = await resolveCodexBindingAppServerConnection({
1760
1682
  binding: target,
1761
1683
  authProfileId: target.authProfileId,
1762
- pluginConfig
1684
+ pluginConfig,
1685
+ agentDir: target.agentDir,
1686
+ config: ctx.config,
1687
+ assertCurrent
1763
1688
  });
1764
1689
  } catch (error) {
1765
1690
  failed.push({
@@ -1777,6 +1702,7 @@ async function sendCodexDiagnosticsFeedbackForTargets(deps, ctx, pluginConfig, n
1777
1702
  }, {
1778
1703
  config: ctx.config,
1779
1704
  agentDir: target.agentDir,
1705
+ assertCurrent,
1780
1706
  ...connection.clientAuthProfileId !== void 0 ? { authProfileId: connection.clientAuthProfileId } : {},
1781
1707
  ...connection.usesSupervisionConnection ? { startOptions: connection.appServer.start } : {},
1782
1708
  ...target.sessionId ? { sessionId: target.sessionId } : {},
@@ -1944,6 +1870,7 @@ async function bindConversation(deps, ctx, pluginConfig, args) {
1944
1870
  }
1945
1871
  });
1946
1872
  const threadLabel = parsed.threadId ?? "a new thread";
1873
+ assertCodexHostOwnerCurrent(ctx);
1947
1874
  const request = await ctx.requestConversationBinding({
1948
1875
  summary: `Codex app-server thread ${formatCodexDisplayText(threadLabel)} in ${formatCodexDisplayText(workspaceDir)}`,
1949
1876
  detachHint: "/codex detach",
@@ -1977,6 +1904,7 @@ async function detachConversation(deps, ctx) {
1977
1904
  bindingStore: deps.bindingStore,
1978
1905
  identity,
1979
1906
  expectedThreadId,
1907
+ assertCurrent: () => assertCodexHostOwnerCurrent(ctx),
1980
1908
  ...expectedStartId ? { expectedStartId } : {},
1981
1909
  ...isIncognitoSessionKey(sourceSessionKey) ? { allowUntracked: true } : {},
1982
1910
  afterClear: async () => {
@@ -1985,6 +1913,7 @@ async function detachConversation(deps, ctx) {
1985
1913
  })) return "This Codex conversation binding changed while detaching; try again.";
1986
1914
  return detachedPublicConversation;
1987
1915
  });
1916
+ assertCodexHostOwnerCurrent(ctx);
1988
1917
  return await detachPublicConversation();
1989
1918
  }
1990
1919
  async function describeConversationBinding(deps, ctx) {
@@ -2144,6 +2073,7 @@ async function resumeThread(deps, ctx, pluginConfig, args) {
2144
2073
  sessionId: ctx.sessionId,
2145
2074
  storePath: ctx.sessionTarget?.storePath,
2146
2075
  assertCurrent: assertHostGeneration,
2076
+ assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx),
2147
2077
  beforeRequest: async (request) => {
2148
2078
  const { thread } = await request({
2149
2079
  method: "thread/read",
@@ -2188,6 +2118,7 @@ async function bindCodexCliNodeSession(deps, ctx, parsed) {
2188
2118
  cwd: resolved.session?.cwd
2189
2119
  });
2190
2120
  const summary = `Codex CLI session ${formatCodexDisplayText(parsed.threadId)} on ${formatCodexDisplayText(nodeId)}`;
2121
+ assertCodexHostOwnerCurrent(ctx);
2191
2122
  const request = await ctx.requestConversationBinding({
2192
2123
  summary,
2193
2124
  detachHint: "/codex detach",
@@ -2280,7 +2211,10 @@ async function handleComputerUseCommand(deps, ctx, pluginConfig, args) {
2280
2211
  forceEnable: parsed.action === "install" || parsed.hasOverrides,
2281
2212
  ...Object.keys(parsed.overrides).length > 0 ? { overrides: parsed.overrides } : {}
2282
2213
  };
2283
- if (parsed.action === "install") return formatComputerUseStatus(await deps.installCodexComputerUse(params));
2214
+ if (parsed.action === "install") return formatComputerUseStatus(await deps.installCodexComputerUse({
2215
+ ...params,
2216
+ assertCurrent: () => assertCodexHostOwnerCurrent(ctx)
2217
+ }));
2284
2218
  return formatComputerUseStatus(await deps.readCodexComputerUseStatus(params));
2285
2219
  }
2286
2220
  async function handleNativeGoal(deps, ctx, pluginConfig, args) {
@@ -2290,10 +2224,13 @@ async function handleNativeGoal(deps, ctx, pluginConfig, args) {
2290
2224
  const { target, binding } = authority;
2291
2225
  if (!target) return "Cannot manage the Codex goal because this command has no stable binding identity.";
2292
2226
  if (!binding?.threadId) return "No Codex thread is attached to this OpenClaw session yet.";
2293
- const connection = resolveCodexBindingAppServerConnection({
2227
+ const connection = await resolveCodexBindingAppServerConnection({
2294
2228
  binding,
2295
2229
  authProfileId: binding.authProfileId,
2296
- pluginConfig
2230
+ pluginConfig,
2231
+ agentDir: target.agentDir,
2232
+ config: ctx.config,
2233
+ assertCurrent: authority.assertCurrent
2297
2234
  });
2298
2235
  const goalRequestOptions = {
2299
2236
  agentDir: target.agentDir,
@@ -2311,7 +2248,10 @@ async function handleNativeGoal(deps, ctx, pluginConfig, args) {
2311
2248
  }
2312
2249
  if (action === "clear") {
2313
2250
  if (args.length > 1) return "Usage: /codex goal clear";
2314
- const response = await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.clearThreadGoal, { threadId: binding.threadId }, goalRequestOptions);
2251
+ const response = await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.clearThreadGoal, { threadId: binding.threadId }, {
2252
+ ...goalRequestOptions,
2253
+ assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx)
2254
+ });
2315
2255
  return isJsonObject(response) && response.cleared === true ? "Cleared the Codex goal." : "No Codex goal was active.";
2316
2256
  }
2317
2257
  const requestedStatus = action === "pause" ? "paused" : action === "resume" ? "active" : action === "block" ? "blocked" : action === "complete" ? "complete" : void 0;
@@ -2324,6 +2264,7 @@ async function handleNativeGoal(deps, ctx, pluginConfig, args) {
2324
2264
  ...requestedStatus ? { status: requestedStatus } : {}
2325
2265
  }, {
2326
2266
  ...goalRequestOptions,
2267
+ assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx),
2327
2268
  ...(isObjectiveUpdate || requestedStatus === "active") && connection.usesSupervisionConnection ? { beforeRequest: supervisedCommandGuard(deps, target.identity, binding) } : {}
2328
2269
  })));
2329
2270
  }
@@ -2340,20 +2281,17 @@ function formatNativeGoal(response) {
2340
2281
  `- Tokens: ${tokensUsed}${tokenBudget === void 0 ? "" : ` / ${tokenBudget}`}`
2341
2282
  ].join("\n");
2342
2283
  }
2343
- async function stopConversationTurn(deps, ctx, pluginConfig) {
2284
+ async function stopConversationTurn(deps, ctx) {
2344
2285
  const authority = await resolvePreparedCodexCommandAuthority(deps, ctx);
2345
2286
  const { target, binding } = authority;
2346
2287
  if (!target) return "Cannot stop Codex because this command did not include a stable binding identity.";
2347
2288
  return (await deps.stopCodexConversationTurn({
2348
2289
  identity: target.identity,
2349
2290
  binding,
2350
- pluginConfig,
2351
- agentDir: target.agentDir,
2352
- config: ctx.config,
2353
- assertCurrent: authority.assertCurrent
2291
+ assertCurrent: authority.assertMutationCurrent
2354
2292
  })).message;
2355
2293
  }
2356
- async function steerConversationTurn(deps, ctx, pluginConfig, message) {
2294
+ async function steerConversationTurn(deps, ctx, message) {
2357
2295
  const authority = await resolvePreparedCodexCommandAuthority(deps, ctx);
2358
2296
  const { target, binding } = authority;
2359
2297
  if (!target) return "Cannot steer Codex because this command did not include a stable binding identity.";
@@ -2361,10 +2299,7 @@ async function steerConversationTurn(deps, ctx, pluginConfig, message) {
2361
2299
  identity: target.identity,
2362
2300
  binding,
2363
2301
  message,
2364
- pluginConfig,
2365
- agentDir: target.agentDir,
2366
- config: ctx.config,
2367
- assertCurrent: authority.assertCurrent
2302
+ assertCurrent: authority.assertMutationCurrent
2368
2303
  })).message;
2369
2304
  }
2370
2305
  async function setConversationModel(deps, ctx, pluginConfig, args) {
@@ -2396,7 +2331,8 @@ async function setConversationModel(deps, ctx, pluginConfig, args) {
2396
2331
  config: ctx.config,
2397
2332
  binding,
2398
2333
  storePath: authority.storePath,
2399
- assertCurrent: authority.assertCurrent
2334
+ assertCurrent: authority.assertCurrent,
2335
+ assertCommitAllowed: authority.assertMutationCurrent
2400
2336
  });
2401
2337
  }
2402
2338
  async function setConversationFastMode(deps, ctx, args) {
@@ -2412,7 +2348,7 @@ async function setConversationFastMode(deps, ctx, args) {
2412
2348
  bindingStore: deps.bindingStore,
2413
2349
  binding,
2414
2350
  enabled: parsed,
2415
- assertCurrent: authority.assertCurrent
2351
+ assertCurrent: parsed === void 0 ? authority.assertCurrent : authority.assertMutationCurrent
2416
2352
  });
2417
2353
  }
2418
2354
  async function setConversationPermissions(deps, ctx, args) {
@@ -2428,7 +2364,7 @@ async function setConversationPermissions(deps, ctx, args) {
2428
2364
  mode: parsed,
2429
2365
  config: ctx.config,
2430
2366
  storePath: authority.storePath,
2431
- assertCurrent: authority.assertHostCurrent,
2367
+ assertCurrent: parsed ? authority.assertHostMutationCurrent : authority.assertHostCurrent,
2432
2368
  session: {
2433
2369
  agentId: target.agentId,
2434
2370
  sessionId: ctx.sessionId,
@@ -2457,14 +2393,17 @@ async function startThreadAction(deps, ctx, pluginConfig, kind, args) {
2457
2393
  }
2458
2394
  const compactCurrent = ctx.runtimeContext?.compactCurrent;
2459
2395
  if (!compactCurrent) return "Codex compaction is unavailable because this command is not bound to a session.";
2460
- authority.assertCurrent();
2396
+ authority.assertMutationCurrent();
2461
2397
  const result = await compactCurrent();
2462
2398
  return result.compacted ? `Compacted Codex session (${result.tokensAfter ?? "unknown"} tokens after).` : `Codex compaction did not complete: ${formatCodexDisplayText(result.reason ?? "no reason returned")}.`;
2463
2399
  }
2464
- const connection = resolveCodexBindingAppServerConnection({
2400
+ const connection = await resolveCodexBindingAppServerConnection({
2465
2401
  binding,
2466
2402
  authProfileId: binding.authProfileId,
2467
- pluginConfig
2403
+ pluginConfig,
2404
+ agentDir: target.agentDir,
2405
+ config: ctx.config,
2406
+ assertCurrent: authority.assertCurrent
2468
2407
  });
2469
2408
  await deps.bindingStore.withLease(target.identity, () => deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.review, {
2470
2409
  threadId: binding.threadId,
@@ -2477,6 +2416,7 @@ async function startThreadAction(deps, ctx, pluginConfig, kind, args) {
2477
2416
  sessionKey: authority.sessionKey,
2478
2417
  storePath: authority.storePath,
2479
2418
  assertCurrent: authority.assertCurrent,
2419
+ assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx),
2480
2420
  ...connection.usesSupervisionConnection ? {
2481
2421
  startOptions: connection.appServer.start,
2482
2422
  beforeRequest: supervisedCommandGuard(deps, target.identity, binding)
@@ -2552,7 +2492,11 @@ function formatCodexAvailablePlugins(plugins, warnings, query, page) {
2552
2492
  //#region extensions/codex/src/command-plugins-management.ts
2553
2493
  const POLICY_REFRESH_HINT = "Takes effect on your next message.";
2554
2494
  const AVAILABLE_USAGE = "Usage: /codex plugins available [query] [--page <positive integer>]. Search text must be at most 100 characters; use -- before literal query text that contains options.";
2555
- async function handleCodexPluginsSubcommand(ctx, rest, io, runtime) {
2495
+ async function handleCodexPluginsSubcommand(input, rest, io, runtime) {
2496
+ const ctx = {
2497
+ ...input,
2498
+ gatewayClientScopes: input.gatewayClientScopes?.slice()
2499
+ };
2556
2500
  const [verb = "list", ...args] = rest;
2557
2501
  const normalized = verb.toLowerCase();
2558
2502
  if (normalized === "menu") {
@@ -2618,7 +2562,7 @@ async function handleCodexPluginsSubcommand(ctx, rest, io, runtime) {
2618
2562
  if (args.length !== 1 || !args[0]) return { text: "Usage: /codex plugins install <plugin>@<marketplace>" };
2619
2563
  if (!canMutateCodexHost(ctx)) return { text: "Only an owner or operator.admin gateway client can run /codex plugins install." };
2620
2564
  if (!runtime) return { text: "Codex plugin installation is unavailable for this command." };
2621
- return await installCodexPlugin(args[0], io, runtime);
2565
+ return await installCodexPlugin(args[0], io, runtime, ctx);
2622
2566
  }
2623
2567
  const target = args[0];
2624
2568
  if (normalized === "enable" || normalized === "disable") {
@@ -2636,6 +2580,7 @@ async function handleCodexPluginsSubcommand(ctx, rest, io, runtime) {
2636
2580
  if (configured.status === "ambiguous" || configured.status === "mismatched") return { text: describeConfiguredPluginIdentityConflict(target, configured.status) };
2637
2581
  if (configured.status === "missing") return { text: `Codex sub-plugin '${formatCodexDisplayText(target)}' is not configured. Run '/codex plugins list' to see configured plugins.` };
2638
2582
  const configKey = configured.configKey;
2583
+ assertCodexHostOwnerCurrent(ctx);
2639
2584
  await io.mutate((block) => {
2640
2585
  if (wantEnabled) block.enabled = true;
2641
2586
  block.plugins ??= {};
@@ -2643,7 +2588,7 @@ async function handleCodexPluginsSubcommand(ctx, rest, io, runtime) {
2643
2588
  ...block.plugins[configKey],
2644
2589
  enabled: wantEnabled
2645
2590
  };
2646
- });
2591
+ }, () => assertCodexHostOwnerCurrent(ctx));
2647
2592
  return { text: `${formatCodexDisplayText(configKey)}: ${wantEnabled ? "enabled" : "disabled"} in openclaw.json. ${POLICY_REFRESH_HINT}` };
2648
2593
  }
2649
2594
  return { text: `Unknown /codex plugins subcommand: ${formatCodexDisplayText(verb)}\n\n${buildPluginsHelp()}` };
@@ -2749,7 +2694,7 @@ function buildPluginsHelp() {
2749
2694
  "Only an owner or operator.admin can discover, inspect, refresh hosted apps, install, enable, or disable plugins."
2750
2695
  ].join("\n");
2751
2696
  }
2752
- async function installCodexPlugin(requestedId, io, runtime) {
2697
+ async function installCodexPlugin(requestedId, io, runtime, ctx) {
2753
2698
  const requested = parseCodexPluginMarketplaceId(requestedId);
2754
2699
  if (!requested) return { text: "Invalid plugin identifier. Use /codex plugins install <plugin>@<marketplace>. Both names allow ASCII letters, digits, underscores, and hyphens. Plugin names may also contain dots between nonempty segments." };
2755
2700
  let plugin;
@@ -2791,6 +2736,7 @@ async function installCodexPlugin(requestedId, io, runtime) {
2791
2736
  } : void 0;
2792
2737
  if (!requestParams) return { text: `${formatCodexDisplayText(requestedId)} cannot be installed because its marketplace did not provide a trusted local path or remote plugin identifier.` };
2793
2738
  try {
2739
+ assertCodexHostOwnerCurrent(ctx);
2794
2740
  result = await runtime.install(requestParams);
2795
2741
  } catch (error) {
2796
2742
  return { text: `Could not install ${formatCodexDisplayText(requestedId)}: ${formatCodexDisplayText(errorMessage(error))}` };
@@ -2798,6 +2744,7 @@ async function installCodexPlugin(requestedId, io, runtime) {
2798
2744
  }
2799
2745
  const selectedPlugin = plugin;
2800
2746
  try {
2747
+ assertCodexHostOwnerCurrent(ctx);
2801
2748
  await io.mutate((block) => {
2802
2749
  block.plugins ??= {};
2803
2750
  const configured = resolveInstalledPluginKey(block.plugins, selectedPlugin);
@@ -2814,7 +2761,7 @@ async function installCodexPlugin(requestedId, io, runtime) {
2814
2761
  pluginName: existing?.pluginName ?? (curated ? selectedPlugin.pluginName : persistedPluginName(selectedPlugin))
2815
2762
  };
2816
2763
  block.plugins[configKey] = updated;
2817
- });
2764
+ }, () => assertCodexHostOwnerCurrent(ctx));
2818
2765
  } catch (error) {
2819
2766
  return { text: `${formatCodexDisplayText(requestedId)} was installed in Codex but could not be authorized in OpenClaw and will not be exposed: ${formatCodexDisplayText(errorMessage(error))}` };
2820
2767
  }
@@ -2918,7 +2865,11 @@ function formatPluginList(plugins, options = {}) {
2918
2865
  //#region extensions/codex/src/command-plugins-runtime.ts
2919
2866
  const SCOPE_CHANGED_MESSAGE = "Codex account, conversation, or plugin policy changed. Run the command again.";
2920
2867
  async function withCodexPluginCommandContext(params, run) {
2921
- const { deps, ctx, pluginConfig } = params;
2868
+ const { deps, pluginConfig } = params;
2869
+ const ctx = {
2870
+ ...params.ctx,
2871
+ gatewayClientScopes: params.ctx.gatewayClientScopes?.slice()
2872
+ };
2922
2873
  const current = await deps.codexPluginsManagementIo?.readConfig() ?? {};
2923
2874
  const initialPolicy = JSON.stringify(current);
2924
2875
  const { scope, target, binding } = await resolveCommandAppServerContext(deps, ctx, pluginConfig);
@@ -2999,7 +2950,10 @@ async function withCodexPluginCommandContext(params, run) {
2999
2950
  const response = await request({
3000
2951
  method,
3001
2952
  requestParams,
3002
- assertCurrent
2953
+ assertCurrent: () => {
2954
+ assertCurrent();
2955
+ assertCodexHostOwnerCurrent(ctx);
2956
+ }
3003
2957
  });
3004
2958
  await validateCurrent();
3005
2959
  return response;
@@ -3082,7 +3036,8 @@ async function handleCodexSubcommand(ctx, options) {
3082
3036
  const scope = await getAppServerScope();
3083
3037
  return await deps.codexControlRequest(options.pluginConfig, CODEX_CONTROL_METHODS.installPlugin, requestParams, {
3084
3038
  ...scope,
3085
- config: ctx.config
3039
+ config: ctx.config,
3040
+ assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx)
3086
3041
  });
3087
3042
  },
3088
3043
  refresh: async (workspaceDir) => {
@@ -3115,7 +3070,6 @@ async function handleCodexSubcommand(ctx, options) {
3115
3070
  appServerVersion: client.getServerVersion(),
3116
3071
  runtimeIdentity: client.getRuntimeIdentity()
3117
3072
  });
3118
- defaultCodexPluginMetadataCache.invalidate(appCacheKey);
3119
3073
  return await refreshCodexPluginRuntimeState({
3120
3074
  configCwd: workspaceDir,
3121
3075
  appCache: defaultCodexAppInventoryCache,
@@ -3160,9 +3114,9 @@ async function handleCodexSubcommand(ctx, options) {
3160
3114
  }
3161
3115
  if (normalized === "stop") {
3162
3116
  if (rest.length > 0) return { text: "Usage: /codex stop" };
3163
- return { text: await stopConversationTurn(deps, ctx, options.pluginConfig) };
3117
+ return { text: await stopConversationTurn(deps, ctx) };
3164
3118
  }
3165
- if (normalized === "steer") return { text: await steerConversationTurn(deps, ctx, options.pluginConfig, rest.join(" ")) };
3119
+ if (normalized === "steer") return { text: await steerConversationTurn(deps, ctx, rest.join(" ")) };
3166
3120
  if (normalized === "model") return { text: await setConversationModel(deps, ctx, options.pluginConfig, rest) };
3167
3121
  if (normalized === "fast") {
3168
3122
  if (isMenuVerb(rest)) return buildCodexFastMenuReply();
@@ -3206,6 +3160,7 @@ async function handleCodexSubcommand(ctx, options) {
3206
3160
  return { text: formatAccount(account, limits, await readCodexAccountAuthOverview({
3207
3161
  ctx,
3208
3162
  agentDir: scope.agentDir,
3163
+ authProfileId: scope.authProfileId,
3209
3164
  pluginConfig: options.pluginConfig,
3210
3165
  safeCodexControlRequest: deps.safeCodexControlRequest,
3211
3166
  account,
@@ -3217,11 +3172,7 @@ async function handleCodexSubcommand(ctx, options) {
3217
3172
  function resolvePluginRuntimeRefreshMethod(method) {
3218
3173
  const recognized = [
3219
3174
  CODEX_CONTROL_METHODS.listPlugins,
3220
- CODEX_CONTROL_METHODS.listSkills,
3221
- CODEX_CONTROL_METHODS.listHooks,
3222
- CODEX_CONTROL_METHODS.reloadMcpServers,
3223
3175
  CODEX_CONTROL_METHODS.installedApps,
3224
- CODEX_CONTROL_METHODS.listApps,
3225
3176
  CODEX_CONTROL_METHODS.readApps
3226
3177
  ].find((candidate) => candidate === method);
3227
3178
  if (!recognized) throw new Error(`Unexpected Codex plugin refresh method: ${method}`);