@openclaw/codex 2026.7.2-beta.4 → 2026.7.2-beta.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 (40) hide show
  1. package/dist/{app-server-policy-BO3jYBkv.js → app-server-policy-BSaO2JIT.js} +1 -1
  2. package/dist/{attempt-notifications-DdmnBMUp.js → attempt-notifications-AP-a-Q5k.js} +1 -1
  3. package/dist/{bounded-turn-CaQL96kg.js → bounded-turn-D2ZAgZVz.js} +54 -24
  4. package/dist/{capabilities-CLICvTxf.js → capabilities-BFDTVYr4.js} +1 -1
  5. package/dist/cli-metadata.js +1 -1
  6. package/dist/{command-formatters-DgADqnHa.js → command-formatters-C336eRVS.js} +2 -2
  7. package/dist/{command-handlers-l_lVPNlB.js → command-handlers-DAHUSry9.js} +1233 -1222
  8. package/dist/{compact-CC5KhBzX.js → compact-D_uvHurS.js} +8 -8
  9. package/dist/{computer-use-Ip1-QGa-.js → computer-use-CYEc8U3w.js} +123 -115
  10. package/dist/{conversation-control-sNPsbTCP.js → conversation-control-xsIeXbo4.js} +6 -6
  11. package/dist/doctor-contract-api.js +24 -86
  12. package/dist/{dynamic-tools-CQI3UwqY.js → dynamic-tools-D2gYkSBO.js} +482 -91
  13. package/dist/effective-mcp-catalog-Bbd98Inw.js +114 -0
  14. package/dist/{event-projector-usage-D6tE7_qD.js → event-projector-usage-Xp4AlR2k.js} +20 -3
  15. package/dist/harness.js +19 -14
  16. package/dist/index.js +292 -328
  17. package/dist/media-understanding-provider.js +6 -1
  18. package/dist/{models-BNeMlHgg.js → models-BBMKU4jA.js} +2 -2
  19. package/dist/{notification-correlation-BGLixv5_.js → notification-correlation-CU6_AnOb.js} +3 -3
  20. package/dist/{plugin-app-cache-key-CvzvmBRz.js → plugin-app-cache-key-DztPafOA.js} +135 -42
  21. package/dist/{rate-limits-D0IJT-a6.js → rate-limits-CU-gVCCS.js} +1 -1
  22. package/dist/{request-BTccUTD3.js → request-qKh331yu.js} +3 -3
  23. package/dist/{run-attempt--858NXDl.js → run-attempt-CY9WlDLc.js} +1060 -402
  24. package/dist/{runtime-artifact-C2ITXdhM.js → runtime-artifact-CmtG_t1L.js} +90 -24
  25. package/dist/{sandbox-guard-D1Wky__S.js → sandbox-guard-NuhpXmPB.js} +4 -0
  26. package/dist/{session-binding-ZSMX1omP.js → session-binding-BXpo9ymA.js} +1006 -891
  27. package/dist/{session-catalog-DsKaezgR.js → session-catalog-DyOgR4WH.js} +289 -56
  28. package/dist/{session-cli-CYJTfRLG.js → session-cli-2PZaFLRh.js} +2 -2
  29. package/dist/{session-upstream-marker-D7XlI9us.js → session-upstream-marker-B6U7tLw5.js} +1 -1
  30. package/dist/{settled-turn-finalizer-DHltNgtF.js → settled-turn-finalizer-CXY2Z9dT.js} +19 -6
  31. package/dist/{shared-client-wmgNFNYp.js → shared-client-DTbvH-XV.js} +1993 -1720
  32. package/dist/{side-question-BfFZCsJ-.js → side-question-_ulBk1AL.js} +12 -10
  33. package/dist/{thread-lifecycle-cqrOlJkq.js → thread-lifecycle-DF53ogiA.js} +980 -346
  34. package/dist/{transcript-mirror-2p7kl6e4.js → transcript-mirror-DzsdNCf5.js} +80 -41
  35. package/dist/{upstream-session-fork-vPjwkT1i.js → upstream-session-fork-Dy4Xvuoj.js} +3 -3
  36. package/dist/{usage-DM_I3mPT.js → usage-CQ6GhD5-.js} +3 -3
  37. package/dist/{web-search-provider.runtime-Bx6HAc_k.js → web-search-provider.runtime-CCFhg2z5.js} +3 -3
  38. package/package.json +6 -8
  39. package/npm-shrinkwrap.json +0 -202
  40. package/dist/{auth-binding-C1czuHPA.js → auth-binding-B4FfbcCg.js} +1 -1
@@ -1,4 +1,4 @@
1
- import { m as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-ZSMX1omP.js";
1
+ import { C as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-BXpo9ymA.js";
2
2
  //#region extensions/codex/src/app-server/app-server-policy.ts
3
3
  /**
4
4
  * Policy promotion for Codex app-server runs that can safely use OpenClaw tool
@@ -1,4 +1,4 @@
1
- import { Q as isJsonObject } from "./shared-client-wmgNFNYp.js";
1
+ import { W as isJsonObject } from "./shared-client-DTbvH-XV.js";
2
2
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
3
3
  //#region extensions/codex/src/app-server/attempt-notifications.ts
4
4
  /**
@@ -1,10 +1,10 @@
1
- import { Q as isJsonObject, o as isCodexAppServerStartSelectionChangedError } from "./shared-client-wmgNFNYp.js";
2
- import { _ as readCodexNotificationItem, h as isRetryableErrorNotification } from "./attempt-notifications-DdmnBMUp.js";
3
- import { x as resolveCodexAppServerRuntimeOptions } from "./session-binding-ZSMX1omP.js";
4
- import { Q as mergeCodexThreadConfigs, d as buildCodexRingZeroThreadConfigPatch, f as buildCodexRuntimeThreadConfig, l as assertCodexRingZeroHasNoManagedHooks, p as readCodexInheritedMcpServerNames, u as attestCodexRingZeroThreadHasNoMcpServers } from "./thread-lifecycle-cqrOlJkq.js";
5
- import { t as normalizeCodexResponseTokenUsage } from "./event-projector-usage-D6tE7_qD.js";
6
- import { C as readCodexTurnCompletedNotification, _ as assertCodexThreadStartResponse, b as readCodexErrorNotification, v as assertCodexTurnStartResponse } from "./transcript-mirror-2p7kl6e4.js";
7
- import { r as readModelListResult } from "./models-BNeMlHgg.js";
1
+ import { W as isJsonObject, s as isCodexAppServerStartSelectionChangedError } from "./shared-client-DTbvH-XV.js";
2
+ import { g as resolveCodexAppServerRuntimeOptions } from "./session-binding-BXpo9ymA.js";
3
+ import { G as mergeCodexThreadConfigs, d as attestCodexRingZeroThreadHasNoMcpServers, f as buildCodexRingZeroThreadConfigPatch, m as readCodexInheritedMcpServerNames, mt as interruptCodexTurnAndWaitBestEffort, p as buildCodexRuntimeThreadConfig, u as assertCodexRingZeroHasNoManagedHooks, ut as CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS } from "./thread-lifecycle-DF53ogiA.js";
4
+ import { _ as readCodexNotificationItem, h as isRetryableErrorNotification } from "./attempt-notifications-AP-a-Q5k.js";
5
+ import { n as normalizeCodexResponseTokenUsage } from "./event-projector-usage-Xp4AlR2k.js";
6
+ import { C as readCodexTurnCompletedNotification, _ as assertCodexThreadStartResponse, b as readCodexErrorNotification, v as assertCodexTurnStartResponse } from "./transcript-mirror-DzsdNCf5.js";
7
+ import { r as readModelListResult } from "./models-BBMKU4jA.js";
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
@@ -32,6 +32,13 @@ const CODEX_SETTLED_FINALIZER_THREAD_CONFIG = {
32
32
  "skills.include_instructions": false,
33
33
  include_environment_context: false
34
34
  };
35
+ var CodexBoundedTurnTimeoutError = class extends Error {
36
+ constructor(taskLabel, timeoutMs) {
37
+ const bound = timeoutMs % 1e3 === 0 ? `${timeoutMs / 1e3}s` : `${timeoutMs}ms`;
38
+ super(`codex app-server ${taskLabel} turn timed out after ${bound}`);
39
+ this.name = "TimeoutError";
40
+ }
41
+ };
35
42
  async function runBoundedCodexAppServerTurn(params) {
36
43
  const appServer = resolveCodexAppServerRuntimeOptions({
37
44
  pluginConfig: params.options.pluginConfig,
@@ -54,9 +61,10 @@ async function runBoundedCodexAppServerTurn(params) {
54
61
  }
55
62
  async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, workspace, selectionAttempt = 0, timing) {
56
63
  const totalTimeoutMs = timing?.timeoutMs ?? resolveTimerTimeoutMs(params.timeoutMs, 100, 100);
64
+ const timeoutError = new CodexBoundedTurnTimeoutError(params.taskLabel, totalTimeoutMs);
57
65
  const deadline = timing?.deadline ?? Date.now() + totalTimeoutMs;
58
66
  const timeoutMs = deadline - Date.now();
59
- if (timeoutMs <= 0) throw new Error(`${params.taskLabel} timed out`);
67
+ if (timeoutMs <= 0) throw timeoutError;
60
68
  const agentDir = params.agentDir?.trim() || void 0;
61
69
  const startOptions = workspace.codexHome ? buildPrivateCodexAppServerStartOptions(appServer.start, workspace.codexHome) : appServer.start;
62
70
  const ownsClient = !params.options.clientFactory;
@@ -65,22 +73,39 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
65
73
  authProfileId: params.profile,
66
74
  agentDir,
67
75
  config: params.config,
68
- timeoutMs
69
- }) : await import("./shared-client-wmgNFNYp.js").then((n) => n.f).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
76
+ timeoutMs,
77
+ ...params.signal ? { abandonSignal: params.signal } : {}
78
+ }) : await import("./shared-client-DTbvH-XV.js").then((n) => n.m).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
70
79
  startOptions,
71
80
  timeoutMs,
72
81
  authProfileId: params.profile,
73
82
  agentDir,
74
83
  authProfileStore: params.authProfileStore,
75
- config: params.config
84
+ config: params.config,
85
+ ...params.signal ? { abandonSignal: params.signal } : {}
76
86
  }));
77
87
  const abortController = new AbortController();
78
- const abortFromCaller = () => abortController.abort(params.signal?.reason ?? "aborted");
88
+ let activeThreadId;
89
+ let activeTurnId = "";
90
+ let interruptPromise;
91
+ const requestInterrupt = () => {
92
+ if (!activeThreadId || interruptPromise) return;
93
+ interruptPromise = interruptCodexTurnAndWaitBestEffort(client, {
94
+ threadId: activeThreadId,
95
+ turnId: activeTurnId,
96
+ timeoutMs: CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS
97
+ });
98
+ };
99
+ const abortRun = (reason) => {
100
+ abortController.abort(reason);
101
+ requestInterrupt();
102
+ };
103
+ const abortFromCaller = () => abortRun(params.signal?.reason ?? "aborted");
79
104
  if (params.signal?.aborted) abortFromCaller();
80
105
  else params.signal?.addEventListener("abort", abortFromCaller, { once: true });
81
106
  const remainingRunMs = deadline - Date.now();
82
- if (remainingRunMs <= 0) abortController.abort("timeout");
83
- const timeout = setTimeout(() => abortController.abort("timeout"), Math.max(1, remainingRunMs));
107
+ if (remainingRunMs <= 0) abortRun(timeoutError);
108
+ const timeout = setTimeout(() => abortRun(timeoutError), Math.max(1, remainingRunMs));
84
109
  timeout.unref?.();
85
110
  let retrySelection = false;
86
111
  try {
@@ -111,6 +136,8 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
111
136
  timeoutMs,
112
137
  signal: abortController.signal
113
138
  }));
139
+ activeThreadId = thread.thread.id;
140
+ if (abortController.signal.aborted) requestInterrupt();
114
141
  if (params.requireNoExternalCapabilities) await attestCodexRingZeroThreadHasNoMcpServers(client, thread.thread.id, abortController.signal);
115
142
  if (params.historyItems?.length) await client.request("thread/inject_items", {
116
143
  threadId: thread.thread.id,
@@ -134,10 +161,12 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
134
161
  timeoutMs,
135
162
  signal: abortController.signal
136
163
  }));
164
+ activeTurnId = turn.turn.id;
165
+ if (abortController.signal.aborted) requestInterrupt();
137
166
  return {
138
167
  ...await collector.collect(turn.turn, {
139
- timeoutMs,
140
- signal: abortController.signal
168
+ signal: abortController.signal,
169
+ timeoutError
141
170
  }),
142
171
  model
143
172
  };
@@ -146,11 +175,13 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
146
175
  cleanup();
147
176
  }
148
177
  } catch (error) {
178
+ if (abortController.signal.aborted) throw resolveCodexBoundedTurnAbortError(abortController.signal, params.taskLabel, timeoutError);
149
179
  if (ownsClient && isCodexAppServerStartSelectionChangedError(error) && selectionAttempt === 0) retrySelection = true;
150
180
  else throw error;
151
181
  } finally {
152
182
  clearTimeout(timeout);
153
183
  params.signal?.removeEventListener("abort", abortFromCaller);
184
+ await interruptPromise;
154
185
  if (ownsClient) client.close();
155
186
  }
156
187
  if (retrySelection) return await runBoundedCodexAppServerTurnInWorkspace(params, appServer, workspace, selectionAttempt + 1, {
@@ -284,9 +315,9 @@ function createCodexBoundedTurnCollector(threadId, taskLabel) {
284
315
  for (const notification of pending.splice(0)) handleNotification(notification);
285
316
  if (!completedTurn && !promptError) await waitForTurnCompletion({
286
317
  completion,
287
- timeoutMs: options.timeoutMs,
288
318
  signal: options.signal,
289
- taskLabel
319
+ taskLabel,
320
+ timeoutError: options.timeoutError
290
321
  });
291
322
  if (promptError) throw new Error(promptError);
292
323
  if (completedTurn?.status === "failed") throw new Error(completedTurn.error?.message ?? `codex app-server ${taskLabel} turn failed`);
@@ -310,22 +341,21 @@ function collectCompletedItems(turnItems, notificationItems) {
310
341
  return [...items.values()];
311
342
  }
312
343
  async function waitForTurnCompletion(params) {
313
- if (params.signal.aborted) throw new Error(`codex app-server ${params.taskLabel} turn aborted`);
314
- let timeout;
344
+ if (params.signal.aborted) throw resolveCodexBoundedTurnAbortError(params.signal, params.taskLabel, params.timeoutError);
315
345
  let cleanupAbort;
316
346
  try {
317
347
  await Promise.race([params.completion, new Promise((_, reject) => {
318
- timeout = setTimeout(() => reject(/* @__PURE__ */ new Error(`codex app-server ${params.taskLabel} turn timed out`)), params.timeoutMs);
319
- timeout.unref?.();
320
- const abortListener = () => reject(/* @__PURE__ */ new Error(`codex app-server ${params.taskLabel} turn aborted`));
348
+ const abortListener = () => reject(resolveCodexBoundedTurnAbortError(params.signal, params.taskLabel, params.timeoutError));
321
349
  params.signal.addEventListener("abort", abortListener, { once: true });
322
350
  cleanupAbort = () => params.signal.removeEventListener("abort", abortListener);
323
351
  })]);
324
352
  } finally {
325
- if (timeout) clearTimeout(timeout);
326
353
  cleanupAbort?.();
327
354
  }
328
355
  }
356
+ function resolveCodexBoundedTurnAbortError(signal, taskLabel, timeoutError) {
357
+ return signal.reason === timeoutError ? timeoutError : /* @__PURE__ */ new Error(`codex app-server ${taskLabel} turn aborted`);
358
+ }
329
359
  function collectAssistantTextFromItems(items) {
330
360
  return (items ?? []).filter((item) => item.type === "agentMessage").map((item) => item.text.trim()).filter(Boolean).join("\n\n").trim();
331
361
  }
@@ -1,4 +1,4 @@
1
- import { R as CodexAppServerRpcError } from "./shared-client-wmgNFNYp.js";
1
+ import { v as CodexAppServerRpcError } from "./shared-client-DTbvH-XV.js";
2
2
  //#region extensions/codex/src/app-server/capabilities.ts
3
3
  /**
4
4
  * Capability helpers for optional Codex app-server control-plane methods.
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
2
  //#region extensions/codex/cli-metadata.ts
3
3
  function registerCodexCliMetadata(api) {
4
4
  api.registerCli(async ({ program }) => {
5
- const { registerCodexSessionCli } = await import("./session-cli-CYJTfRLG.js");
5
+ const { registerCodexSessionCli } = await import("./session-cli-2PZaFLRh.js");
6
6
  registerCodexSessionCli(program);
7
7
  }, { descriptors: [{
8
8
  name: "codex",
@@ -1,5 +1,5 @@
1
- import { Q as isJsonObject } from "./shared-client-wmgNFNYp.js";
2
- import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-D0IJT-a6.js";
1
+ import { W as isJsonObject } from "./shared-client-DTbvH-XV.js";
2
+ import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-CU-gVCCS.js";
3
3
  //#region extensions/codex/src/command-formatters.ts
4
4
  /** Formats the combined `/codex status` probe result. */
5
5
  function formatCodexStatus(probes) {