@openclaw/codex 2026.9.5 → 2026.9.7

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 (174) hide show
  1. package/README.md +2 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-DFhbh1zz.mjs} +6 -6
  4. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-D3GcSoSa.mjs} +35 -55
  5. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-DOP-cW5j.mjs} +179 -73
  6. package/dist/.setup/attempt-workspace-context-C5HigshI.mjs +164 -0
  7. package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
  8. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-Dbvq-QgB.mjs} +41 -111
  9. package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
  10. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  11. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  12. package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
  13. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
  14. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-6TpgD1M6.mjs} +5 -5
  15. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-CbjoN2OW.mjs} +140 -37
  16. package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
  17. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-Da1_z0kd.mjs} +1 -1
  18. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-B3WEZl4e.mjs} +2 -10
  19. package/dist/.setup/{client-vXs2929Q.mjs → client-N0JpgSzF.mjs} +635 -872
  20. package/dist/.setup/client-catalog-response-5HHLdcde.mjs +285 -0
  21. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-BeAoaovI.mjs} +9 -8
  22. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-R3ckE3Co.mjs} +36 -64
  23. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-ylTMS00z.mjs} +301 -488
  24. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-CGJGUQ6Y.mjs} +40 -28
  25. package/dist/.setup/compact-C2WamavS.mjs +776 -0
  26. package/dist/.setup/{config-CedDWjM-.mjs → config-DKhXquav.mjs} +26 -28
  27. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-CzyWLTJt.mjs} +68 -65
  28. package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
  29. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C0NbLms1.mjs} +2 -2
  30. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-CE-FcGw9.mjs} +51 -215
  31. package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
  32. package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
  33. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-3Min8qvP.mjs} +71 -105
  34. package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
  35. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-CEP8X5JC.mjs} +30 -69
  36. package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
  37. package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
  38. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-DzlsLUuS.mjs} +3136 -3167
  39. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CxUtC-xG.mjs} +8 -17
  40. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-CDsPJOa2.mjs} +9 -6
  41. package/dist/.setup/event-projector-assistant-message-CigreO4K.mjs +69 -0
  42. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-03R0I2dM.mjs} +4 -26
  43. package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
  44. package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
  45. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D-9gWlTR.mjs} +16 -18
  46. package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
  47. package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
  48. package/dist/.setup/inference-proxy-DhcXOgUE.mjs +561 -0
  49. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-Dm3PzxJk.mjs} +15 -11
  50. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  51. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-kiWRhNRE.mjs} +16 -9
  52. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-PAuZgJC6.mjs} +14 -14
  53. package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
  54. package/dist/.setup/{models-BDFgm_G-.mjs → models-DHXZtVVk.mjs} +9 -18
  55. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-CuG53tu4.mjs} +5 -5
  56. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-BxZJy5mP.mjs} +6 -31
  57. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-Dpsmf2wz.mjs} +4422 -3808
  58. package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
  59. package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
  60. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-HC4W6FLI.mjs} +99 -111
  61. package/dist/.setup/node-exec-server.runtime-BgBfWQqo.mjs +244 -0
  62. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-Y-QIvrKB.mjs} +118 -163
  63. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-cNHRfaxU.mjs} +10 -47
  64. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +9 -42
  65. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-Cky2XJUw.mjs} +32 -23
  66. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +22 -25
  67. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-DsjsL1dr.mjs} +328 -318
  68. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  69. package/dist/.setup/provider-DH8NSzGt.mjs +51 -0
  70. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-CAxoF-X1.mjs} +35 -12
  71. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-B7-X2TgG.mjs} +123 -166
  72. package/dist/.setup/{request-BioXJLYa.mjs → request-BHZ1nz8d.mjs} +25 -16
  73. package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
  74. package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
  75. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-D8RZUOzY.mjs} +2046 -1454
  76. package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
  77. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-DDQ-HGXf.mjs} +43 -47
  78. package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
  79. package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
  80. package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
  81. package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
  82. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-Oe9L-CNY.mjs} +73 -132
  83. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-jo6H8dFr.mjs} +242 -60
  84. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-4sCdv5qx.mjs} +598 -452
  85. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BU_pHWG7.mjs} +59 -26
  86. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-spHfihri.mjs} +7 -7
  87. package/dist/.setup/session-catalog-events-DePDzzjc.mjs +139 -0
  88. package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
  89. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-CZvDzC6z.mjs} +286 -182
  90. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-BcQpHks3.mjs} +2 -2
  91. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-TeO7EyO-.mjs} +6 -2
  92. package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
  93. package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
  94. package/dist/.setup/session-catalog-native-projection-DjhwGL6x.mjs +178 -0
  95. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +30 -35
  96. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +25 -18
  97. package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
  98. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-parsing-CPGaPYr-.mjs} +14 -180
  99. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-Cr5qP5Dj.mjs} +15 -5
  100. package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
  101. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-Cn_nCqfq.mjs} +11 -24
  102. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-D83lJWHG.mjs} +16 -23
  103. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-WhX-X33a.mjs} +7 -10
  104. package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
  105. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-MnPKncqP.mjs} +14 -23
  106. package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
  107. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
  108. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-qMTxkNx2.mjs} +31 -12
  109. package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
  110. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-BsvEabkw.mjs} +17 -13
  111. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DqyTMYug.mjs} +826 -485
  112. package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +153 -0
  113. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-C4kCmQy1.mjs} +206 -334
  114. package/dist/.setup/{source-Bjp4UQij.mjs → source-CS_7GFJZ.mjs} +82 -139
  115. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  116. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  117. package/dist/.setup/thread-lifecycle-DPflntEJ.mjs +2362 -0
  118. package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
  119. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-roNP0l1c.mjs} +47 -10
  120. package/dist/.setup/thread-policy-DTd-DtkX.mjs +109 -0
  121. package/dist/.setup/thread-requests-B_bRnMGN.mjs +2102 -0
  122. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-CdDaoc7T.mjs} +6 -6
  123. package/dist/.setup/timeout-CXOfNoaX.mjs +46 -0
  124. package/dist/.setup/transcript-history-projection-DRSifI-1.mjs +201 -0
  125. package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
  126. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-kxmCYsuF.mjs} +224 -206
  127. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-Bdegpn2V.mjs} +138 -75
  128. package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
  129. package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
  130. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-CBeVjBpT.mjs} +48 -40
  131. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BMzNxeR_.mjs} +5 -4
  132. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-QXerDo3i.mjs} +5 -20
  133. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-P77OUeoo.mjs} +10 -20
  134. package/dist/api.js +25 -16
  135. package/dist/catalog-page-worker-entrypoint.js +12 -0
  136. package/dist/catalog-page.worker.js +9 -0
  137. package/dist/cli-metadata.js +1 -1
  138. package/dist/doctor-contract-api.js +50 -8
  139. package/dist/harness.js +344 -1
  140. package/dist/index.js +345 -346
  141. package/dist/media-understanding-provider.js +9 -22
  142. package/dist/migration-provider-api.js +1 -1
  143. package/dist/provider-discovery.js +1 -1
  144. package/dist/session-history-worker-runtime.js +16 -33
  145. package/dist/session-history.worker.js +1 -1
  146. package/openclaw.plugin.json +14 -2
  147. package/package.json +11 -7
  148. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  149. package/dist/.setup/compact-C3i3qlzj.mjs +0 -687
  150. package/dist/.setup/event-projector-assistant-message-DNUR1s0A.mjs +0 -105
  151. package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +0 -200
  152. package/dist/.setup/harness-rxaaoN-o.mjs +0 -349
  153. package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
  154. package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
  155. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  156. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  157. package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
  158. package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +0 -135
  159. package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +0 -411
  160. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  161. package/dist/.setup/plugin-approval-roundtrip-CjfzafAZ.mjs +0 -122
  162. package/dist/.setup/provider-fFh_-VR3.mjs +0 -50
  163. package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
  164. package/dist/.setup/sandbox-guard-BBP-RbTf.mjs +0 -166
  165. package/dist/.setup/session-binding-_0W_fHRr.mjs +0 -721
  166. package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +0 -250
  167. package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
  168. package/dist/.setup/session-initialization-DH1z6fXn.mjs +0 -75
  169. package/dist/.setup/thread-history-page-BTx-4xsg.mjs +0 -83
  170. package/dist/.setup/thread-lifecycle-Cik28qWn.mjs +0 -4904
  171. package/dist/.setup/thread-policy-Cjs4B8xf.mjs +0 -54
  172. package/dist/.setup/timeout-DZF05XrR.mjs +0 -63
  173. package/dist/.setup/transcript-history-projection-DHNBDhCU.mjs +0 -243
  174. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
@@ -0,0 +1,196 @@
1
+ import { createRequire } from "node:module";
2
+ import path from "node:path";
3
+ //#region extensions/codex/src/app-server/launch-args.ts
4
+ const CODEX_VALUE_OPTIONS = /* @__PURE__ */ new Set([
5
+ "-m",
6
+ "--model",
7
+ "--local-provider",
8
+ "-p",
9
+ "--profile",
10
+ "-s",
11
+ "--sandbox",
12
+ "-a",
13
+ "--ask-for-approval",
14
+ "-C",
15
+ "--cd",
16
+ "--add-dir",
17
+ "--remote",
18
+ "--remote-auth-token-env",
19
+ "-c",
20
+ "--config",
21
+ "--enable",
22
+ "--disable",
23
+ "--listen",
24
+ "--sock",
25
+ "--code-mode-host",
26
+ "--ws-auth",
27
+ "--ws-token-file",
28
+ "--ws-token-sha256",
29
+ "--ws-shared-secret-file",
30
+ "--ws-issuer",
31
+ "--ws-audience",
32
+ "--ws-max-clock-skew-seconds"
33
+ ]);
34
+ /** One tokenization owner for launch, turn policy, reviewer trust, and private turns. */
35
+ function readCodexArgs(args) {
36
+ const tokens = [];
37
+ let nativeSubcommand = false;
38
+ let end = 0;
39
+ for (const [index, arg] of args.entries()) {
40
+ if (index < end) continue;
41
+ end = index + 1;
42
+ const attached = /^(--[^=]+)=([\s\S]*)$/u.exec(arg) ?? /^(-[cmpisaC])=?([\s\S]+)$/u.exec(arg);
43
+ const name = attached?.[1] ?? arg;
44
+ let value = attached?.[2];
45
+ if (name === "-i" || name === "--image") while (args[end]?.startsWith("-") === false) end += 1;
46
+ else if (!attached && CODEX_VALUE_OPTIONS.has(name)) {
47
+ value = args[end];
48
+ if (value !== void 0) end += 1;
49
+ }
50
+ tokens.push({
51
+ index,
52
+ end,
53
+ name,
54
+ value
55
+ });
56
+ if (name === "app-server") nativeSubcommand = true;
57
+ if (name === "--" && nativeSubcommand) break;
58
+ }
59
+ return tokens;
60
+ }
61
+ /** Uses the native CLI configuration for status without starting its transport. */
62
+ function buildCodexLoginStatusArgs(args) {
63
+ const options = /* @__PURE__ */ new Set([
64
+ "-c",
65
+ "--config",
66
+ "-p",
67
+ "--profile",
68
+ "--enable",
69
+ "--disable"
70
+ ]);
71
+ const tokens = readCodexArgs(args);
72
+ const subcommandIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? -1;
73
+ const prefix = subcommandIndex < 0 ? [] : args.slice(0, subcommandIndex);
74
+ const configArgs = tokens.filter(({ index, name }) => index > subcommandIndex && options.has(name)).flatMap(({ index, end }) => args.slice(index, end));
75
+ return [
76
+ ...prefix,
77
+ ...configArgs,
78
+ "login",
79
+ "status"
80
+ ];
81
+ }
82
+ function readCodexAppServerConfigOptions(args) {
83
+ return readCodexArgs(args).filter(({ name }) => name === "-c" || name === "--config" || name === "-p" || name === "--profile");
84
+ }
85
+ const NODE_LAUNCH_VALUE_OPTIONS = /* @__PURE__ */ new Set([
86
+ "-r",
87
+ "--require",
88
+ "--import",
89
+ "--loader",
90
+ "--experimental-loader",
91
+ "--max-old-space-size",
92
+ "--max-semi-space-size",
93
+ "--stack-size"
94
+ ]);
95
+ const NODE_LAUNCH_FLAGS = /* @__PURE__ */ new Set([
96
+ "--enable-source-maps",
97
+ "--no-warnings",
98
+ "--trace-warnings",
99
+ "--trace-uncaught",
100
+ "--no-deprecation",
101
+ "--trace-deprecation",
102
+ "--experimental-strip-types",
103
+ "--experimental-transform-types",
104
+ "--no-experimental-strip-types",
105
+ "--use-strict",
106
+ "--expose-gc"
107
+ ]);
108
+ function resolveNodeLauncherModule(value, option, cwd) {
109
+ if (path.isAbsolute(value)) return value;
110
+ if (/^\.{1,2}[\\/]/u.test(value)) return path.resolve(cwd, value);
111
+ if (option === "-r" || option === "--require") return createRequire(path.join(cwd, "openclaw-codex-launcher.cjs")).resolve(value);
112
+ if (/^(?:file|data|node):/u.test(value)) return value;
113
+ throw new Error("Private Codex turns require an absolute or relative file path for ESM preloads");
114
+ }
115
+ /** Separates a supported launcher from native flags before a private turn sanitizes them. */
116
+ function resolveCodexPrivateLauncher(params) {
117
+ const launcherArgs = [];
118
+ let nativeArgs = [...params.args];
119
+ const executable = params.command.split(/[\\/]/u).at(-1)?.toLowerCase();
120
+ if (executable && [
121
+ "node",
122
+ "node.exe",
123
+ "nodejs",
124
+ "nodejs.exe"
125
+ ].includes(executable)) {
126
+ let index = 0;
127
+ while (params.args[index]?.startsWith("-")) {
128
+ const raw = params.args[index];
129
+ index += 1;
130
+ if (raw === "--") {
131
+ launcherArgs.push(raw);
132
+ break;
133
+ }
134
+ const attached = /^(--[^=]+)=([\s\S]*)$/u.exec(raw) ?? /^(-r)([\s\S]+)$/u.exec(raw);
135
+ const name = attached?.[1] ?? raw;
136
+ const normalizedName = name.replaceAll("_", "-");
137
+ if (NODE_LAUNCH_VALUE_OPTIONS.has(normalizedName)) {
138
+ const value = attached?.[2] ?? params.args[index++];
139
+ if (value === void 0 || !value.trim()) throw new Error("Private Codex turns received a Node launcher option without its value");
140
+ const moduleOption = [
141
+ "-r",
142
+ "--require",
143
+ "--import",
144
+ "--loader",
145
+ "--experimental-loader"
146
+ ].includes(normalizedName);
147
+ if (attached && !moduleOption) launcherArgs.push(raw);
148
+ else launcherArgs.push(name, moduleOption ? resolveNodeLauncherModule(value, normalizedName, path.resolve(params.cwd)) : value);
149
+ } else if (!attached && NODE_LAUNCH_FLAGS.has(name)) launcherArgs.push(raw);
150
+ else throw new Error(`Private Codex turns cannot isolate unsupported Node launcher option ${name}`);
151
+ }
152
+ const script = params.args[index];
153
+ if (!script) throw new Error("Private Codex turns require a Node wrapper script");
154
+ launcherArgs.push(path.resolve(params.cwd, script));
155
+ nativeArgs = params.args.slice(index + 1);
156
+ if (!readCodexArgs(nativeArgs).some(({ name }) => name === "app-server")) throw new Error("Private Codex turns require a native app-server command after the Node wrapper");
157
+ }
158
+ if (executable && /^(?:(?:ba|da|z|fi)?sh|python(?:\d+(?:\.\d+)*)?|ruby|perl|cmd|powershell|pwsh)(?:\.exe)?$/u.test(executable)) throw new Error("Private Codex turns cannot isolate inline or interpreted wrappers; use a Node script or a directly executable wrapper");
159
+ const tokens = readCodexArgs(nativeArgs);
160
+ const serverIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? nativeArgs.length;
161
+ if (tokens.some(({ index, name }) => index < serverIndex && (!name.startsWith("-") || name === "--"))) throw new Error("Private Codex turns cannot isolate this launcher prefix; use a Node script or a directly executable wrapper");
162
+ return {
163
+ launcherArgs,
164
+ nativeArgs
165
+ };
166
+ }
167
+ /** The stdio proxy forwards to an external server; it does not own that runtime. */
168
+ function isCodexAppServerProxyLaunch(args) {
169
+ const tokens = readCodexArgs(args);
170
+ const server = tokens.findLastIndex(({ name }) => name === "app-server");
171
+ return server >= 0 && tokens.slice(server + 1).find(({ name }) => !name.startsWith("-"))?.name === "proxy";
172
+ }
173
+ /** Keeps Codex overrides in one CLI scope without rewriting raw TOML or wrapper prefixes. */
174
+ function normalizeCodexAppServerArgs(rawArgs, enforcedOverride) {
175
+ const tokens = readCodexArgs(rawArgs);
176
+ const subcommandIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? -1;
177
+ const prefix = subcommandIndex < 0 ? [...rawArgs] : rawArgs.slice(0, subcommandIndex);
178
+ const suffix = [];
179
+ if (subcommandIndex >= 0) for (const token of tokens) {
180
+ if (token.index <= subcommandIndex) continue;
181
+ if (token.name === "--") {
182
+ suffix.push(...rawArgs.slice(token.index));
183
+ break;
184
+ }
185
+ (token.name === "-c" || token.name === "--config" ? prefix : suffix).push(...rawArgs.slice(token.index, token.end));
186
+ }
187
+ if (enforcedOverride && !(prefix.at(-2) === "-c" && prefix.at(-1) === enforcedOverride)) prefix.push("-c", enforcedOverride);
188
+ const normalized = subcommandIndex < 0 ? prefix : [
189
+ ...prefix,
190
+ "app-server",
191
+ ...suffix
192
+ ];
193
+ return normalized.length === rawArgs.length && normalized.every((arg, index) => arg === rawArgs[index]) ? rawArgs : normalized;
194
+ }
195
+ //#endregion
196
+ export { resolveCodexPrivateLauncher as a, readCodexAppServerConfigOptions as i, isCodexAppServerProxyLaunch as n, normalizeCodexAppServerArgs as r, buildCodexLoginStatusArgs as t };
@@ -1,5 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
- import { n as MANAGED_CODEX_APP_SERVER_PACKAGE } from "./version-CoqzXPgK.mjs";
1
+ import { t as __exportAll } from "./session-binding-sidecars-jo6H8dFr.mjs";
3
2
  import { createRequire } from "node:module";
4
3
  import { constants, existsSync, realpathSync } from "node:fs";
5
4
  import path from "node:path";
@@ -20,7 +19,10 @@ const MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES = [{
20
19
  appServerCommandPath: "/Applications/Codex.app/Contents/Resources/codex",
21
20
  bundledMarketplacePath: "/Applications/Codex.app/Contents/Resources/plugins/openai-bundled",
22
21
  computerUseServiceAppPaths: ["/Applications/Codex.app/Contents/Resources/plugins/openai-bundled/plugins/computer-use/Codex Computer Use.app", "/Applications/Codex.app/Contents/Resources/cua_node/lib/node_modules/@oai/sky/Codex Computer Use.app"]
23
- }];
22
+ }].flatMap((candidate) => [{
23
+ ...candidate,
24
+ appServerCommandPath: path.join(candidate.appBundlePath, "Contents", "Resources", "codex-cli", "CodexCLI.app", "Contents", "MacOS", "codex")
25
+ }, candidate]);
24
26
  function resolveMacOSDesktopCodexAppPathCandidates(platform = process.platform) {
25
27
  return platform === "darwin" ? MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES : [];
26
28
  }
@@ -28,7 +30,7 @@ function resolveMacOSDesktopCodexAppServerCommandCandidates(platform = process.p
28
30
  return resolveMacOSDesktopCodexAppPathCandidates(platform).map((candidate) => candidate.appServerCommandPath);
29
31
  }
30
32
  function resolveMacOSDesktopCodexBundledMarketplaceCandidates(platform = process.platform) {
31
- return resolveMacOSDesktopCodexAppPathCandidates(platform).map((candidate) => candidate.bundledMarketplacePath);
33
+ return [...new Set(resolveMacOSDesktopCodexAppPathCandidates(platform).map((candidate) => candidate.bundledMarketplacePath))];
32
34
  }
33
35
  function resolveMacOSDesktopCodexComputerUseServiceAppCandidates(platform = process.platform, appServerCommand) {
34
36
  if (platform !== "darwin") return [];
@@ -43,6 +45,13 @@ function resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath(params = {}
43
45
  return candidates.find((candidate) => pathExists(candidate));
44
46
  }
45
47
  //#endregion
48
+ //#region extensions/codex/src/app-server/version.ts
49
+ /** Exact Codex app-server version shipped by the OpenClaw Codex bridge. */
50
+ const CODEX_APP_SERVER_VERSION = "0.158.0";
51
+ /** Inclusive runtime compatibility floor for external app-server binaries. */
52
+ const MIN_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.149.0";
53
+ const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
54
+ //#endregion
46
55
  //#region extensions/codex/src/app-server/managed-binary.ts
47
56
  /**
48
57
  * Resolves the managed Codex app-server binary shipped with or installed beside
@@ -107,7 +116,7 @@ function isManagedCodexDesktopCommand(command, platform = process.platform) {
107
116
  return platform === "darwin" && resolveMacOSDesktopCodexAppServerCommandCandidates(platform).some((candidate) => candidate === command);
108
117
  }
109
118
  function resolveManagedCodexPackageRootForCommand(command, platform) {
110
- const pathApi = pathForPlatform(platform);
119
+ const pathApi = platform === "win32" ? path.win32 : path.posix;
111
120
  const commandPaths = [command];
112
121
  try {
113
122
  commandPaths.unshift(realpathSync(command));
@@ -160,6 +169,7 @@ function resolvePackageJsonFromRoot(packageName, root) {
160
169
  function resolveManagedCodexAppServerCommandCandidates(pluginRoot, platform, managedCommandOrder) {
161
170
  const packageCommand = resolveManagedCodexPackageEntrypoint(pluginRoot);
162
171
  const packageCommandPaths = packageCommand ? [packageCommand] : [];
172
+ if (managedCommandOrder === "package-only") return packageCommandPaths;
163
173
  const desktopCommandPaths = resolveMacOSDesktopCodexAppServerCommandCandidates(platform);
164
174
  return managedCommandOrder === "desktop-first" ? [...desktopCommandPaths, ...packageCommandPaths] : [...packageCommandPaths, ...desktopCommandPaths];
165
175
  }
@@ -170,9 +180,6 @@ function resolveManagedCodexPackageEntrypoint(pluginRoot) {
170
180
  return;
171
181
  }
172
182
  }
173
- function pathForPlatform(platform) {
174
- return platform === "win32" ? path.win32 : path.posix;
175
- }
176
183
  async function findManagedCodexAppServerCommandPaths(params) {
177
184
  const commandPaths = [];
178
185
  for (const commandPath of params.candidateCommandPaths) if (await params.pathExists(commandPath, params.platform)) commandPaths.push(commandPath);
@@ -192,4 +199,4 @@ async function commandPathExists(filePath, platform) {
192
199
  }
193
200
  }
194
201
  //#endregion
195
- export { resolvePackagedCodexNativeCommand as a, resolveMacOSDesktopCodexAppPathCandidates as c, resolveManagedCodexNativeCommand as i, resolveMacOSDesktopCodexBundledMarketplaceCandidates as l, managed_binary_exports as n, setManagedCodexPluginRoot as o, resolveManagedCodexAppServerStartOptions as r, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as u };
202
+ export { resolvePackagedCodexNativeCommand as a, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION as c, resolveMacOSDesktopCodexBundledMarketplaceCandidates as d, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as f, resolveManagedCodexNativeCommand as i, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as l, managed_binary_exports as n, setManagedCodexPluginRoot as o, resolveManagedCodexAppServerStartOptions as r, CODEX_APP_SERVER_VERSION as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexAppPathCandidates as u };
@@ -1,15 +1,14 @@
1
- import { r as buildCodexRuntimeModelParams } from "./harness-rxaaoN-o.mjs";
2
- import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
3
- import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
4
- import { n as isCodexAppServerProxyLaunch } from "./launch-args-DnMak49W.mjs";
5
- import { o as withCodexAppServerJsonClient } from "./request-BioXJLYa.mjs";
6
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
7
- import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-WqZtZfXN.mjs";
8
- import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-BpTtuLQ5.mjs";
9
- import { t as listAllCodexAppServerModels } from "./models-BDFgm_G-.mjs";
10
- import { probeCodexNativeAuth } from "./native-auth-BLZGqFjw.mjs";
1
+ import { t as buildCodexRuntimeModelParams } from "./model-runtime-BdqzOMkU.mjs";
2
+ import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
3
+ import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
4
+ import { o as withCodexAppServerJsonClient } from "./request-BHZ1nz8d.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
6
+ import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-B0okYl2D.mjs";
7
+ import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-DqyTMYug.mjs";
8
+ import { i as isCodexResponsesOAuthCredential } from "./responses-oauth-twnuTaAa.mjs";
9
+ import { n as listAllCodexAppServerModels } from "./models-DHXZtVVk.mjs";
10
+ import { probeCodexNativeAuth } from "./native-auth-CuG53tu4.mjs";
11
11
  //#region extensions/codex/src/app-server/model-catalog.ts
12
- const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 2500;
13
12
  const INPUT_TYPES = /* @__PURE__ */ new Set([
14
13
  "text",
15
14
  "image",
@@ -82,11 +81,12 @@ function createCodexAppServerModelCatalog(runtime) {
82
81
  store: authProfileStore,
83
82
  config: params.config
84
83
  }) : void 0;
84
+ if (isCodexResponsesOAuthCredential(authProfileStore?.profiles[authProfileId ?? ""])) return [];
85
85
  const usesNativeHome = ownsLocalProcess && options.start.homeScope === "user";
86
86
  const native = usesNativeHome ? await probeCodexNativeAuth({ pluginConfig }) : void 0;
87
87
  if (usesNativeHome && !native || disposed || observations.get(key) !== observation) return [];
88
88
  const { start } = options;
89
- const timeoutMs = discovery?.timeoutMs ?? DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS;
89
+ const timeoutMs = discovery?.timeoutMs ?? 1e4;
90
90
  const result = await withCodexAppServerJsonClient({
91
91
  startOptions: start,
92
92
  config: params.config,
@@ -107,11 +107,11 @@ function createCodexAppServerModelCatalog(runtime) {
107
107
  method: "account/read",
108
108
  requestParams: { refreshToken: false }
109
109
  });
110
- const observedType = isJsonObject(account.account) ? account.account.type : void 0;
110
+ const observedType = account.account?.type;
111
111
  return {
112
112
  models,
113
113
  isCurrent,
114
- accountType: account.requiresOpenaiAuth === true ? observedType === "apiKey" || observedType === "chatgpt" ? observedType : void 0 : void 0
114
+ accountType: account.requiresOpenaiAuth ? observedType === "apiKey" || observedType === "chatgpt" ? observedType : void 0 : void 0
115
115
  };
116
116
  });
117
117
  if (disposed || observations.get(key) !== observation || !result.isCurrent()) return [];
@@ -0,0 +1,11 @@
1
+ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ //#region extensions/codex/src/app-server/model-runtime.ts
3
+ const CODEX_APP_SERVER_RUNTIME_MODEL_PARAM = "codexAppServerRuntimeModel";
4
+ function buildCodexRuntimeModelParams(catalogId, runtimeModelId) {
5
+ return catalogId === runtimeModelId ? void 0 : { [CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]: runtimeModelId };
6
+ }
7
+ function readCodexRuntimeModelId(model, fallbackId) {
8
+ return normalizeOptionalString(model?.params?.[CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]) ?? model?.id ?? fallbackId;
9
+ }
10
+ //#endregion
11
+ export { readCodexRuntimeModelId as n, buildCodexRuntimeModelParams as t };
@@ -1,15 +1,10 @@
1
- import { h as assertCodexModelListResponse } from "./client-vXs2929Q.mjs";
2
- import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { g as assertCodexModelListResponse } from "./client-N0JpgSzF.mjs";
2
+ import { normalizeOptionalString, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/codex/src/app-server/models.ts
4
- /**
5
- * Lists and normalizes models exposed by the Codex app-server `model/list`
6
- * endpoint, including pagination and shared-client lease handling.
7
- */
8
- /** Lists one Codex app-server model page using the configured auth/client options. */
4
+ const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 1e4;
9
5
  async function listCodexAppServerModels(options = {}) {
10
6
  return await withCodexAppServerModelRequest(options, async (request) => requestModelListPage(request, options));
11
7
  }
12
- /** Walks Codex app-server model pages until exhaustion or the max-page guard. */
13
8
  async function listAllCodexAppServerModels(options = {}) {
14
9
  const maxPages = normalizeMaxPages(options.maxPages);
15
10
  return await withCodexAppServerModelRequest(options, async (request) => {
@@ -35,10 +30,10 @@ async function listAllCodexAppServerModels(options = {}) {
35
30
  }
36
31
  async function withCodexAppServerModelRequest(options, run) {
37
32
  if (options.request) return await run(options.request);
38
- const timeoutMs = options.timeoutMs ?? 2500;
33
+ const timeoutMs = options.timeoutMs ?? 1e4;
39
34
  const useSharedClient = options.sharedClient !== false;
40
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-BpTtuLQ5.mjs").then((n) => n.y);
41
- const { requestCodexAppServerClientJson } = await import("./request-BioXJLYa.mjs").then((n) => n.a);
35
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DqyTMYug.mjs").then((n) => n.v);
36
+ const { requestCodexAppServerClientJson } = await import("./request-BHZ1nz8d.mjs").then((n) => n.a);
42
37
  const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
43
38
  startOptions: options.startOptions,
44
39
  timeoutMs,
@@ -69,7 +64,6 @@ async function requestModelListPage(request, options) {
69
64
  }
70
65
  }));
71
66
  }
72
- /** Parses a raw Codex app-server model/list response into OpenClaw's normalized shape. */
73
67
  function readModelListResult(value) {
74
68
  const response = assertCodexModelListResponse(value);
75
69
  const models = response.data.map((entry) => readCodexModel(entry));
@@ -91,17 +85,14 @@ function readCodexModel(value) {
91
85
  hidden: value.hidden,
92
86
  isDefault: value.isDefault,
93
87
  inputModalities: value.inputModalities,
94
- supportedReasoningEfforts: readReasoningEfforts(value.supportedReasoningEfforts),
88
+ serviceTiers: normalizeUniqueTrimmedStringList((value.serviceTiers ?? []).map((tier) => tier.id)),
89
+ supportedReasoningEfforts: normalizeUniqueTrimmedStringList(value.supportedReasoningEfforts.map((entry) => entry.reasoningEffort)),
95
90
  ...normalizeOptionalString(value.defaultReasoningEffort) ? { defaultReasoningEffort: normalizeOptionalString(value.defaultReasoningEffort) } : {},
96
91
  ...value.multiAgentVersion !== void 0 ? { multiAgentVersion: value.multiAgentVersion } : {}
97
92
  };
98
93
  }
99
- function readReasoningEfforts(value) {
100
- const efforts = value.map((entry) => normalizeOptionalString(entry.reasoningEffort)).filter((entry) => entry !== void 0);
101
- return uniqueStrings(efforts);
102
- }
103
94
  function normalizeMaxPages(value) {
104
95
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : 20;
105
96
  }
106
97
  //#endregion
107
- export { listCodexAppServerModels as n, readModelListResult as r, listAllCodexAppServerModels as t };
98
+ export { readModelListResult as i, listAllCodexAppServerModels as n, listCodexAppServerModels as r, DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS as t };
@@ -1,8 +1,8 @@
1
- import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
2
- import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DnMak49W.mjs";
3
- import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-DP6Rib3P.mjs";
4
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Cmx94Oiy.mjs";
5
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
1
+ import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
2
+ import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DbFCehO7.mjs";
3
+ import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-kiWRhNRE.mjs";
4
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Bdegpn2V.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
6
6
  import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
7
7
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
8
8
  //#region extensions/codex/src/app-server/native-auth.ts
@@ -1,6 +1,6 @@
1
1
  import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
2
- import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
3
2
  import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
3
+ import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
4
4
  import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
5
5
  //#region extensions/codex/src/app-server/native-execution-policy.ts
6
6
  /** Projects node execution ownership into the runtime tool factory options. */
@@ -37,29 +37,17 @@ function resolveCodexNativeExecutionPolicy(params) {
37
37
  agentId: sandboxAgentId,
38
38
  classificationAgentId: sandboxAgentId
39
39
  }).sandboxed : false);
40
- const agentExec = agentId ? resolvePolicyAgentExec({
41
- config,
42
- agentId
43
- }) : void 0;
40
+ const agentExec = agentId ? resolveAgentConfig(config, agentId)?.tools?.exec : void 0;
44
41
  const globalExec = config.tools?.exec;
45
42
  const requestedExecHost = normalizeExecTarget(params.execOverrides?.host) ?? normalizeExecTarget(sessionEntry?.execHost) ?? normalizeExecTarget(agentExec?.host) ?? normalizeExecTarget(globalExec?.host) ?? "auto";
46
- const effectiveExecHost = resolveEffectiveExecHost({
47
- requestedExecHost,
48
- sandboxAvailable
49
- });
43
+ const effectiveExecHost = requestedExecHost === "auto" ? sandboxAvailable ? "sandbox" : "gateway" : requestedExecHost;
50
44
  const node = params.execOverrides?.node ?? sessionEntry?.execNode ?? agentExec?.node ?? globalExec?.node;
51
- if (effectiveExecHost !== "node") return {
52
- nativeToolSurfaceAllowed: true,
53
- requestedExecHost,
54
- effectiveExecHost,
55
- node
56
- };
57
45
  return {
58
- nativeToolSurfaceAllowed: false,
46
+ nativeToolSurfaceAllowed: effectiveExecHost !== "node",
59
47
  requestedExecHost,
60
48
  effectiveExecHost,
61
49
  node,
62
- blockReason: "OpenClaw exec host=node is active for this session. Codex app-server native execution cannot route shell, filesystem, MCP, or app-backed work through the selected OpenClaw node."
50
+ ...effectiveExecHost === "node" ? { blockReason: "OpenClaw exec host=node is active for this session. Codex app-server native execution cannot route shell, filesystem, MCP, or app-backed work through the selected OpenClaw node." } : {}
63
51
  };
64
52
  }
65
53
  /** Formats the user-facing explanation shown when native tools are blocked by exec host=node. */
@@ -77,9 +65,6 @@ function resolvePolicyAgentId(params) {
77
65
  if (sessionAgentId) return sessionAgentId;
78
66
  return tryResolveDefaultAgentId(params.config);
79
67
  }
80
- function resolvePolicyAgentExec(params) {
81
- return resolveAgentConfig(params.config, params.agentId)?.tools?.exec;
82
- }
83
68
  function parseAgentIdFromSessionKey(sessionKey) {
84
69
  const raw = sessionKey?.trim();
85
70
  if (!raw) return;
@@ -92,15 +77,9 @@ function shouldReadRuntimeSessionEntry(params) {
92
77
  const explicitAgentId = normalizeAgentIdOrDefault(params.agentId);
93
78
  if (!explicitAgentId) return true;
94
79
  const sessionAgentId = parseAgentIdFromSessionKey(params.sessionKey);
95
- if (!sessionAgentId) return isDefaultAgentSessionKeyForAgent({
96
- config: params.config,
97
- agentId: explicitAgentId
98
- });
80
+ if (!sessionAgentId) return normalizeAgentId(explicitAgentId) === tryResolveDefaultAgentId(params.config);
99
81
  return sessionAgentId === explicitAgentId;
100
82
  }
101
- function isDefaultAgentSessionKeyForAgent(params) {
102
- return normalizeAgentId(params.agentId) === tryResolveDefaultAgentId(params.config);
103
- }
104
83
  function normalizeAgentIdOrDefault(value) {
105
84
  const normalized = normalizeAgentId(value);
106
85
  return normalized === "main" && !(value ?? "").trim() ? void 0 : normalized;
@@ -109,10 +88,6 @@ function normalizeExecTarget(value) {
109
88
  const normalized = value?.trim().toLowerCase();
110
89
  if (normalized === "auto" || normalized === "sandbox" || normalized === "gateway" || normalized === "node") return normalized;
111
90
  }
112
- function resolveEffectiveExecHost(params) {
113
- if (params.requestedExecHost === "auto") return params.sandboxAvailable ? "sandbox" : "gateway";
114
- return params.requestedExecHost;
115
- }
116
91
  function readRuntimeSessionEntryBestEffort(params) {
117
92
  try {
118
93
  return getSessionEntry({