@openclaw/codex 2026.5.10-beta.5 → 2026.5.12-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 (25) hide show
  1. package/dist/{client-factory-D2P0KD6r.js → client-factory-Bw7M3rdW.js} +1 -1
  2. package/dist/{client-CpksBQ9l.js → client-kySkmL1r.js} +1 -1
  3. package/dist/{command-handlers-iLF1EI-b.js → command-handlers-D9CzemFF.js} +7 -7
  4. package/dist/{compact-BJ1UYEyA.js → compact-DfmGNV9J.js} +3 -3
  5. package/dist/{computer-use-CVLaKaW3.js → computer-use-Br-1hHIR.js} +2 -2
  6. package/dist/{config-C7xdbzrp.js → config-0rd3LnKg.js} +1 -1
  7. package/dist/{conversation-binding-D4XZ-tvV.js → conversation-binding-Dn66MHqg.js} +4 -4
  8. package/dist/harness.js +5 -5
  9. package/dist/index.js +324 -50
  10. package/dist/media-understanding-provider.js +3 -3
  11. package/dist/{models-Bg-Qf5s-.js → models-DqfYggBz.js} +1 -1
  12. package/dist/{plugin-activation-C0soz2YD.js → plugin-activation-PXGqUjwY.js} +2 -2
  13. package/dist/plugin-app-cache-key-DjrZp49q.js +46 -0
  14. package/dist/provider.js +2 -2
  15. package/dist/{request-BCAfJvSg.js → request-DSOsuqmX.js} +3 -2
  16. package/dist/{run-attempt-DZvighJE.js → run-attempt-y4QDhBHf.js} +494 -67
  17. package/dist/{session-binding-UFKjHkKJ.js → session-binding-CDN-Pf8K.js} +1 -1
  18. package/dist/{shared-client-K13b0L1X.js → shared-client-DSSqFqHM.js} +17 -11
  19. package/dist/{side-question-Dh_g53P9.js → side-question-BcATx0hX.js} +7 -7
  20. package/dist/test-api.js +2 -2
  21. package/dist/{thread-lifecycle-i42nWiSS.js → thread-lifecycle-DW0z5zYm.js} +4 -4
  22. package/dist/{vision-tools-Bo0P6gwM.js → vision-tools-DHyuabWn.js} +21 -0
  23. package/openclaw.plugin.json +2 -2
  24. package/package.json +7 -7
  25. /package/dist/{rate-limit-cache-dvhq-4pi.js → rate-limit-cache-BFi-50LG.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
2
- import { a as normalizeCodexServiceTier } from "./config-C7xdbzrp.js";
2
+ import { a as normalizeCodexServiceTier } from "./config-0rd3LnKg.js";
3
3
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import fs from "node:fs/promises";
5
5
  import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
2
- import { n as codexAppServerStartOptionsKey, s as resolveCodexAppServerRuntimeOptions } from "./config-C7xdbzrp.js";
3
- import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-CpksBQ9l.js";
2
+ import { n as codexAppServerStartOptionsKey, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
3
+ import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-kySkmL1r.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { createHash } from "node:crypto";
6
6
  import { constants, readFileSync } from "node:fs";
@@ -22,6 +22,7 @@ const CODEX_APP_SERVER_ISOLATION_ENV_VARS = [CODEX_HOME_ENV_VAR, HOME_ENV_VAR];
22
22
  async function bridgeCodexAppServerStartOptions(params) {
23
23
  if (params.startOptions.transport !== "stdio") return params.startOptions;
24
24
  const isolatedStartOptions = await withAgentCodexHomeEnvironment(params.startOptions, params.agentDir);
25
+ if (params.authProfileId === null) return isolatedStartOptions;
25
26
  const store = ensureCodexAppServerAuthProfileStore({
26
27
  agentDir: params.agentDir,
27
28
  authProfileId: params.authProfileId,
@@ -174,6 +175,7 @@ function withoutClearedCodexIsolationEnv(clearEnv) {
174
175
  return filtered.length === clearEnv.length ? clearEnv : filtered;
175
176
  }
176
177
  async function applyCodexAppServerAuthProfile(params) {
178
+ if (params.authProfileId === null) return;
177
179
  const loginParams = await resolveCodexAppServerAuthProfileLoginParams({
178
180
  agentDir: params.agentDir,
179
181
  authProfileId: params.authProfileId,
@@ -488,20 +490,22 @@ function getSharedCodexAppServerClientState() {
488
490
  async function getSharedCodexAppServerClient(options) {
489
491
  const state = getSharedCodexAppServerClientState();
490
492
  const agentDir = options?.agentDir ?? resolveDefaultAgentDir(options?.config ?? {});
491
- const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
492
- authProfileId: options?.authProfileId,
493
+ const usesNativeAuth = options?.authProfileId === null;
494
+ const requestedAuthProfileId = options?.authProfileId === null ? void 0 : options?.authProfileId;
495
+ const authProfileId = usesNativeAuth ? void 0 : resolveCodexAppServerAuthProfileIdForAgent({
496
+ authProfileId: requestedAuthProfileId,
493
497
  agentDir,
494
498
  config: options?.config
495
499
  });
496
500
  const startOptions = await bridgeCodexAppServerStartOptions({
497
501
  startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
498
502
  agentDir,
499
- authProfileId,
503
+ authProfileId: usesNativeAuth ? null : authProfileId,
500
504
  config: options?.config
501
505
  });
502
506
  const key = codexAppServerStartOptionsKey(startOptions, {
503
507
  authProfileId,
504
- agentDir
508
+ agentDir: usesNativeAuth ? void 0 : agentDir
505
509
  });
506
510
  if (state.key && state.key !== key) clearSharedCodexAppServerClient();
507
511
  state.key = key;
@@ -514,7 +518,7 @@ async function getSharedCodexAppServerClient(options) {
514
518
  await applyCodexAppServerAuthProfile({
515
519
  client,
516
520
  agentDir,
517
- authProfileId,
521
+ authProfileId: usesNativeAuth ? null : authProfileId,
518
522
  startOptions,
519
523
  config: options?.config
520
524
  });
@@ -533,15 +537,17 @@ async function getSharedCodexAppServerClient(options) {
533
537
  }
534
538
  async function createIsolatedCodexAppServerClient(options) {
535
539
  const agentDir = options?.agentDir ?? resolveDefaultAgentDir(options?.config ?? {});
536
- const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
537
- authProfileId: options?.authProfileId,
540
+ const usesNativeAuth = options?.authProfileId === null;
541
+ const requestedAuthProfileId = options?.authProfileId === null ? void 0 : options?.authProfileId;
542
+ const authProfileId = usesNativeAuth ? void 0 : resolveCodexAppServerAuthProfileIdForAgent({
543
+ authProfileId: requestedAuthProfileId,
538
544
  agentDir,
539
545
  config: options?.config
540
546
  });
541
547
  const startOptions = await bridgeCodexAppServerStartOptions({
542
548
  startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
543
549
  agentDir,
544
- authProfileId,
550
+ authProfileId: usesNativeAuth ? null : authProfileId,
545
551
  config: options?.config
546
552
  });
547
553
  const client = CodexAppServerClient.start(startOptions);
@@ -551,7 +557,7 @@ async function createIsolatedCodexAppServerClient(options) {
551
557
  await applyCodexAppServerAuthProfile({
552
558
  client,
553
559
  agentDir,
554
- authProfileId,
560
+ authProfileId: usesNativeAuth ? null : authProfileId,
555
561
  startOptions,
556
562
  config: options?.config
557
563
  });
@@ -1,13 +1,13 @@
1
- import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-C7xdbzrp.js";
1
+ import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
2
2
  import { a as readCodexDynamicToolCallParams, i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, t as assertCodexThreadForkResponse } from "./protocol-validators-CSY0BFBo.js";
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
- import { r as isCodexAppServerApprovalRequest } from "./client-CpksBQ9l.js";
4
+ import { r as isCodexAppServerApprovalRequest } from "./client-kySkmL1r.js";
5
5
  import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-Ttwc_kgX.js";
6
- import { o as refreshCodexAppServerAuthTokens, r as getSharedCodexAppServerClient } from "./shared-client-K13b0L1X.js";
7
- import { i as readCodexAppServerBinding } from "./session-binding-UFKjHkKJ.js";
8
- import { c as resolveCodexAppServerModelProvider, h as filterCodexDynamicTools, l as resolveReasoningEffort, m as createCodexDynamicToolBridge, n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-i42nWiSS.js";
9
- import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-Bo0P6gwM.js";
10
- import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.js";
6
+ import { o as refreshCodexAppServerAuthTokens, r as getSharedCodexAppServerClient } from "./shared-client-DSSqFqHM.js";
7
+ import { i as readCodexAppServerBinding } from "./session-binding-CDN-Pf8K.js";
8
+ import { c as resolveCodexAppServerModelProvider, h as filterCodexDynamicTools, l as resolveReasoningEffort, m as createCodexDynamicToolBridge, n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DW0z5zYm.js";
9
+ import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-DHyuabWn.js";
10
+ import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-BFi-50LG.js";
11
11
  import { embeddedAgentLog, formatErrorMessage, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
12
12
  //#region extensions/codex/src/app-server/side-question.ts
13
13
  const CODEX_SIDE_DYNAMIC_TOOL_TIMEOUT_MS = 3e4;
package/dist/test-api.js CHANGED
@@ -1,5 +1,5 @@
1
- import { s as resolveCodexAppServerRuntimeOptions } from "./config-C7xdbzrp.js";
2
- import { a as buildThreadStartParams, h as filterCodexDynamicTools, i as buildThreadResumeParams, m as createCodexDynamicToolBridge, o as buildTurnStartParams, r as buildDeveloperInstructions } from "./thread-lifecycle-i42nWiSS.js";
1
+ import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
2
+ import { a as buildThreadStartParams, h as filterCodexDynamicTools, i as buildThreadResumeParams, m as createCodexDynamicToolBridge, o as buildTurnStartParams, r as buildDeveloperInstructions } from "./thread-lifecycle-DW0z5zYm.js";
3
3
  //#region extensions/codex/test-api.ts
4
4
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
5
5
  return resolveCodexAppServerRuntimeOptions({
@@ -1,11 +1,11 @@
1
- import { l as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn } from "./config-C7xdbzrp.js";
1
+ import { l as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn } from "./config-0rd3LnKg.js";
2
2
  import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-CSY0BFBo.js";
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
4
  import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, renderCodexPromptOverlay } from "./prompt-overlay.js";
5
5
  import { isModernCodexModel } from "./provider.js";
6
- import { i as isCodexAppServerConnectionClosedError } from "./client-CpksBQ9l.js";
7
- import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-UFKjHkKJ.js";
8
- import { i as defaultCodexAppInventoryCache, n as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-C0soz2YD.js";
6
+ import { i as isCodexAppServerConnectionClosedError } from "./client-kySkmL1r.js";
7
+ import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CDN-Pf8K.js";
8
+ import { a as defaultCodexAppInventoryCache, r as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-PXGqUjwY.js";
9
9
  import crypto from "node:crypto";
10
10
  import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractToolResultMediaArtifact, filterToolResultMediaUrls, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
11
11
  //#region extensions/codex/src/app-server/dynamic-tool-profile.ts
@@ -543,12 +543,16 @@ const MCP_TOOL_APPROVAL_CONNECTOR_NAME_KEY = "connector_name";
543
543
  const MCP_TOOL_APPROVAL_TOOL_TITLE_KEY = "tool_title";
544
544
  const MCP_TOOL_APPROVAL_TOOL_DESCRIPTION_KEY = "tool_description";
545
545
  const MCP_TOOL_APPROVAL_TOOL_PARAMS_DISPLAY_KEY = "tool_params_display";
546
+ const MCP_TOOL_APPROVAL_SOURCE_KEY = "source";
547
+ const MCP_TOOL_APPROVAL_CONNECTOR_SOURCE = "connector";
548
+ const CODEX_APPS_SERVER_NAME = "codex_apps";
546
549
  const PLUGIN_APP_ID_META_KEYS = [
547
550
  "app_id",
548
551
  "appId",
549
552
  "codex_app_id",
550
553
  "codexAppId"
551
554
  ];
555
+ const PLUGIN_CONNECTOR_ID_META_KEYS = ["connector_id", "connectorId"];
552
556
  const PLUGIN_NAME_META_KEYS = [
553
557
  "plugin_name",
554
558
  "pluginName",
@@ -625,6 +629,12 @@ function resolvePluginElicitation(params) {
625
629
  const context = params.pluginAppPolicyContext;
626
630
  const entries = context ? Object.values(context.apps) : [];
627
631
  const appId = readFirstString(meta, PLUGIN_APP_ID_META_KEYS) ?? readFirstString(requestParams, PLUGIN_APP_ID_META_KEYS);
632
+ const connectorId = readFirstString(meta, PLUGIN_CONNECTOR_ID_META_KEYS);
633
+ const isCodexConnectorApproval = isCodexConnectorApprovalElicitation(requestParams, meta);
634
+ if (isCodexConnectorApproval && appId && connectorId && appId !== connectorId) return {
635
+ kind: "decline",
636
+ reason: "app_id_connector_id_mismatch"
637
+ };
628
638
  if (appId) {
629
639
  if (!context) return {
630
640
  kind: "decline",
@@ -633,6 +643,14 @@ function resolvePluginElicitation(params) {
633
643
  const entry = context.apps[appId];
634
644
  return uniquePluginMatch(entry ? [entry] : [], "app_id");
635
645
  }
646
+ if (isCodexConnectorApproval && connectorId) {
647
+ if (!context) return {
648
+ kind: "decline",
649
+ reason: "missing_policy_context"
650
+ };
651
+ const entry = context.apps[connectorId];
652
+ return uniquePluginMatch(entry ? [entry] : [], "connector_id");
653
+ }
636
654
  const serverName = readString(requestParams, "serverName");
637
655
  if (serverName && context) {
638
656
  const matches = entries.filter((entry) => entry.mcpServerNames.includes(serverName));
@@ -651,6 +669,9 @@ function resolvePluginElicitation(params) {
651
669
  };
652
670
  return { kind: "not_plugin" };
653
671
  }
672
+ function isCodexConnectorApprovalElicitation(requestParams, meta) {
673
+ return readString(requestParams, "serverName") === CODEX_APPS_SERVER_NAME && readString(meta, MCP_TOOL_APPROVAL_KIND_KEY) === MCP_TOOL_APPROVAL_KIND && readString(meta, MCP_TOOL_APPROVAL_SOURCE_KEY) === MCP_TOOL_APPROVAL_CONNECTOR_SOURCE;
674
+ }
654
675
  function resolvePluginStableMetadataMatch(params) {
655
676
  const pluginName = readFirstString(params.meta, PLUGIN_NAME_META_KEYS) ?? readFirstString(params.requestParams, PLUGIN_NAME_META_KEYS);
656
677
  const configKey = readFirstString(params.meta, PLUGIN_CONFIG_KEY_META_KEYS) ?? readFirstString(params.requestParams, PLUGIN_CONFIG_KEY_META_KEYS);
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "allow_destructive_actions": {
103
103
  "type": "boolean",
104
- "default": false
104
+ "default": true
105
105
  },
106
106
  "plugins": {
107
107
  "type": "object",
@@ -272,7 +272,7 @@
272
272
  },
273
273
  "codexPlugins.allow_destructive_actions": {
274
274
  "label": "Allow Destructive Plugin Actions",
275
- "help": "Default policy for plugin app write or destructive action elicitations. Defaults to false.",
275
+ "help": "Default policy for plugin app write or destructive action elicitations. Defaults to true.",
276
276
  "advanced": true
277
277
  },
278
278
  "codexPlugins.plugins": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.10-beta.5",
3
+ "version": "2026.5.12-beta.2",
4
4
  "description": "OpenClaw Codex harness and model provider plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,9 +10,9 @@
10
10
  "dependencies": {
11
11
  "@earendil-works/pi-coding-agent": "0.74.0",
12
12
  "@openai/codex": "0.130.0",
13
- "ajv": "^8.20.0",
14
- "ws": "^8.20.0",
15
- "zod": "^4.4.3"
13
+ "ajv": "8.20.0",
14
+ "ws": "8.20.0",
15
+ "zod": "4.4.3"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@openclaw/plugin-sdk": "workspace:*"
@@ -27,10 +27,10 @@
27
27
  "minHostVersion": ">=2026.5.1-beta.1"
28
28
  },
29
29
  "compat": {
30
- "pluginApi": ">=2026.5.10-beta.5"
30
+ "pluginApi": ">=2026.5.12-beta.2"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.10-beta.5"
33
+ "openclawVersion": "2026.5.12-beta.2"
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.10-beta.5"
48
+ "openclaw": ">=2026.5.12-beta.2"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {