@openclaw/codex 2026.9.8 → 2026.10.1-beta.2

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 (151) hide show
  1. package/README.md +8 -0
  2. package/dist/.setup/{account-usage-runtime-G348lY1q.mjs → account-usage-runtime-DGqFpAud.mjs} +5 -5
  3. package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
  4. package/dist/.setup/{apply-Cqb-YoCS.mjs → apply-CXTudl9p.mjs} +48 -39
  5. package/dist/.setup/attempt-client-cleanup-BH0hW2xU.mjs +155 -0
  6. package/dist/.setup/{attempt-workspace-context-BJ5Z_olH.mjs → attempt-workspace-context-BY0jprWJ.mjs} +11 -15
  7. package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
  8. package/dist/.setup/{auth-cache-key-Dnps4W4_.mjs → auth-cache-key-CGm0UJOr.mjs} +244 -82
  9. package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
  10. package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
  11. package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
  12. package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
  13. package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
  14. package/dist/.setup/{bounded-turn-BNunZPtz.mjs → bounded-turn-pGsfXcmH.mjs} +14 -13
  15. package/dist/.setup/{build-state-DIQ5O_-S.mjs → build-state-CqQnsg7T.mjs} +1 -1
  16. package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
  17. package/dist/.setup/{client-qyUBJlGZ.mjs → client-C8lgBOoO.mjs} +438 -160
  18. package/dist/.setup/{client-catalog-response-DRvx_wCC.mjs → client-catalog-response-Bqp7WG51.mjs} +57 -25
  19. package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
  20. package/dist/.setup/{command-dispatch-Btrs1D6f.mjs → command-dispatch-DhBbFIQ5.mjs} +3 -3
  21. package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
  22. package/dist/.setup/{command-handlers-DvlCHJch.mjs → command-handlers-ztOOzm6O.mjs} +82 -144
  23. package/dist/.setup/{command-rpc-skzRq4wD.mjs → command-rpc-CuC5fPom.mjs} +23 -31
  24. package/dist/.setup/{compact-8ttks5U5.mjs → compact-tUb9AYfH.mjs} +117 -65
  25. package/dist/.setup/{plugin-metadata-cache-BRwtRct9.mjs → computer-use-BBN9y326.mjs} +65 -202
  26. package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
  27. package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
  28. package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
  29. package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
  30. package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
  31. package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
  32. package/dist/.setup/{conversation-binding-74LaGGH-.mjs → conversation-binding-B3MNMVzb.mjs} +36 -48
  33. package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
  34. package/dist/.setup/{conversation-control-OrN6zuaY.mjs → conversation-control-CYsMlCuE.mjs} +19 -21
  35. package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
  36. package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
  37. package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
  38. package/dist/.setup/dynamic-tool-build-C8xGEXmR.mjs +463 -0
  39. package/dist/.setup/{dynamic-tools-Db2sY5cZ.mjs → dynamic-tools-DyERJnR6.mjs} +238 -878
  40. package/dist/.setup/{effective-mcp-catalog-Bi6-SQ7i.mjs → effective-mcp-catalog-C26Mio5l.mjs} +83 -11
  41. package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
  42. package/dist/.setup/{ephemeral-turn-DiCS1ijR.mjs → ephemeral-turn-D8VcDTNo.mjs} +2 -2
  43. package/dist/.setup/{event-projector-assistant-message-MV_1dj-3.mjs → event-projector-assistant-message-BN7CNUB5.mjs} +2 -2
  44. package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
  45. package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
  46. package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
  47. package/dist/.setup/{isolated-completion-D80IXfQF.mjs → isolated-completion-C0jrcplS.mjs} +8 -8
  48. package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
  49. package/dist/.setup/mcp-app-session-preparation-BxN0_CYe.mjs +223 -0
  50. package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
  51. package/dist/.setup/{model-catalog-DiC0Tkha.mjs → model-catalog-DZyNeDKG.mjs} +7 -7
  52. package/dist/.setup/{models-DfLmPV0k.mjs → models-DSseKSMg.mjs} +10 -7
  53. package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
  54. package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
  55. package/dist/.setup/native-mcp-app-CqcPVmhH.mjs +310 -0
  56. package/dist/.setup/{native-subagent-monitor-BwkQXf9e.mjs → native-subagent-monitor-BUYOUp9X.mjs} +235 -318
  57. package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
  58. package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
  59. package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
  60. package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
  61. package/dist/.setup/{plan-DPdMk1Oy.mjs → plan-BJ37d2Og.mjs} +67 -89
  62. package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
  63. package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
  64. package/dist/.setup/plugin-approval-roundtrip-CuahdPLC.mjs +109 -0
  65. package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
  66. package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
  67. package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
  68. package/dist/.setup/plugin-thread-config-deadline-B8LGaZNW.mjs +124 -0
  69. package/dist/.setup/{provider-D6F_7p1I.mjs → provider-BnwHVD_z.mjs} +4 -4
  70. package/dist/.setup/provider-capabilities-D68Whix6.mjs +50 -0
  71. package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
  72. package/dist/.setup/{request-BZOfsSXW.mjs → request-jSbhc1sg.mjs} +189 -49
  73. package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
  74. package/dist/.setup/{run-attempt-dYJhjZrp.mjs → run-attempt-BLDZeYLD.mjs} +553 -727
  75. package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
  76. package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
  77. package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
  78. package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
  79. package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
  80. package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
  81. package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
  82. package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
  83. package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
  84. package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
  85. package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
  86. package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
  87. package/dist/.setup/{session-catalog-events-BMCFMZw-.mjs → session-catalog-events-Bdjw9HEn.mjs} +5 -5
  88. package/dist/.setup/{session-catalog-index-DwJjnF5k.mjs → session-catalog-index-DufISKJ6.mjs} +361 -72
  89. package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
  90. package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
  91. package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
  92. package/dist/.setup/{session-catalog-native-projection-CuaFZuQE.mjs → session-catalog-native-projection-D6IiLtMb.mjs} +7 -6
  93. package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
  94. package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
  95. package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
  96. package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
  97. package/dist/.setup/{session-catalog-projection-CGfzfP93.mjs → session-catalog-projection-8aHNwzWD.mjs} +6 -122
  98. package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
  99. package/dist/.setup/{session-cli-DlmBHYIe.mjs → session-cli-kH4vuGod.mjs} +1 -2
  100. package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
  101. package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
  102. package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
  103. package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
  104. package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
  105. package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
  106. package/dist/.setup/{session-retirement-LlYWBKTJ.mjs → session-retirement-Czbchv_O.mjs} +14 -15
  107. package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
  108. package/dist/.setup/{settled-turn-finalizer-DW9W3gza.mjs → settled-turn-finalizer-DjZsIwbZ.mjs} +8 -8
  109. package/dist/.setup/{shared-client-CJCTeFpQ.mjs → shared-client-qhyYWbew.mjs} +291 -272
  110. package/dist/.setup/{provider-capabilities-DG5qbsUZ.mjs → shell-dynamic-tools-D3Brj3g9.mjs} +16 -55
  111. package/dist/.setup/{side-question-BLeGj7TQ.mjs → side-question-D3NJlgbl.mjs} +99 -91
  112. package/dist/.setup/{source-CJis_1EF.mjs → source-BYu0T780.mjs} +24 -40
  113. package/dist/.setup/{thread-lifecycle-_bAbjedG.mjs → thread-lifecycle-Cbz_7ySv.mjs} +262 -305
  114. package/dist/.setup/{thread-ownership-B6pPt21M.mjs → thread-ownership-DwuSrt3s.mjs} +10 -8
  115. package/dist/.setup/{thread-policy-gNPzzpVp.mjs → thread-policy-DoNxbhqt.mjs} +22 -21
  116. package/dist/.setup/{thread-requests-OWGOiDaV.mjs → thread-requests-CL1e8Wmx.mjs} +107 -98
  117. package/dist/.setup/{thread-resume-GOry0AYh.mjs → thread-resume-BT6NHMkM.mjs} +10 -18
  118. package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
  119. package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
  120. package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
  121. package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
  122. package/dist/.setup/{attempt-client-cleanup-B-S7ngS_.mjs → turn-router-sS69wYnI.mjs} +75 -170
  123. package/dist/.setup/{upstream-session-fork-gkdRj2yH.mjs → upstream-session-fork-ChSld66u.mjs} +35 -46
  124. package/dist/.setup/{usage-CApUvLOV.mjs → usage-D8e8Xiqf.mjs} +4 -4
  125. package/dist/.setup/{usage-limit-error-wSMQkbpV.mjs → usage-limit-error-GbT-5NcW.mjs} +4 -4
  126. package/dist/.setup/{web-search-provider.runtime-UKgeiBUG.mjs → web-search-provider.runtime-dL2GD1Kl.mjs} +4 -20
  127. package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
  128. package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
  129. package/dist/api.js +34 -54
  130. package/dist/catalog-page.worker.js +1 -1
  131. package/dist/cli-metadata.js +1 -1
  132. package/dist/doctor-contract-api.js +15 -27
  133. package/dist/harness.js +37 -22
  134. package/dist/index.js +2880 -276
  135. package/dist/media-understanding-provider.js +2 -2
  136. package/dist/migration-provider-api.js +1 -1
  137. package/dist/native-session-binding-api.js +2 -0
  138. package/dist/provider-discovery.js +1 -1
  139. package/dist/session-history-worker-runtime.js +33 -4
  140. package/dist/session-history.worker.js +1 -1
  141. package/openclaw.plugin.json +3 -3
  142. package/package.json +6 -6
  143. package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
  144. package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
  145. package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
  146. package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
  147. package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
  148. package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
  149. package/dist/.setup/session-catalog-BFafIiF6.mjs +0 -2599
  150. package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
  151. package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +0 -153
@@ -1,6 +1,7 @@
1
- import { n as defineCodexBuildState } from "./build-state-DIQ5O_-S.mjs";
2
- import { u as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-kiWRhNRE.mjs";
3
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Bdegpn2V.mjs";
1
+ import { n as defineCodexBuildState } from "./build-state-CqQnsg7T.mjs";
2
+ import { u as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-C1VFoVPf.mjs";
3
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-a0HDa2Mj.mjs";
4
+ import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
5
  import { createHash } from "node:crypto";
5
6
  import fs, { constants, existsSync, watch } from "node:fs";
6
7
  import path from "node:path";
@@ -8,6 +9,7 @@ import os from "node:os";
8
9
  import fs$1 from "node:fs/promises";
9
10
  import { extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
10
11
  import { sha256File } from "openclaw/plugin-sdk/file-access-runtime";
12
+ import { sleepWithAbort } from "openclaw/plugin-sdk/retry-runtime";
11
13
  import { readSecretFile } from "openclaw/plugin-sdk/secret-file";
12
14
  //#region extensions/codex/src/app-server/desktop-generation-fingerprint.ts
13
15
  const MAX_COMPUTER_USE_PLUGIN_TREE_ENTRIES = 4096;
@@ -139,7 +141,6 @@ function createCodexDesktopGenerationOwner(params) {
139
141
  let invalidation = 0;
140
142
  let dirty = false;
141
143
  let refresh;
142
- let stopped = false;
143
144
  const markDirty = () => {
144
145
  invalidation += 1;
145
146
  dirty = true;
@@ -148,13 +149,13 @@ function createCodexDesktopGenerationOwner(params) {
148
149
  if (refresh) return refresh;
149
150
  refresh = (async () => {
150
151
  for (;;) {
151
- if (stopped) throw new Error("Codex desktop generation owner stopped");
152
+ params.signal.throwIfAborted();
152
153
  const observedInvalidation = invalidation;
153
154
  const first = await params.readFingerprint();
154
- await delay(SETTLE_DELAY_MS);
155
- if (stopped) throw new Error("Codex desktop generation owner stopped");
155
+ await sleepWithAbort(SETTLE_DELAY_MS, params.signal, { ref: false });
156
+ params.signal.throwIfAborted();
156
157
  const second = await params.readFingerprint();
157
- if (stopped) throw new Error("Codex desktop generation owner stopped");
158
+ params.signal.throwIfAborted();
158
159
  if (observedInvalidation !== invalidation || first !== second) continue;
159
160
  const previous = generation;
160
161
  generation = previous?.fingerprint === second ? previous : {
@@ -178,17 +179,12 @@ function createCodexDesktopGenerationOwner(params) {
178
179
  markDirty();
179
180
  return reconcile();
180
181
  },
181
- isCurrent: (candidate) => Boolean(candidate && !dirty && generation && candidate.epoch === generation.epoch && candidate.fingerprint === generation.fingerprint),
182
- stop: () => {
183
- stopped = true;
182
+ isCurrent: (candidate) => Boolean(candidate && !params.signal.aborted && !dirty && generation && candidate.epoch === generation.epoch && candidate.fingerprint === generation.fingerprint),
183
+ waitForIdle: async () => {
184
+ await refresh?.catch(() => {});
184
185
  }
185
186
  };
186
187
  }
187
- function delay(ms) {
188
- return new Promise((resolve) => {
189
- setTimeout(resolve, ms);
190
- });
191
- }
192
188
  //#endregion
193
189
  //#region extensions/codex/src/app-server/desktop-generation.ts
194
190
  /** Lifecycle-owned generation for managed macOS Codex desktop artifacts. */
@@ -210,6 +206,7 @@ function createCodexDesktopGenerationService(params, runtime = {
210
206
  watchPath: (watchedPath, options, listener) => watch(watchedPath, options, listener)
211
207
  }) {
212
208
  return {
209
+ apiVersion: 2,
213
210
  id: "codex-desktop-generation",
214
211
  async start(ctx) {
215
212
  if (runtime.platform !== "darwin") return;
@@ -217,6 +214,7 @@ function createCodexDesktopGenerationService(params, runtime = {
217
214
  current.context = ctx;
218
215
  current.runtime = { ...runtime };
219
216
  current.owner = createCodexDesktopGenerationOwner({
217
+ signal: ctx.scheduler.signal,
220
218
  readFingerprint: runtime.readFingerprint,
221
219
  onGenerationChange: params.onGenerationChange,
222
220
  initialGeneration: current.lastGeneration
@@ -226,46 +224,41 @@ function createCodexDesktopGenerationService(params, runtime = {
226
224
  },
227
225
  async stop() {
228
226
  const current = state();
227
+ const owner = current.owner;
228
+ const scheduler = current.context?.scheduler;
229
+ scheduler?.beginClose();
229
230
  current.lastGeneration = current.owner?.read() ?? current.lastGeneration;
230
- current.owner?.stop();
231
231
  current.owner = void 0;
232
232
  current.armEpoch = (current.armEpoch ?? 0) + 1;
233
233
  current.context = void 0;
234
234
  current.runtime = void 0;
235
235
  current.watchHealthy = void 0;
236
236
  current.rearmDelayMs = void 0;
237
- if (current.rearmTimer) {
238
- clearTimeout(current.rearmTimer);
239
- current.rearmTimer = void 0;
240
- }
237
+ current.rearmPending = false;
241
238
  closeWatchers(current);
239
+ await Promise.all([scheduler?.stop(), owner?.waitForIdle()]);
242
240
  }
243
241
  };
244
242
  }
245
243
  function armWatchers(current) {
246
244
  const owner = current.owner;
247
- if (!owner || current.watchers) return false;
245
+ const runtime = current.runtime;
246
+ if (!owner || !runtime || current.watchers) return false;
248
247
  const armEpoch = (current.armEpoch ?? 0) + 1;
249
248
  current.armEpoch = armEpoch;
250
249
  const watchers = /* @__PURE__ */ new Set();
251
250
  current.watchers = watchers;
252
251
  const candidateNames = new Set(resolveMacOSDesktopCodexAppPathCandidates("darwin").map((candidate) => candidate.appName));
253
252
  let complete = true;
254
- for (const watchedPath of current.runtime?.resolveWatchPaths() ?? []) {
255
- if (!current.runtime?.pathExists(watchedPath)) continue;
253
+ for (const watchedPath of runtime.resolveWatchPaths()) {
254
+ if (!runtime.pathExists(watchedPath)) continue;
256
255
  try {
257
- const watcher = current.runtime?.watchPath(watchedPath, { recursive: watchedPath !== APPLICATIONS_PATH }, (_eventType, filename) => {
256
+ const watcher = runtime.watchPath(watchedPath, { recursive: watchedPath !== APPLICATIONS_PATH }, (_eventType, filename) => {
258
257
  if (!isCurrentArm(current, owner, watchers, armEpoch)) return;
259
258
  if (watchedPath === APPLICATIONS_PATH && filename && !candidateNames.has(filename.toString().split(path.sep)[0] ?? "")) return;
260
259
  owner.markDirty();
261
260
  scheduleRearm(current, owner);
262
261
  });
263
- if (!watcher) {
264
- complete = false;
265
- reportWatcherFailure(current, owner, /* @__PURE__ */ new Error(`Could not watch ${watchedPath}`));
266
- scheduleRearm(current, owner);
267
- continue;
268
- }
269
262
  watchers.add(watcher);
270
263
  watcher.on("error", (error) => {
271
264
  if (!isCurrentArm(current, owner, watchers, armEpoch)) return;
@@ -290,30 +283,31 @@ function reportWatcherFailure(current, owner, error) {
290
283
  current.context?.logger.warn(`codex desktop generation watcher failed: ${String(error)}`);
291
284
  }
292
285
  function isCurrentArm(current, owner, watchers, armEpoch) {
293
- return current.owner === owner && current.watchers === watchers && current.armEpoch === armEpoch;
286
+ return current.owner === owner && !current.context?.scheduler.signal.aborted && current.watchers === watchers && current.armEpoch === armEpoch;
294
287
  }
295
288
  function scheduleRearm(current, owner) {
296
- if (current.rearmTimer) {
297
- if (current.watchHealthy === false) return;
298
- clearTimeout(current.rearmTimer);
299
- }
289
+ if (current.rearmPending && current.watchHealthy === false) return;
300
290
  const delayMs = current.watchHealthy === false ? current.rearmDelayMs ?? REARM_INITIAL_DELAY_MS : REARM_INITIAL_DELAY_MS;
301
291
  if (current.watchHealthy === false) current.rearmDelayMs = Math.min(delayMs * 2, REARM_MAX_DELAY_MS);
302
- current.rearmTimer = setTimeout(() => {
303
- current.rearmTimer = void 0;
304
- if (current.owner !== owner) return;
305
- const wasUnhealthy = current.watchHealthy === false;
306
- closeWatchers(current);
307
- if (!armWatchers(current) || wasUnhealthy) owner.markDirty();
308
- refreshGeneration(current, owner, owner.wait());
309
- }, delayMs);
310
- current.rearmTimer.unref();
292
+ current.rearmPending = true;
293
+ current.context?.scheduler.schedule({
294
+ id: "watcher-rearm",
295
+ delayMs,
296
+ run: async () => {
297
+ current.rearmPending = false;
298
+ if (current.owner !== owner || current.context?.scheduler.signal.aborted) return;
299
+ const wasUnhealthy = current.watchHealthy === false;
300
+ closeWatchers(current);
301
+ if (!armWatchers(current) || wasUnhealthy) owner.markDirty();
302
+ await refreshGeneration(current, owner, owner.wait());
303
+ }
304
+ });
311
305
  }
312
306
  function refreshGeneration(current, owner, refresh) {
313
- refresh.then(() => {
314
- if (current.owner === owner && current.watchHealthy) current.context?.serviceHealth?.clearFailure();
307
+ return refresh.then(() => {
308
+ if (current.owner === owner && !current.context?.scheduler.signal.aborted && current.watchHealthy) current.context?.serviceHealth?.clearFailure();
315
309
  }).catch((error) => {
316
- if (current.owner !== owner) return;
310
+ if (current.owner !== owner || current.context?.scheduler.signal.aborted) return;
317
311
  current.context?.serviceHealth?.reportFailure(error);
318
312
  current.context?.logger.warn(`codex desktop generation refresh failed: ${String(error)}`);
319
313
  });
@@ -324,6 +318,198 @@ function closeWatchers(current) {
324
318
  for (const watcher of watchers ?? []) watcher.close();
325
319
  }
326
320
  //#endregion
321
+ //#region extensions/codex/src/app-server/shared-client-lifecycle.ts
322
+ /** Client ownership and synchronous retirement, independent of startup/auth execution. */
323
+ function observeAcquire(options, observation) {
324
+ try {
325
+ options?.onAcquireObservation?.(observation);
326
+ } catch {}
327
+ }
328
+ function observeSharedClientAcquire(entry, options) {
329
+ const observer = (boundary) => observeAcquire(options, { boundary });
330
+ if (options?.onAcquireObservation) (entry.acquireBoundaryObservers ??= /* @__PURE__ */ new Set()).add(observer);
331
+ observeAcquire(options, {
332
+ boundary: entry.acquireBoundary ?? "entry-selection",
333
+ startup: entry.startup ? entry.acquireBoundary === "ready" ? "ready-cache-hit" : "joined-shared" : "created-shared"
334
+ });
335
+ return () => entry.acquireBoundaryObservers?.delete(observer);
336
+ }
337
+ function recordSharedClientAcquireBoundary(entry, boundary) {
338
+ entry.acquireBoundary = boundary;
339
+ for (const observer of entry.acquireBoundaryObservers ?? []) observer(boundary);
340
+ }
341
+ function getOrCreateSharedClientEntry(state, key) {
342
+ let entry = state.clients.get(key);
343
+ if (!entry) {
344
+ entry = {
345
+ key,
346
+ activeLeases: 0,
347
+ anonymousLeases: 0,
348
+ pendingAcquires: 0,
349
+ closeWhenIdle: false,
350
+ onStartedClientCallbacks: /* @__PURE__ */ new Set()
351
+ };
352
+ state.clients.set(key, entry);
353
+ }
354
+ return entry;
355
+ }
356
+ function closeSharedClientEntryIfUnclaimed(entry) {
357
+ if (entry.activeLeases > 0 || entry.pendingAcquires > 0) return false;
358
+ const state = getSharedCodexAppServerClientState();
359
+ if (state.clients.get(entry.key) !== entry) return false;
360
+ state.clients.delete(entry.key);
361
+ entry.client?.close();
362
+ return Boolean(entry.client);
363
+ }
364
+ const createCodexAppServerStartupLifetime = () => ({
365
+ controller: new AbortController(),
366
+ pending: /* @__PURE__ */ new Set()
367
+ });
368
+ function ownCodexStartup(lifetime, operation) {
369
+ lifetime.pending.add(operation);
370
+ const release = () => lifetime.pending.delete(operation);
371
+ operation.then(release, release);
372
+ return operation;
373
+ }
374
+ const getSharedCodexAppServerClientState = defineCodexBuildState("openclaw.codexAppServerClientState", () => ({
375
+ clients: /* @__PURE__ */ new Map(),
376
+ liveClients: /* @__PURE__ */ new Set(),
377
+ isolatedClients: /* @__PURE__ */ new Set(),
378
+ entriesByClient: /* @__PURE__ */ new WeakMap(),
379
+ desktopGenerationDrainChecks: /* @__PURE__ */ new Set(),
380
+ startup: createCodexAppServerStartupLifetime(),
381
+ startMetadata: /* @__PURE__ */ new WeakMap()
382
+ }));
383
+ function hasActiveSharedCodexAppServerWork() {
384
+ const state = getSharedCodexAppServerClientState();
385
+ if (state.startup.pending.size > 0 || state.startup.controller.signal.aborted) return true;
386
+ for (const entry of state.clients.values()) if (entry.activeLeases > 0 || entry.pendingAcquires > 0) return true;
387
+ for (const client of state.liveClients) {
388
+ const entry = state.entriesByClient.get(client);
389
+ if (entry && (entry.activeLeases > 0 || entry.pendingAcquires > 0)) return true;
390
+ }
391
+ return false;
392
+ }
393
+ function getCurrentSharedClientEntry(client) {
394
+ const state = getSharedCodexAppServerClientState();
395
+ const entry = client ? state.entriesByClient.get(client) : void 0;
396
+ return entry && entry.client === client && state.clients.get(entry.key) === entry ? entry : void 0;
397
+ }
398
+ /**
399
+ * Retires a matching shared client. Default is graceful: detach from the map
400
+ * (future acquisitions get a fresh client) and close once leases drain.
401
+ * `failActiveLeases` is for suspect clients only (timed-out turns): it closes
402
+ * the physical connection immediately so co-leased attempts hit the normal
403
+ * client-closed retry path, and pending acquires reject instead of leasing
404
+ * the poisoned process. Routine cleanup must NOT use it — it would abort
405
+ * healthy sibling turns on a working client.
406
+ */
407
+ function retireSharedCodexAppServerClientIfCurrent(client, opts) {
408
+ if (!client) return;
409
+ const state = getSharedCodexAppServerClientState();
410
+ const currentEntry = getCurrentSharedClientEntry(client);
411
+ const entry = currentEntry ?? state.entriesByClient.get(client);
412
+ if (!entry || entry.client !== client && !entry.closeError) return;
413
+ if (currentEntry) {
414
+ state.clients.delete(entry.key);
415
+ entry.closeWhenIdle = true;
416
+ }
417
+ if (opts?.failActiveLeases && (currentEntry || !entry.closeError)) {
418
+ entry.closeError = /* @__PURE__ */ new Error("codex app-server client is closed");
419
+ return {
420
+ activeLeases: entry.activeLeases,
421
+ closed: closeRetiredSharedClientEntry(entry)
422
+ };
423
+ }
424
+ return {
425
+ activeLeases: entry.activeLeases,
426
+ closed: currentEntry ? closeRetiredSharedClientEntryIfIdle(entry) : false
427
+ };
428
+ }
429
+ /** Gracefully retires exact clients attached to an older desktop generation. */
430
+ function retireSharedCodexAppServerClientsBeforeDesktopGeneration(generation) {
431
+ const state = getSharedCodexAppServerClientState();
432
+ for (const entry of state.clients.values()) {
433
+ const client = entry.client;
434
+ const attached = client ? state.startMetadata.get(client) : void 0;
435
+ if (client && attached?.desktopGeneration && attached.desktopGeneration.epoch < generation.epoch) retireSharedCodexAppServerClientIfCurrent(client);
436
+ }
437
+ }
438
+ function closeRetiredSharedClientEntryIfIdle(entry) {
439
+ if (!entry.closeWhenIdle || entry.activeLeases > 0 || entry.pendingAcquires > 0 || !entry.client) return false;
440
+ entry.closeWhenIdle = false;
441
+ return closeRetiredSharedClientEntry(entry);
442
+ }
443
+ function closeRetiredSharedClientEntry(entry) {
444
+ const client = entry.client;
445
+ if (!client) return false;
446
+ entry.client = void 0;
447
+ client.close();
448
+ return true;
449
+ }
450
+ function retirePendingSharedClientEntryIfUnclaimed(entry) {
451
+ if (entry.activeLeases > 0 || entry.pendingAcquires > 0) return;
452
+ entry.startupAbort?.abort(/* @__PURE__ */ new Error("Codex app-server startup was abandoned"));
453
+ entry.closeWhenIdle = true;
454
+ const state = getSharedCodexAppServerClientState();
455
+ if (state.clients.get(entry.key) === entry) state.clients.delete(entry.key);
456
+ if (!entry.client) return;
457
+ closeRetiredSharedClientEntry(entry);
458
+ }
459
+ /** Failed final claimants join physical cleanup; healthy peers keep their startup. */
460
+ async function waitForUnclaimedSharedClientStartup(entry) {
461
+ if (!entry.startupTransport || entry.activeLeases > 0 || entry.pendingAcquires > 0) return;
462
+ await entry.startupTransport.then((client) => client.closeAndWait(), () => {});
463
+ }
464
+ /** Exit registration also observes transports that have already terminated. */
465
+ function waitForCodexAppServerClientExit(client) {
466
+ const metadata = getSharedCodexAppServerClientState().startMetadata.get(client);
467
+ const exited = metadata?.transportExit ?? new Promise((resolve) => {
468
+ client.addTransportExitHandler(() => resolve());
469
+ });
470
+ if (metadata) metadata.transportExit = exited;
471
+ return exited;
472
+ }
473
+ /** Acquire the recorded owner atomically, or join its exit before a replacement writes. */
474
+ async function retainSharedCodexAppServerClientByInstanceId(clientId) {
475
+ const id = clientId?.trim();
476
+ if (!id) return;
477
+ const state = getSharedCodexAppServerClientState();
478
+ for (const client of state.liveClients) {
479
+ if (client.getInstanceId() !== id) continue;
480
+ const entry = state.entriesByClient.get(client);
481
+ if (entry?.client !== client || entry.closeError || client.getCloseError()) {
482
+ await waitForCodexAppServerClientExit(client);
483
+ return;
484
+ }
485
+ const release = retainSharedClientEntry(entry);
486
+ return {
487
+ client,
488
+ release: (waitForRetirement = false) => {
489
+ release();
490
+ return client.getCloseError() || waitForRetirement && entry.closeWhenIdle ? waitForCodexAppServerClientExit(client) : void 0;
491
+ }
492
+ };
493
+ }
494
+ }
495
+ function notifyDesktopGenerationDrainChecks(state) {
496
+ for (const check of state.desktopGenerationDrainChecks) check();
497
+ }
498
+ function retainSharedClientEntry(entry, counter = "activeLeases") {
499
+ let released = false;
500
+ entry[counter] += 1;
501
+ return () => {
502
+ if (released) return;
503
+ released = true;
504
+ releaseSharedClientEntry(entry, counter);
505
+ };
506
+ }
507
+ function releaseSharedClientEntry(entry, counter) {
508
+ entry[counter] -= 1;
509
+ closeRetiredSharedClientEntryIfIdle(entry);
510
+ notifyDesktopGenerationDrainChecks(getSharedCodexAppServerClientState());
511
+ }
512
+ //#endregion
327
513
  //#region extensions/codex/src/app-server/auth-cache-key.ts
328
514
  /** Auth cache identity and native CLI credential reads, without login or refresh. */
329
515
  const CODEX_HOME_ENV_VAR = "CODEX_HOME";
@@ -331,21 +517,11 @@ const HOME_ENV_VAR = "HOME";
331
517
  const CODEX_HOME_DIRNAME = ".codex";
332
518
  const CODEX_AUTH_JSON_FILENAME = "auth.json";
333
519
  const CODEX_APP_SERVER_API_KEY_ENV_VARS = ["CODEX_API_KEY", "OPENAI_API_KEY"];
334
- function resolveCodexAppServerEnvApiKeyCacheKey(params) {
335
- if (params.startOptions.transport !== "stdio") return;
336
- const apiKey = readFirstNonEmptyEnvEntry(resolveCodexAppServerSpawnEnv(params.startOptions, params.baseEnv ?? process.env, params.platform ?? process.platform), CODEX_APP_SERVER_API_KEY_ENV_VARS);
337
- if (!apiKey) return;
338
- const hash = createHash("sha256");
339
- hash.update("openclaw:codex:app-server-env-api-key:v1");
340
- hash.update("\0");
341
- hash.update(apiKey.key);
342
- hash.update("\0");
343
- hash.update(apiKey.value);
344
- return `${apiKey.key}:sha256:${hash.digest("hex")}`;
345
- }
346
520
  function resolveCodexAppServerFallbackApiKeyCacheKey(params) {
347
521
  if (params.startOptions.transport !== "stdio") return;
348
- return resolveCodexAppServerEnvApiKeyCacheKey(params) ?? resolveCodexCliAuthFileApiKeyCacheKey(params.baseEnv ?? process.env);
522
+ const apiKey = readFirstNonEmptyEnvEntry(resolveCodexAppServerSpawnEnv(params.startOptions, params.baseEnv ?? process.env, params.platform ?? process.platform), CODEX_APP_SERVER_API_KEY_ENV_VARS);
523
+ if (!apiKey) return resolveCodexCliAuthFileApiKeyCacheKey(params.baseEnv ?? process.env);
524
+ return fingerprintAuthCacheKey(apiKey.key, "env-api-key", apiKey.key, apiKey.value);
349
525
  }
350
526
  /** Secret-free cache identity for an API key already resolved by the runtime plan. */
351
527
  function resolveCodexAppServerPreparedApiKeyCacheKey(apiKey) {
@@ -353,25 +529,13 @@ function resolveCodexAppServerPreparedApiKeyCacheKey(apiKey) {
353
529
  return resolved ? fingerprintApiKeyAuthProfileCacheKey(resolved) : void 0;
354
530
  }
355
531
  function fingerprintApiKeyAuthProfileCacheKey(apiKey) {
356
- const hash = createHash("sha256");
357
- hash.update("openclaw:codex:app-server-auth-profile-api-key:v1");
358
- hash.update("\0");
359
- hash.update(apiKey);
360
- return `api_key:sha256:${hash.digest("hex")}`;
532
+ return fingerprintAuthCacheKey("api_key", "auth-profile-api-key", apiKey);
361
533
  }
362
534
  function fingerprintTokenAuthProfileCacheKey(accessToken) {
363
- const hash = createHash("sha256");
364
- hash.update("openclaw:codex:app-server-auth-profile-token:v1");
365
- hash.update("\0");
366
- hash.update(accessToken);
367
- return `token:sha256:${hash.digest("hex")}`;
535
+ return fingerprintAuthCacheKey("token", "auth-profile-token", accessToken);
368
536
  }
369
- function fingerprintCodexCliAuthFileApiKeyCacheKey(apiKey) {
370
- const hash = createHash("sha256");
371
- hash.update("openclaw:codex:app-server-cli-auth-json-api-key:v1");
372
- hash.update("\0");
373
- hash.update(apiKey);
374
- return `CODEX_AUTH_JSON:sha256:${hash.digest("hex")}`;
537
+ function fingerprintAuthCacheKey(prefix, domain, ...parts) {
538
+ return `${prefix}:sha256:${createHash("sha256").update(`openclaw:codex:app-server-${domain}:v1\0`).update(parts.join("\0")).digest("hex")}`;
375
539
  }
376
540
  function resolveCodexCliAuthFilePath(env) {
377
541
  const configuredCodexHome = env[CODEX_HOME_ENV_VAR]?.trim();
@@ -393,9 +557,7 @@ function parseCodexCliAuthFileApiKey(raw) {
393
557
  } catch {
394
558
  return;
395
559
  }
396
- if (!parsed || typeof parsed !== "object") return;
397
- const apiKey = parsed.OPENAI_API_KEY;
398
- return typeof apiKey === "string" && apiKey.trim() ? apiKey.trim() : void 0;
560
+ return isRecord(parsed) ? normalizeOptionalString(parsed.OPENAI_API_KEY) : void 0;
399
561
  }
400
562
  async function readCodexCliAuthFileApiKey(env) {
401
563
  try {
@@ -407,7 +569,7 @@ async function readCodexCliAuthFileApiKey(env) {
407
569
  function resolveCodexCliAuthFileApiKeyCacheKey(env) {
408
570
  try {
409
571
  const apiKey = parseCodexCliAuthFileApiKey(fs.readFileSync(resolveCodexCliAuthFilePath(env), "utf8"));
410
- return apiKey ? fingerprintCodexCliAuthFileApiKeyCacheKey(apiKey) : void 0;
572
+ return apiKey ? fingerprintAuthCacheKey("CODEX_AUTH_JSON", "cli-auth-json-api-key", apiKey) : void 0;
411
573
  } catch {
412
574
  return;
413
575
  }
@@ -425,4 +587,4 @@ function readFirstNonEmptyEnvEntry(env, keys) {
425
587
  }
426
588
  }
427
589
  //#endregion
428
- export { readCodexCliAuthFileApiKey as a, resolveCodexAppServerPreparedApiKeyCacheKey as c, waitForCodexDesktopGeneration as d, readCodexDesktopArtifactTreeFingerprint as f, fingerprintTokenAuthProfileCacheKey as i, createCodexDesktopGenerationService as l, CODEX_AUTH_JSON_FILENAME as n, readFirstNonEmptyEnv as o, fingerprintApiKeyAuthProfileCacheKey as r, resolveCodexAppServerFallbackApiKeyCacheKey as s, CODEX_APP_SERVER_API_KEY_ENV_VARS as t, isCodexDesktopGenerationCurrent as u };
590
+ export { waitForCodexDesktopGeneration as A, retirePendingSharedClientEntryIfUnclaimed as C, waitForUnclaimedSharedClientStartup as D, waitForCodexAppServerClientExit as E, createCodexDesktopGenerationService as O, retainSharedCodexAppServerClientByInstanceId as S, retireSharedCodexAppServerClientsBeforeDesktopGeneration as T, observeSharedClientAcquire as _, readCodexCliAuthFileApiKey as a, releaseSharedClientEntry as b, resolveCodexAppServerPreparedApiKeyCacheKey as c, getCurrentSharedClientEntry as d, getOrCreateSharedClientEntry as f, observeAcquire as g, notifyDesktopGenerationDrainChecks as h, fingerprintTokenAuthProfileCacheKey as i, readCodexDesktopArtifactTreeFingerprint as j, isCodexDesktopGenerationCurrent as k, closeSharedClientEntryIfUnclaimed as l, hasActiveSharedCodexAppServerWork as m, CODEX_AUTH_JSON_FILENAME as n, readFirstNonEmptyEnv as o, getSharedCodexAppServerClientState as p, fingerprintApiKeyAuthProfileCacheKey as r, resolveCodexAppServerFallbackApiKeyCacheKey as s, CODEX_APP_SERVER_API_KEY_ENV_VARS as t, createCodexAppServerStartupLifetime as u, ownCodexStartup as v, retireSharedCodexAppServerClientIfCurrent as w, retainSharedClientEntry as x, recordSharedClientAcquireBoundary as y };
@@ -1,4 +1,4 @@
1
- import { n as createCodexAuthProfileSelection } from "./auth-profile-selection-DFu9e167.mjs";
1
+ import { n as createCodexAuthProfileSelection } from "./auth-profile-selection-hr8ocLtz.mjs";
2
2
  import { embeddedAgentLog, resolveDefaultAgentDir } from "openclaw/plugin-sdk/agent-harness-registration";
3
3
  import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/provider-auth-aliases";
4
4
  import { ensureAuthProfileStore, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
@@ -10,6 +10,7 @@ const { resolveCodexAppServerAuthProfileId, resolveCodexAppServerAuthProfileIdFo
10
10
  ensureAuthProfileStore,
11
11
  resolveAuthProfileOrder
12
12
  });
13
+ /** Returns true when an auth profile uses native Codex/OpenAI app-server auth. */
13
14
  function isCodexAppServerNativeAuthProfile(lookup) {
14
15
  const authProfileId = lookup.authProfileId?.trim();
15
16
  if (!authProfileId) return false;
@@ -13,16 +13,14 @@ function createCodexAuthProfileSelection({ ensureAuthProfileStore, resolveAuthPr
13
13
  })[0]?.trim();
14
14
  }
15
15
  function resolveCodexAppServerAuthProfileIdForAgent(params) {
16
+ const agentDir = params.agentDir?.trim() || resolveDefaultAgentDir(params.config ?? {});
16
17
  const store = resolveCodexAppServerAuthProfileStore({
17
- agentDir: params.agentDir?.trim() || resolveDefaultAgentDir(params.config ?? {}),
18
- authProfileId: params.authProfileId,
19
- authProfileStore: params.authProfileStore,
20
- config: params.config
18
+ ...params,
19
+ agentDir
21
20
  });
22
21
  return resolveCodexAppServerAuthProfileId({
23
- authProfileId: params.authProfileId,
24
- store,
25
- config: params.config
22
+ ...params,
23
+ store
26
24
  });
27
25
  }
28
26
  function resolveCodexAppServerAuthProfileStore(params) {
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./session-binding-sidecars-jo6H8dFr.mjs";
1
+ import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
2
2
  import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
3
3
  import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
4
4
  //#region extensions/codex/src/app-server/binding-connection.ts
@@ -44,7 +44,7 @@ function requireCodexSupervisionModelSelection(binding) {
44
44
  }
45
45
  /** Registration publishes the resolver; connection policy loads only for an actual request. */
46
46
  async function resolveCodexBindingAppServerConnection(params) {
47
- return (await import("./binding-connection.runtime-6TpgD1M6.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
47
+ return (await import("./binding-connection.runtime-Dn2p-fdy.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
48
48
  }
49
49
  //#endregion
50
50
  export { setCodexCatalogConnectionHomeResolver as a, resolveCodexBindingAppServerConnection as i, binding_connection_exports as n, requireCodexSupervisionModelSelection as r, assertCodexSessionRuntimeOwnership as t };
@@ -1,7 +1,7 @@
1
- import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
1
+ import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
2
2
  import { n as resolveCodexAppServerLocalHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
3
- import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BL9B5H0L.mjs";
4
- import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
3
+ import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BW8rd98k.mjs";
4
+ import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
5
5
  //#region extensions/codex/src/app-server/binding-connection.runtime.ts
6
6
  /** Resolves connection and auth ownership exclusively from the private thread binding. */
7
7
  async function resolveCodexBindingAppServerConnection(params, discoverHomes) {
@@ -1,8 +1,8 @@
1
- import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
1
+ import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
2
2
  import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
3
- import { i as resolveCodexAppServerHomeScope } from "./config-options-CzyWLTJt.mjs";
4
- import "./config-DKhXquav.mjs";
5
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
3
+ import { i as resolveCodexAppServerHomeScope } from "./config-options-HG_Rr3W_.mjs";
4
+ import "./config-0Gxk3_eq.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
6
6
  //#region extensions/codex/src/app-server/bounded-turn-isolation.ts
7
7
  function resolveCodexBoundedTurnIsolation(options) {
8
8
  const pluginConfig = readCodexPluginConfig(options.pluginConfig);
@@ -1,16 +1,17 @@
1
1
  import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
2
2
  import { a as resolveCodexPrivateLauncher, i as readCodexAppServerConfigOptions } from "./launch-args-DbFCehO7.mjs";
3
- import { d as readCodexEffectiveConfig } from "./config-options-CzyWLTJt.mjs";
4
- import "./config-DKhXquav.mjs";
5
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
6
- import { u as isCodexAppServerStartSelectionChangedError } from "./shared-client-CJCTeFpQ.mjs";
7
- import { S as assertCodexTurnStartResponse, T as readCodexErrorNotification, k as createCodexElicitationResponse, x as assertCodexThreadStartResponse } from "./client-qyUBJlGZ.mjs";
8
- import { o as closeCodexStartupClientBestEffort, s as interruptCodexTurnAndWaitBestEffort, t as CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS } from "./attempt-client-cleanup-B-S7ngS_.mjs";
9
- import { t as CodexEphemeralTurn } from "./ephemeral-turn-DiCS1ijR.mjs";
10
- import { i as readModelListResult } from "./models-DfLmPV0k.mjs";
11
- import { R as attestCodexRestrictedToolSurfaceMcpServersDisabled, St as mergeCodexThreadConfigs, l as readCodexInheritedMcpServerNames, n as buildCodexRingZeroThreadConfigPatch, r as buildCodexRuntimeThreadConfig, t as assertCodexManagedRequirementsDoNotOverrideToolPolicy } from "./thread-requests-OWGOiDaV.mjs";
12
- import { S as resolveCodexAppServerReasoningEffort } from "./thread-lifecycle-_bAbjedG.mjs";
13
- import { a as resolveCodexPromptError } from "./usage-limit-error-wSMQkbpV.mjs";
3
+ import { d as readCodexEffectiveConfig } from "./config-options-HG_Rr3W_.mjs";
4
+ import { a as codexPrewriteRejectionCause } from "./rpc-error-hmWM21RB.mjs";
5
+ import "./config-0Gxk3_eq.mjs";
6
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
7
+ import { u as isCodexAppServerStartSelectionChangedError } from "./shared-client-qhyYWbew.mjs";
8
+ import { _ as assertCodexTurnStartResponse, b as readCodexErrorNotification, g as assertCodexThreadStartResponse, w as createCodexElicitationResponse } from "./client-C8lgBOoO.mjs";
9
+ import { o as closeCodexStartupClientBestEffort, s as interruptCodexTurnAndWaitBestEffort, t as CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS } from "./attempt-client-cleanup-BH0hW2xU.mjs";
10
+ import { t as CodexEphemeralTurn } from "./ephemeral-turn-D8VcDTNo.mjs";
11
+ import { i as readModelListResult } from "./models-DSseKSMg.mjs";
12
+ import { Ct as mergeCodexThreadConfigs, n as buildCodexRingZeroThreadConfigPatch, r as buildCodexRuntimeThreadConfig, t as assertCodexManagedRequirementsDoNotOverrideToolPolicy, u as readCodexInheritedMcpServerNames, z as attestCodexRestrictedToolSurfaceMcpServersDisabled } from "./thread-requests-CL1e8Wmx.mjs";
13
+ import { b as resolveCodexAppServerReasoningEffort } from "./thread-lifecycle-Cbz_7ySv.mjs";
14
+ import { a as resolveCodexPromptError } from "./usage-limit-error-GbT-5NcW.mjs";
14
15
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
15
16
  import { parse } from "smol-toml";
16
17
  import path from "node:path";
@@ -144,7 +145,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
144
145
  assertCurrent: params.assertCurrent,
145
146
  ...params.signal ? { abandonSignal: params.signal } : {}
146
147
  };
147
- const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-CJCTeFpQ.mjs").then((n) => n.v).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
148
+ const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-qhyYWbew.mjs").then((n) => n.v).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
148
149
  ...clientOptions,
149
150
  authProfileStore: params.authProfileStore
150
151
  }));
@@ -271,7 +272,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
271
272
  }
272
273
  } catch (error) {
273
274
  if (abortController.signal.aborted) throw resolveCodexBoundedTurnAbortError(abortController.signal, params.taskLabel, timeoutError);
274
- if (!ownsClient || !isCodexAppServerStartSelectionChangedError(error) || selectionAttempt !== 0) throw error;
275
+ if (!ownsClient || !isCodexAppServerStartSelectionChangedError(error) || selectionAttempt !== 0) throw codexPrewriteRejectionCause(error);
275
276
  } finally {
276
277
  clearTimeout(timeout);
277
278
  params.signal?.removeEventListener("abort", abortFromCaller);
@@ -1,5 +1,5 @@
1
1
  //#region extensions/codex/package.json
2
- var version = "2026.9.8";
2
+ var version = "2026.10.1-beta.2";
3
3
  //#endregion
4
4
  //#region extensions/codex/src/build-state.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { n as CodexAppServerRpcError } from "./rpc-error-BlD2vuzn.mjs";
1
+ import { r as CodexAppServerRpcError } from "./rpc-error-hmWM21RB.mjs";
2
2
  //#region extensions/codex/src/app-server/capabilities.ts
3
3
  const CODEX_CONTROL_METHODS = {
4
4
  account: "account/read",