@openclaw/codex 2026.5.4-beta.2 → 2026.5.4

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.
@@ -3,7 +3,7 @@ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
4
  import { a as formatComputerUseStatus, c as formatThreads, d as CODEX_CONTROL_METHODS, f as describeControlFailure, i as formatCodexStatus, l as readString, n as formatAccount, o as formatList, r as formatCodexDisplayText, s as formatModels, t as buildHelp } from "./command-formatters-PiJcdUbu.js";
5
5
  import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DuJYTJQy.js";
6
- import { a as parseCodexFastModeArg, c as setCodexConversationFastMode, d as steerCodexConversationTurn, f as stopCodexConversationTurn, i as formatPermissionsMode, l as setCodexConversationModel, m as resolveCodexDefaultWorkspaceDir, o as parseCodexPermissionsModeArg, p as readCodexConversationBindingData, r as startCodexConversationThread, s as readCodexConversationActiveTurn, u as setCodexConversationPermissions } from "./conversation-binding-IhbXJcXQ.js";
6
+ import { a as parseCodexFastModeArg, c as setCodexConversationFastMode, d as steerCodexConversationTurn, f as stopCodexConversationTurn, i as formatPermissionsMode, l as setCodexConversationModel, m as resolveCodexDefaultWorkspaceDir, o as parseCodexPermissionsModeArg, p as readCodexConversationBindingData, r as startCodexConversationThread, s as readCodexConversationActiveTurn, u as setCodexConversationPermissions } from "./conversation-binding-CtHkMJfG.js";
7
7
  import { a as readCodexComputerUseStatus, i as installCodexComputerUse, n as rememberCodexRateLimits, o as requestCodexAppServerJson } from "./rate-limit-cache-t6ebYmfS.js";
8
8
  import crypto from "node:crypto";
9
9
  //#region extensions/codex/src/command-rpc.ts
@@ -424,6 +424,9 @@ async function startCodexConversationThread(params) {
424
424
  model: params.model,
425
425
  modelProvider: params.modelProvider,
426
426
  authProfileId,
427
+ approvalPolicy: params.approvalPolicy,
428
+ sandbox: params.sandbox,
429
+ serviceTier: params.serviceTier,
427
430
  config: params.config
428
431
  });
429
432
  else await createThread({
@@ -433,6 +436,9 @@ async function startCodexConversationThread(params) {
433
436
  model: params.model,
434
437
  modelProvider: params.modelProvider,
435
438
  authProfileId,
439
+ approvalPolicy: params.approvalPolicy,
440
+ sandbox: params.sandbox,
441
+ serviceTier: params.serviceTier,
436
442
  config: params.config
437
443
  });
438
444
  return createCodexConversationBindingData({
@@ -449,7 +455,7 @@ async function handleCodexConversationInboundClaim(event, ctx, options = {}) {
449
455
  try {
450
456
  return {
451
457
  handled: true,
452
- reply: (await enqueueBoundTurn(data.sessionFile, () => runBoundTurn({
458
+ reply: (await enqueueBoundTurn(data.sessionFile, () => runBoundTurnWithMissingThreadRecovery({
453
459
  data,
454
460
  prompt,
455
461
  event,
@@ -485,10 +491,10 @@ async function attachExistingThread(params) {
485
491
  threadId: params.threadId,
486
492
  ...params.model ? { model: params.model } : {},
487
493
  ...modelProvider ? { modelProvider } : {},
488
- approvalPolicy: runtime.approvalPolicy,
494
+ approvalPolicy: params.approvalPolicy ?? runtime.approvalPolicy,
489
495
  approvalsReviewer: runtime.approvalsReviewer,
490
- sandbox: runtime.sandbox,
491
- ...runtime.serviceTier ? { serviceTier: runtime.serviceTier } : {},
496
+ sandbox: params.sandbox ?? runtime.sandbox,
497
+ ...params.serviceTier ?? runtime.serviceTier ? { serviceTier: params.serviceTier ?? runtime.serviceTier } : {},
492
498
  persistExtendedHistory: true
493
499
  }, { timeoutMs: runtime.requestTimeoutMs });
494
500
  const thread = response.thread;
@@ -502,9 +508,9 @@ async function attachExistingThread(params) {
502
508
  authProfileId: params.authProfileId,
503
509
  modelProvider: response.modelProvider ?? params.modelProvider
504
510
  }),
505
- approvalPolicy: runtime.approvalPolicy,
506
- sandbox: runtime.sandbox,
507
- serviceTier: runtime.serviceTier
511
+ approvalPolicy: params.approvalPolicy ?? runtime.approvalPolicy,
512
+ sandbox: params.sandbox ?? runtime.sandbox,
513
+ serviceTier: params.serviceTier ?? runtime.serviceTier
508
514
  }, { config: params.config });
509
515
  }
510
516
  async function createThread(params) {
@@ -522,10 +528,10 @@ async function createThread(params) {
522
528
  cwd: params.workspaceDir,
523
529
  ...params.model ? { model: params.model } : {},
524
530
  ...modelProvider ? { modelProvider } : {},
525
- approvalPolicy: runtime.approvalPolicy,
531
+ approvalPolicy: params.approvalPolicy ?? runtime.approvalPolicy,
526
532
  approvalsReviewer: runtime.approvalsReviewer,
527
- sandbox: runtime.sandbox,
528
- ...runtime.serviceTier ? { serviceTier: runtime.serviceTier } : {},
533
+ sandbox: params.sandbox ?? runtime.sandbox,
534
+ ...params.serviceTier ?? runtime.serviceTier ? { serviceTier: params.serviceTier ?? runtime.serviceTier } : {},
529
535
  developerInstructions: "This Codex thread is bound to an OpenClaw conversation. Answer normally; OpenClaw will deliver your final response back to the conversation.",
530
536
  experimentalRawEvents: true,
531
537
  persistExtendedHistory: true
@@ -540,9 +546,9 @@ async function createThread(params) {
540
546
  authProfileId: params.authProfileId,
541
547
  modelProvider: response.modelProvider ?? params.modelProvider
542
548
  }),
543
- approvalPolicy: runtime.approvalPolicy,
544
- sandbox: runtime.sandbox,
545
- serviceTier: runtime.serviceTier
549
+ approvalPolicy: params.approvalPolicy ?? runtime.approvalPolicy,
550
+ sandbox: params.sandbox ?? runtime.sandbox,
551
+ serviceTier: params.serviceTier ?? runtime.serviceTier
546
552
  }, { config: params.config });
547
553
  }
548
554
  async function runBoundTurn(params) {
@@ -604,6 +610,29 @@ async function runBoundTurn(params) {
604
610
  requestCleanup();
605
611
  }
606
612
  }
613
+ async function runBoundTurnWithMissingThreadRecovery(params) {
614
+ try {
615
+ return await runBoundTurn(params);
616
+ } catch (error) {
617
+ if (!isCodexThreadNotFoundError(error)) throw error;
618
+ const binding = await readCodexAppServerBinding(params.data.sessionFile);
619
+ await startCodexConversationThread({
620
+ pluginConfig: params.pluginConfig,
621
+ sessionFile: params.data.sessionFile,
622
+ workspaceDir: binding?.cwd || params.data.workspaceDir,
623
+ model: binding?.model,
624
+ modelProvider: binding?.modelProvider,
625
+ authProfileId: binding?.authProfileId,
626
+ approvalPolicy: binding?.approvalPolicy,
627
+ sandbox: binding?.sandbox,
628
+ serviceTier: binding?.serviceTier
629
+ });
630
+ return await runBoundTurn(params);
631
+ }
632
+ }
633
+ function isCodexThreadNotFoundError(error) {
634
+ return /\bthread not found:/iu.test(formatErrorMessage(error));
635
+ }
607
636
  function enqueueBoundTurn(key, run) {
608
637
  const state = getGlobalState();
609
638
  const next = (state.queues.get(key) ?? Promise.resolve()).then(run, run);
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createCodexAppServerAgentHarness } from "./harness.js";
2
2
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
3
3
  import { buildCodexProvider } from "./provider.js";
4
4
  import { f as describeControlFailure, r as formatCodexDisplayText } from "./command-formatters-PiJcdUbu.js";
5
- import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-IhbXJcXQ.js";
5
+ import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-CtHkMJfG.js";
6
6
  import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
7
7
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
8
8
  import fs from "node:fs/promises";
@@ -24,7 +24,7 @@ function createCodexCommand(options) {
24
24
  };
25
25
  }
26
26
  async function handleCodexCommand(ctx, options = {}) {
27
- const { handleCodexSubcommand } = await import("./command-handlers-Bbr7RAUs.js");
27
+ const { handleCodexSubcommand } = await import("./command-handlers-DiH-D13x.js");
28
28
  try {
29
29
  return await handleCodexSubcommand(ctx, options);
30
30
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.4-beta.2",
3
+ "version": "2026.5.4",
4
4
  "description": "OpenClaw Codex harness and model provider plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,10 +27,10 @@
27
27
  "minHostVersion": ">=2026.5.1-beta.1"
28
28
  },
29
29
  "compat": {
30
- "pluginApi": ">=2026.5.4-beta.2"
30
+ "pluginApi": ">=2026.5.4"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.4-beta.2"
33
+ "openclawVersion": "2026.5.4"
34
34
  },
35
35
  "release": {
36
36
  "publishToClawHub": true,
@@ -45,7 +45,7 @@
45
45
  "openclaw.plugin.json"
46
46
  ],
47
47
  "peerDependencies": {
48
- "openclaw": ">=2026.5.4-beta.2"
48
+ "openclaw": ">=2026.5.4"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {