@openclaw/codex 2026.5.24-beta.1 → 2026.5.25-beta.1

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 (26) hide show
  1. package/dist/{client-1sSy4p3z.js → client-SrtuTTVa.js} +10 -3
  2. package/dist/{client-factory-Bk6i4FnW.js → client-factory-A7DQkSLq.js} +1 -1
  3. package/dist/{command-handlers-CcTABuem.js → command-handlers-CLtPT37L.js} +10 -23
  4. package/dist/compact-acCua7zr.js +155 -0
  5. package/dist/{computer-use-Hdq1WgTA.js → computer-use-CVfE2Vfb.js} +2 -2
  6. package/dist/{config-DDMrwfJl.js → config-D6TUuyo2.js} +6 -3
  7. package/dist/{node-cli-sessions-9CAqnIaA.js → conversation-binding-B-GevkEb.js} +426 -434
  8. package/dist/{dynamic-tools-Bq717oJR.js → dynamic-tools-BXAE1U1-.js} +20 -11
  9. package/dist/harness.js +5 -5
  10. package/dist/index.js +451 -17
  11. package/dist/media-understanding-provider.js +7 -5
  12. package/dist/{models-DtGLkqMP.js → models-CC2IusQs.js} +3 -3
  13. package/dist/{notification-correlation-qKY_sgga.js → notification-correlation-D7tJW3FW.js} +26 -11
  14. package/dist/provider.js +3 -3
  15. package/dist/{request-D93E78SA.js → request-BO0z3vA8.js} +3 -3
  16. package/dist/{run-attempt-CT1N__qp.js → run-attempt-BjoI3hUJ.js} +279 -230
  17. package/dist/{session-binding-Bw_mfIW2.js → session-binding-CwNOIDP2.js} +1 -1
  18. package/dist/{shared-client-CFCUGEVs.js → shared-client-CZP1DjaN.js} +3 -4
  19. package/dist/{side-question-CYFMTA1O.js → side-question-Cb4COOQ9.js} +16 -11
  20. package/dist/test-api.js +3 -3
  21. package/dist/{thread-lifecycle-DGoaguJh.js → thread-lifecycle-CXMd9UgJ.js} +10 -12
  22. package/dist/{vision-tools-DOnxzH2y.js → vision-tools-CETeQgze.js} +16 -4
  23. package/npm-shrinkwrap.json +225 -238
  24. package/package.json +7 -7
  25. package/dist/compact-DnTgL6UT.js +0 -475
  26. package/dist/protocol-oeJQu4rs.js +0 -9
@@ -1,10 +1,12 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
- import { l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
+ import "./client-factory-A7DQkSLq.js";
3
+ import { l as resolveCodexAppServerRuntimeOptions } from "./config-D6TUuyo2.js";
3
4
  import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-_gKDcd0x.js";
4
- import { i as readModelListResult } from "./models-DtGLkqMP.js";
5
- import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
6
- import { n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DGoaguJh.js";
5
+ import { i as readModelListResult } from "./models-CC2IusQs.js";
6
+ import { l as isJsonObject } from "./client-SrtuTTVa.js";
7
+ import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-CXMd9UgJ.js";
7
8
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
9
+ import "openclaw/plugin-sdk/media-understanding";
8
10
  //#region extensions/codex/media-understanding-provider.ts
9
11
  const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
10
12
  const DEFAULT_CODEX_IMAGE_PROMPT = "Describe the image.";
@@ -63,7 +65,7 @@ async function runBoundedCodexVisionTurn(params) {
63
65
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
64
66
  const timeoutMs = Math.max(100, params.timeoutMs);
65
67
  const ownsClient = !params.options.clientFactory;
66
- const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-CFCUGEVs.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
68
+ const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-CZP1DjaN.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
67
69
  startOptions: appServer.start,
68
70
  timeoutMs,
69
71
  authProfileId: params.profile
@@ -1,5 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { s as readCodexModelListResponse } from "./protocol-validators-_gKDcd0x.js";
3
+ import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
4
  //#region extensions/codex/src/app-server/models.ts
4
5
  var models_exports = /* @__PURE__ */ __exportAll({
5
6
  listAllCodexAppServerModels: () => listAllCodexAppServerModels,
@@ -39,7 +40,7 @@ async function listAllCodexAppServerModels(options = {}) {
39
40
  async function withCodexAppServerModelClient(options, run) {
40
41
  const timeoutMs = options.timeoutMs ?? 2500;
41
42
  const useSharedClient = options.sharedClient !== false;
42
- const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-CFCUGEVs.js").then((n) => n.a);
43
+ const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-CZP1DjaN.js").then((n) => n.a);
43
44
  const client = useSharedClient ? await getSharedCodexAppServerClient({
44
45
  startOptions: options.startOptions,
45
46
  timeoutMs,
@@ -96,8 +97,7 @@ function readCodexModel(value) {
96
97
  };
97
98
  }
98
99
  function readReasoningEfforts(value) {
99
- const efforts = value.map((entry) => readNonEmptyString(entry.reasoningEffort)).filter((entry) => entry !== void 0);
100
- return [...new Set(efforts)];
100
+ return uniqueStrings(value.map((entry) => readNonEmptyString(entry.reasoningEffort)).filter((entry) => entry !== void 0));
101
101
  }
102
102
  function readNonEmptyString(value) {
103
103
  if (typeof value !== "string") return;
@@ -1,4 +1,5 @@
1
- import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
1
+ import { l as isJsonObject } from "./client-SrtuTTVa.js";
2
+ import { asFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  //#region extensions/codex/src/app-server/rate-limits.ts
3
4
  const CODEX_LIMIT_ID = "codex";
4
5
  const LIMIT_WINDOW_KEYS = ["primary", "secondary"];
@@ -10,15 +11,24 @@ function formatCodexUsageLimitErrorMessage(params) {
10
11
  const message = normalizeText(params.message);
11
12
  if (!isCodexUsageLimitError(params.codexErrorInfo, message)) return;
12
13
  const nowMs = params.nowMs ?? Date.now();
13
- const nextReset = selectNextRateLimitReset(params.rateLimits, nowMs);
14
+ const usageSummary = summarizeCodexAccountUsage(params.rateLimits, nowMs);
15
+ const nextReset = selectBlockingRateLimitReset(params.rateLimits, nowMs) ?? (usageSummary?.blocked ? void 0 : selectNextRateLimitReset(params.rateLimits, nowMs));
14
16
  const parts = ["You've reached your Codex subscription usage limit."];
15
- if (nextReset) parts.push(`Next reset ${formatResetTime(nextReset.resetsAtMs, nowMs)}.`);
16
- else {
17
+ let recoveryAction = "Wait until Codex becomes available";
18
+ if (nextReset) {
19
+ parts.push(`Next reset ${formatResetTime(nextReset.resetsAtMs, nowMs)}.`);
20
+ recoveryAction = "Wait until the reset time";
21
+ } else {
17
22
  const codexRetryHint = extractCodexRetryHint(message);
18
- if (codexRetryHint) parts.push(`Codex says to try again ${codexRetryHint}.`);
19
- else parts.push("Codex did not return a reset time for this limit.");
23
+ if (codexRetryHint) {
24
+ parts.push(`Codex says to try again ${codexRetryHint}.`);
25
+ recoveryAction = "Wait until the retry time";
26
+ } else {
27
+ if (usageSummary?.blockingPeriod && usageSummary.blockingReason) parts.push(`Your ${usageSummary.blockingReason}.`);
28
+ parts.push("OpenClaw could not determine a reset time from Codex.");
29
+ }
20
30
  }
21
- parts.push("Run /codex account for current usage details.");
31
+ parts.push(`${recoveryAction}, use another Codex account if available, or switch to another configured model/provider.`);
22
32
  return parts.join(" ");
23
33
  }
24
34
  function shouldRefreshCodexRateLimitsForUsageLimitMessage(message) {
@@ -49,8 +59,9 @@ function summarizeCodexAccountUsage(value, nowMs = Date.now()) {
49
59
  const usageSnapshot = snapshots.find(isCodexLimitSnapshot) ?? snapshots[0];
50
60
  const blockedSnapshots = snapshots.filter(snapshotHasLimitBlock);
51
61
  const blockingSnapshot = blockedSnapshots.find(isCodexLimitSnapshot) ?? blockedSnapshots[0] ?? void 0;
52
- const blockingReset = blockingSnapshot ? selectSnapshotBlockingReset(blockingSnapshot, nowMs) : void 0;
53
- const blockingPeriod = formatBlockingLimitPeriod(blockingReset?.windowDurationMins);
62
+ const blockingWindow = blockingSnapshot ? selectSnapshotBlockingWindow(blockingSnapshot, nowMs) : void 0;
63
+ const blockingReset = blockingWindow && blockingWindow.resetsAtMs > nowMs ? blockingWindow : void 0;
64
+ const blockingPeriod = formatBlockingLimitPeriod(blockingWindow?.windowDurationMins);
54
65
  const blockedUntilText = blockingReset ? formatAccountResetTime(blockingReset.resetsAtMs, nowMs) : void 0;
55
66
  const blockedResetRelative = blockingReset ? `in ${formatRelativeDuration(blockingReset.resetsAtMs - nowMs)}` : void 0;
56
67
  const blockingReason = blockingPeriod ? `${blockingPeriod} Codex usage limit is reached` : blockingSnapshot ? "Codex usage limit is reached" : void 0;
@@ -191,6 +202,11 @@ function selectSnapshotBlockingReset(snapshot, nowMs) {
191
202
  const resetSort = exhaustedWindows.length > 0 ? (left, right) => right.resetsAtMs - left.resetsAtMs : (left, right) => left.resetsAtMs - right.resetsAtMs;
192
203
  return candidates.toSorted(resetSort)[0];
193
204
  }
205
+ function selectSnapshotBlockingWindow(snapshot, nowMs) {
206
+ const resetWindow = selectSnapshotBlockingReset(snapshot, nowMs);
207
+ if (resetWindow) return resetWindow;
208
+ return readWindowEntries(snapshot).map((entry) => entry.window).filter((window) => window.usedPercent !== void 0 && window.usedPercent >= 100).toSorted((left, right) => (right.windowDurationMins ?? 0) - (left.windowDurationMins ?? 0))[0];
209
+ }
194
210
  function readWindowEntries(snapshot) {
195
211
  return LIMIT_WINDOW_KEYS.flatMap((key) => {
196
212
  const window = readRateLimitWindow(snapshot, key);
@@ -288,8 +304,7 @@ function readNullableString(record, key) {
288
304
  return readString$2(record, key) ?? void 0;
289
305
  }
290
306
  function readNumber(record, key) {
291
- const value = record[key];
292
- return typeof value === "number" && Number.isFinite(value) ? value : void 0;
307
+ return asFiniteNumber(record[key]);
293
308
  }
294
309
  function normalizeText(value) {
295
310
  const text = value?.trim();
package/dist/provider.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig } from "./provider-catalog.js";
2
- import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
+ import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-D6TUuyo2.js";
3
3
  import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
4
4
  import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
5
5
  import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
@@ -123,7 +123,7 @@ async function listModelsBestEffort(params) {
123
123
  }
124
124
  }
125
125
  async function listCodexAppServerModelsLazy(options) {
126
- const { listCodexAppServerModels } = await import("./models-DtGLkqMP.js").then((n) => n.r);
126
+ const { listCodexAppServerModels } = await import("./models-CC2IusQs.js").then((n) => n.r);
127
127
  return listCodexAppServerModels(options);
128
128
  }
129
129
  function normalizeTimeoutMs(value) {
@@ -144,7 +144,7 @@ function isKnownXHighCodexModel(modelId) {
144
144
  }
145
145
  function isModernCodexModel(modelId) {
146
146
  const lower = modelId.trim().toLowerCase();
147
- return lower === "gpt-5.5" || lower === "gpt-5.4" || lower === "gpt-5.4-mini";
147
+ return lower === "gpt-5.5" || lower === "gpt-5.4" || lower === "gpt-5.4-mini" || lower === "gpt-5.3-codex-spark";
148
148
  }
149
149
  //#endregion
150
150
  export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
@@ -1,6 +1,6 @@
1
- import { n as CodexAppServerRpcError } from "./client-1sSy4p3z.js";
2
- import { b as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-DGoaguJh.js";
3
- import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-CFCUGEVs.js";
1
+ import { n as CodexAppServerRpcError } from "./client-SrtuTTVa.js";
2
+ import { x as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-CXMd9UgJ.js";
3
+ import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-CZP1DjaN.js";
4
4
  import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-CTnEWuor.js";
5
5
  import { createHash } from "node:crypto";
6
6
  //#region extensions/codex/src/app-server/capabilities.ts