@openclaw/codex 2026.5.3 → 2026.5.4-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.
@@ -1,8 +1,9 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
- const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir) => import("./shared-client-0El8eRIE.js").then((n) => n.r).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
2
+ const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-B7LbV3PF.js").then((n) => n.r).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
3
3
  startOptions,
4
4
  authProfileId,
5
- agentDir
5
+ agentDir,
6
+ config
6
7
  }));
7
8
  function createCodexAppServerClientFactoryTestHooks(setFactory) {
8
9
  return {
@@ -1,10 +1,10 @@
1
1
  import { i as resolveCodexAppServerRuntimeOptions } from "./config-CkkoMeqF.js";
2
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-Ds7g6191.js";
2
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-B-1qT9nX.js";
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
4
  import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-BmhO5h8O.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-DjptpT9W.js";
7
- import { i as requestCodexAppServerJson, n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-amNk2zrB.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-LXwwffvV.js";
7
+ import { i as requestCodexAppServerJson, n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-DtCrnbLb.js";
8
8
  import crypto from "node:crypto";
9
9
  //#region extensions/codex/src/command-formatters.ts
10
10
  function formatCodexStatus(probes) {
@@ -120,36 +120,38 @@ function readString(record, key) {
120
120
  }
121
121
  //#endregion
122
122
  //#region extensions/codex/src/command-rpc.ts
123
- function requestOptions(pluginConfig, limit) {
123
+ function requestOptions(pluginConfig, limit, config) {
124
124
  const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
125
125
  return {
126
126
  limit,
127
127
  timeoutMs: runtime.requestTimeoutMs,
128
- startOptions: runtime.start
128
+ startOptions: runtime.start,
129
+ config
129
130
  };
130
131
  }
131
- async function codexControlRequest(pluginConfig, method, requestParams) {
132
+ async function codexControlRequest(pluginConfig, method, requestParams, options = {}) {
132
133
  const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
133
134
  return await requestCodexAppServerJson({
134
135
  method,
135
136
  requestParams,
136
137
  timeoutMs: runtime.requestTimeoutMs,
137
- startOptions: runtime.start
138
+ startOptions: runtime.start,
139
+ config: options.config
138
140
  });
139
141
  }
140
- async function safeCodexControlRequest(pluginConfig, method, requestParams) {
141
- return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams));
142
+ async function safeCodexControlRequest(pluginConfig, method, requestParams, options = {}) {
143
+ return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams, options));
142
144
  }
143
- async function safeCodexModelList(pluginConfig, limit) {
144
- return await safeValue(async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit)));
145
+ async function safeCodexModelList(pluginConfig, limit, config) {
146
+ return await safeValue(async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit, config)));
145
147
  }
146
- async function readCodexStatusProbes(pluginConfig) {
148
+ async function readCodexStatusProbes(pluginConfig, config) {
147
149
  const [models, account, limits, mcps, skills] = await Promise.all([
148
- safeCodexModelList(pluginConfig, 20),
149
- safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.account, { refreshToken: false }),
150
- safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0),
151
- safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }),
152
- safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listSkills, {})
150
+ safeCodexModelList(pluginConfig, 20, config),
151
+ safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.account, { refreshToken: false }, { config }),
152
+ safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, { config }),
153
+ safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }, { config }),
154
+ safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listSkills, {}, { config })
153
155
  ]);
154
156
  return {
155
157
  models,
@@ -217,8 +219,8 @@ async function handleCodexSubcommand(ctx, options) {
217
219
  const [subcommand = "status", ...rest] = splitArgs(ctx.args);
218
220
  const normalized = subcommand.toLowerCase();
219
221
  if (normalized === "help") return { text: buildHelp() };
220
- if (normalized === "status") return { text: formatCodexStatus(await deps.readCodexStatusProbes(options.pluginConfig)) };
221
- if (normalized === "models") return { text: formatModels(await deps.listCodexAppServerModels(deps.requestOptions(options.pluginConfig, 100))) };
222
+ if (normalized === "status") return { text: formatCodexStatus(await deps.readCodexStatusProbes(options.pluginConfig, ctx.config)) };
223
+ if (normalized === "models") return { text: formatModels(await deps.listCodexAppServerModels(deps.requestOptions(options.pluginConfig, 100, ctx.config))) };
222
224
  if (normalized === "threads") return { text: await buildThreads(deps, options.pluginConfig, rest.join(" ")) };
223
225
  if (normalized === "resume") return { text: await resumeThread(deps, ctx, options.pluginConfig, rest[0]) };
224
226
  if (normalized === "bind") return await bindConversation(deps, ctx, options.pluginConfig, rest);
@@ -1,7 +1,7 @@
1
1
  import { i as resolveCodexAppServerRuntimeOptions } from "./config-CkkoMeqF.js";
2
2
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
3
3
  import { i as readCodexAppServerBinding } from "./session-binding-DuJYTJQy.js";
4
- import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-MaOMEltT.js";
4
+ import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-ClSvDfKC.js";
5
5
  import { embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
6
6
  //#region extensions/codex/src/app-server/compact.ts
7
7
  const DEFAULT_CODEX_COMPACTION_WAIT_TIMEOUT_MS = 300 * 1e3;
@@ -65,7 +65,7 @@ async function maybeCompactCodexAppServerSession(params, options = {}) {
65
65
  }
66
66
  async function compactCodexNativeThread(params, options = {}) {
67
67
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
68
- const binding = await readCodexAppServerBinding(params.sessionFile);
68
+ const binding = await readCodexAppServerBinding(params.sessionFile, { config: params.config });
69
69
  if (!binding?.threadId) return {
70
70
  ok: false,
71
71
  compacted: false,
@@ -77,7 +77,7 @@ async function compactCodexNativeThread(params, options = {}) {
77
77
  compacted: false,
78
78
  reason: "auth profile mismatch for session binding"
79
79
  };
80
- const client = await clientFactory(appServer.start, requestedAuthProfileId ?? binding.authProfileId, params.agentDir);
80
+ const client = await clientFactory(appServer.start, requestedAuthProfileId ?? binding.authProfileId, params.agentDir, params.config);
81
81
  const waiter = createCodexNativeCompactionWaiter(client, binding.threadId);
82
82
  let completion;
83
83
  try {
@@ -1,5 +1,5 @@
1
1
  import { a as resolveCodexComputerUseConfig, i as resolveCodexAppServerRuntimeOptions } from "./config-CkkoMeqF.js";
2
- import { i as withTimeout, n as getSharedCodexAppServerClient } from "./shared-client-0El8eRIE.js";
2
+ import { i as withTimeout, n as getSharedCodexAppServerClient } from "./shared-client-B7LbV3PF.js";
3
3
  import { n as describeControlFailure } from "./capabilities-BmhO5h8O.js";
4
4
  import { existsSync } from "node:fs";
5
5
  //#region extensions/codex/src/app-server/request.ts
@@ -9,7 +9,8 @@ async function requestCodexAppServerJson(params) {
9
9
  return await (await getSharedCodexAppServerClient({
10
10
  startOptions: params.startOptions,
11
11
  timeoutMs,
12
- authProfileId: params.authProfileId
12
+ authProfileId: params.authProfileId,
13
+ config: params.config
13
14
  })).request(params.method, params.requestParams, { timeoutMs });
14
15
  })(), timeoutMs, `codex app-server ${params.method} timed out`);
15
16
  }
@@ -1,6 +1,6 @@
1
1
  import { i as resolveCodexAppServerRuntimeOptions, n as codexSandboxPolicyForTurn } from "./config-CkkoMeqF.js";
2
2
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
3
- import { n as getSharedCodexAppServerClient, s as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-0El8eRIE.js";
3
+ import { n as getSharedCodexAppServerClient, s as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-B7LbV3PF.js";
4
4
  import { t as CODEX_CONTROL_METHODS } from "./capabilities-BmhO5h8O.js";
5
5
  import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-DuJYTJQy.js";
6
6
  import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
package/dist/harness.js CHANGED
@@ -18,11 +18,11 @@ function createCodexAppServerAgentHarness(options) {
18
18
  };
19
19
  },
20
20
  runAttempt: async (params) => {
21
- const { runCodexAppServerAttempt } = await import("./run-attempt-BNbVe-IG.js");
21
+ const { runCodexAppServerAttempt } = await import("./run-attempt-DdEBxgoj.js");
22
22
  return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
23
23
  },
24
24
  compact: async (params) => {
25
- const { maybeCompactCodexAppServerSession } = await import("./compact-C0_rGlHZ.js");
25
+ const { maybeCompactCodexAppServerSession } = await import("./compact-CCKeE8zJ.js");
26
26
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
27
27
  },
28
28
  reset: async (params) => {
@@ -32,7 +32,7 @@ function createCodexAppServerAgentHarness(options) {
32
32
  }
33
33
  },
34
34
  dispose: async () => {
35
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-0El8eRIE.js").then((n) => n.r);
35
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-B7LbV3PF.js").then((n) => n.r);
36
36
  await clearSharedCodexAppServerClientAndWait();
37
37
  }
38
38
  };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
2
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
3
3
  import { buildCodexProvider } from "./provider.js";
4
- import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-DjptpT9W.js";
4
+ import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-LXwwffvV.js";
5
5
  import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
6
6
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
7
7
  import fs from "node:fs/promises";
@@ -23,7 +23,7 @@ function createCodexCommand(options) {
23
23
  };
24
24
  }
25
25
  async function handleCodexCommand(ctx, options = {}) {
26
- const { handleCodexSubcommand } = await import("./command-handlers-CeaXhO5y.js");
26
+ const { handleCodexSubcommand } = await import("./command-handlers-DsknA9lT.js");
27
27
  return await handleCodexSubcommand(ctx, options);
28
28
  }
29
29
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
2
  import { i as resolveCodexAppServerRuntimeOptions } from "./config-CkkoMeqF.js";
3
3
  import { a as readCodexErrorNotification, c as readCodexTurnCompletedNotification, n as assertCodexThreadStartResponse, r as assertCodexTurnStartResponse } from "./protocol-validators-Cpopom3_.js";
4
- import { i as readModelListResult } from "./models-Ds7g6191.js";
4
+ import { i as readModelListResult } from "./models-B-1qT9nX.js";
5
5
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
6
6
  //#region extensions/codex/media-understanding-provider.ts
7
7
  const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
@@ -37,7 +37,7 @@ async function describeCodexImages(req, options) {
37
37
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
38
38
  const timeoutMs = Math.max(100, req.timeoutMs);
39
39
  const ownsClient = !options.clientFactory;
40
- const client = options.clientFactory ? await options.clientFactory(appServer.start, req.profile) : await import("./shared-client-0El8eRIE.js").then((n) => n.r).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
40
+ const client = options.clientFactory ? await options.clientFactory(appServer.start, req.profile) : await import("./shared-client-B7LbV3PF.js").then((n) => n.r).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
41
41
  startOptions: appServer.start,
42
42
  timeoutMs,
43
43
  authProfileId: req.profile
@@ -39,17 +39,19 @@ async function listAllCodexAppServerModels(options = {}) {
39
39
  async function withCodexAppServerModelClient(options, run) {
40
40
  const timeoutMs = options.timeoutMs ?? 2500;
41
41
  const useSharedClient = options.sharedClient !== false;
42
- const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-0El8eRIE.js").then((n) => n.r);
42
+ const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-B7LbV3PF.js").then((n) => n.r);
43
43
  const client = useSharedClient ? await getSharedCodexAppServerClient({
44
44
  startOptions: options.startOptions,
45
45
  timeoutMs,
46
46
  authProfileId: options.authProfileId,
47
- agentDir: options.agentDir
47
+ agentDir: options.agentDir,
48
+ config: options.config
48
49
  }) : await createIsolatedCodexAppServerClient({
49
50
  startOptions: options.startOptions,
50
51
  timeoutMs,
51
52
  authProfileId: options.authProfileId,
52
- agentDir: options.agentDir
53
+ agentDir: options.agentDir,
54
+ config: options.config
53
55
  });
54
56
  try {
55
57
  return await run({
package/dist/provider.js CHANGED
@@ -123,7 +123,7 @@ async function listModelsBestEffort(params) {
123
123
  }
124
124
  }
125
125
  async function listCodexAppServerModelsLazy(options) {
126
- const { listCodexAppServerModels } = await import("./models-Ds7g6191.js").then((n) => n.r);
126
+ const { listCodexAppServerModels } = await import("./models-B-1qT9nX.js").then((n) => n.r);
127
127
  return listCodexAppServerModels(options);
128
128
  }
129
129
  function normalizeTimeoutMs(value) {
@@ -2,11 +2,11 @@ import { i as resolveCodexAppServerRuntimeOptions, r as readCodexPluginConfig }
2
2
  import { i as readCodexDynamicToolCallParams, r as assertCodexTurnStartResponse, s as readCodexTurn } from "./protocol-validators-Cpopom3_.js";
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
4
  import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-chGfNrq5.js";
5
- import { a as refreshCodexAppServerAuthTokens, o as resolveCodexAppServerAuthProfileId, s as resolveCodexAppServerAuthProfileIdForAgent, t as clearSharedCodexAppServerClientIfCurrent } from "./shared-client-0El8eRIE.js";
5
+ import { a as refreshCodexAppServerAuthTokens, o as resolveCodexAppServerAuthProfileId, s as resolveCodexAppServerAuthProfileIdForAgent, t as clearSharedCodexAppServerClientIfCurrent } from "./shared-client-B7LbV3PF.js";
6
6
  import { i as readCodexAppServerBinding } from "./session-binding-DuJYTJQy.js";
7
- import { a as startOrResumeThread, i as buildTurnStartParams, o as createCodexDynamicToolBridge, s as applyCodexDynamicToolProfile, t as buildDeveloperInstructions } from "./thread-lifecycle-OAlp5Pku.js";
8
- import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-MaOMEltT.js";
9
- import { t as ensureCodexComputerUse } from "./computer-use-amNk2zrB.js";
7
+ import { a as startOrResumeThread, i as buildTurnStartParams, o as createCodexDynamicToolBridge, s as applyCodexDynamicToolProfile, t as buildDeveloperInstructions } from "./thread-lifecycle-C2MSeIjn.js";
8
+ import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-ClSvDfKC.js";
9
+ import { t as ensureCodexComputerUse } from "./computer-use-DtCrnbLb.js";
10
10
  import { createHash } from "node:crypto";
11
11
  import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, bootstrapHarnessContextEngine, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, callGatewayTool, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatApprovalDisplayPath, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, isActiveHarnessContextEngine, isSubagentSessionKey, normalizeAgentRuntimeTools, normalizeUsage, registerNativeHookRelay, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveModelAuthMode, resolveOpenClawAgentDir, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
12
12
  import fs from "node:fs/promises";
@@ -1354,6 +1354,7 @@ var CodexAppServerEventProjector = class {
1354
1354
  if (!item) return;
1355
1355
  const kind = itemKind(item);
1356
1356
  if (!kind) return;
1357
+ const meta = itemMeta(item, this.toolProgressDetailMode());
1357
1358
  this.emitAgentEvent({
1358
1359
  stream: "item",
1359
1360
  data: {
@@ -1363,7 +1364,7 @@ var CodexAppServerEventProjector = class {
1363
1364
  title: itemTitle(item),
1364
1365
  status: params.phase === "start" ? "running" : itemStatus(item),
1365
1366
  ...itemName(item) ? { name: itemName(item) } : {},
1366
- ...itemMeta(item) ? { meta: itemMeta(item) } : {}
1367
+ ...meta ? { meta } : {}
1367
1368
  }
1368
1369
  });
1369
1370
  }
@@ -1374,7 +1375,7 @@ var CodexAppServerEventProjector = class {
1374
1375
  const toolName = itemName(item);
1375
1376
  if (!toolName) return;
1376
1377
  this.toolResultSummaryItemIds.add(itemId);
1377
- const meta = itemMeta(item);
1378
+ const meta = itemMeta(item, this.toolProgressDetailMode());
1378
1379
  this.emitToolResultMessage({
1379
1380
  itemId,
1380
1381
  text: formatToolSummary(toolName, meta)
@@ -1390,7 +1391,7 @@ var CodexAppServerEventProjector = class {
1390
1391
  if (!toolName || !output) return;
1391
1392
  this.emitToolResultMessage({
1392
1393
  itemId,
1393
- text: formatToolOutput(toolName, itemMeta(item), output),
1394
+ text: formatToolOutput(toolName, itemMeta(item, this.toolProgressDetailMode()), output),
1394
1395
  finalOutput: true
1395
1396
  });
1396
1397
  }
@@ -1406,13 +1407,17 @@ var CodexAppServerEventProjector = class {
1406
1407
  shouldEmitToolOutput() {
1407
1408
  return typeof this.params.shouldEmitToolOutput === "function" ? this.params.shouldEmitToolOutput() : this.params.verboseLevel === "full";
1408
1409
  }
1410
+ toolProgressDetailMode() {
1411
+ return this.params.toolProgressDetail === "raw" ? "raw" : "explain";
1412
+ }
1409
1413
  recordToolMeta(item) {
1410
1414
  if (!item) return;
1411
1415
  const toolName = itemName(item);
1412
1416
  if (!toolName) return;
1417
+ const meta = itemMeta(item, this.toolProgressDetailMode());
1413
1418
  this.toolMetas.set(item.id, {
1414
1419
  toolName,
1415
- ...itemMeta(item) ? { meta: itemMeta(item) } : {}
1420
+ ...meta ? { meta } : {}
1416
1421
  });
1417
1422
  }
1418
1423
  emitAgentEvent(event) {
@@ -1653,14 +1658,14 @@ function itemName(item) {
1653
1658
  if (item.type === "fileChange") return "apply_patch";
1654
1659
  if (item.type === "webSearch") return "web_search";
1655
1660
  }
1656
- function itemMeta(item) {
1661
+ function itemMeta(item, detailMode = "explain") {
1657
1662
  if (item.type === "commandExecution" && typeof item.command === "string") return inferToolMetaFromArgs("exec", {
1658
1663
  command: item.command,
1659
1664
  cwd: typeof item.cwd === "string" ? item.cwd : void 0
1660
- });
1665
+ }, { detailMode });
1661
1666
  if (item.type === "webSearch" && typeof item.query === "string") return item.query;
1662
1667
  const toolName = itemName(item);
1663
- if ((item.type === "dynamicToolCall" || item.type === "mcpToolCall") && toolName) return inferToolMetaFromArgs(toolName, item.arguments);
1668
+ if ((item.type === "dynamicToolCall" || item.type === "mcpToolCall") && toolName) return inferToolMetaFromArgs(toolName, item.arguments, { detailMode });
1664
1669
  }
1665
1670
  function itemOutputText(item) {
1666
1671
  if (item.type === "commandExecution") return item.aggregatedOutput?.trim() || void 0;
@@ -2408,7 +2413,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
2408
2413
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig });
2409
2414
  const resolvedWorkspace = resolveUserPath(params.workspaceDir);
2410
2415
  await fs.mkdir(resolvedWorkspace, { recursive: true });
2411
- const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
2416
+ const sandboxSessionKey = params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId;
2412
2417
  const sandbox = await resolveSandboxContext({
2413
2418
  config: params.config,
2414
2419
  sessionKey: sandboxSessionKey,
@@ -2578,7 +2583,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
2578
2583
  operation: async () => {
2579
2584
  let attemptedClient;
2580
2585
  const startupAttempt = async () => {
2581
- const startupClient = await attemptClientFactory(appServer.start, startupAuthProfileId, agentDir);
2586
+ const startupClient = await attemptClientFactory(appServer.start, startupAuthProfileId, agentDir, params.config);
2582
2587
  attemptedClient = startupClient;
2583
2588
  startupClientForCleanup = startupClient;
2584
2589
  await ensureCodexComputerUse({
@@ -3315,6 +3320,7 @@ async function buildDynamicTools(input) {
3315
3320
  senderIsOwner: params.senderIsOwner,
3316
3321
  allowGatewaySubagentBinding: params.allowGatewaySubagentBinding,
3317
3322
  sessionKey: input.sandboxSessionKey,
3323
+ runSessionKey: params.sessionKey && params.sessionKey !== input.sandboxSessionKey ? params.sessionKey : void 0,
3318
3324
  sessionId: params.sessionId,
3319
3325
  runId: params.runId,
3320
3326
  agentDir,
@@ -25,8 +25,10 @@ async function bridgeCodexAppServerStartOptions(params) {
25
25
  store,
26
26
  authProfileId: resolveCodexAppServerAuthProfileId({
27
27
  authProfileId: params.authProfileId,
28
- store
29
- })
28
+ store,
29
+ config: params.config
30
+ }),
31
+ config: params.config
30
32
  }) ? withClearedEnvironmentVariables(isolatedStartOptions, CODEX_APP_SERVER_API_KEY_ENV_VARS) : isolatedStartOptions;
31
33
  }
32
34
  function resolveCodexAppServerAuthProfileId(params) {
@@ -76,7 +78,8 @@ function withoutClearedCodexIsolationEnv(clearEnv) {
76
78
  async function applyCodexAppServerAuthProfile(params) {
77
79
  const loginParams = await resolveCodexAppServerAuthProfileLoginParams({
78
80
  agentDir: params.agentDir,
79
- authProfileId: params.authProfileId
81
+ authProfileId: params.authProfileId,
82
+ config: params.config
80
83
  });
81
84
  if (!loginParams) {
82
85
  if (params.startOptions?.transport !== "stdio") return;
@@ -109,15 +112,17 @@ async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
109
112
  const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
110
113
  const profileId = resolveCodexAppServerAuthProfileId({
111
114
  authProfileId: params.authProfileId,
112
- store
115
+ store,
116
+ config: params.config
113
117
  });
114
118
  if (!profileId) return;
115
119
  const credential = store.profiles[profileId];
116
120
  if (!credential) throw new Error(`Codex app-server auth profile "${profileId}" was not found.`);
117
- if (!isCodexAppServerAuthProvider(credential.provider)) throw new Error(`Codex app-server auth profile "${profileId}" must belong to provider "openai-codex" or a supported alias.`);
121
+ if (!isCodexAppServerAuthProvider(credential.provider, params.config)) throw new Error(`Codex app-server auth profile "${profileId}" must belong to provider "openai-codex" or a supported alias.`);
118
122
  const loginParams = await resolveLoginParamsForCredential(profileId, credential, {
119
123
  agentDir: params.agentDir,
120
- forceOAuthRefresh: params.forceOAuthRefresh === true
124
+ forceOAuthRefresh: params.forceOAuthRefresh === true,
125
+ config: params.config
121
126
  });
122
127
  if (!loginParams) throw new Error(`Codex app-server auth profile "${profileId}" does not contain usable credentials.`);
123
128
  return loginParams;
@@ -154,7 +159,8 @@ async function resolveLoginParamsForCredential(profileId, credential, params) {
154
159
  }
155
160
  const resolvedCredential = await resolveOAuthCredentialForCodexAppServer(profileId, credential, {
156
161
  agentDir: params.agentDir,
157
- forceRefresh: params.forceOAuthRefresh
162
+ forceRefresh: params.forceOAuthRefresh,
163
+ config: params.config
158
164
  });
159
165
  const accessToken = resolvedCredential.access?.trim();
160
166
  return accessToken ? buildChatgptAuthTokensParams(profileId, resolvedCredential, accessToken) : void 0;
@@ -166,7 +172,7 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
166
172
  });
167
173
  const store = ensureAuthProfileStore(ownerAgentDir, { allowKeychainPrompt: false });
168
174
  const ownerCredential = store.profiles[profileId];
169
- const credentialForOwner = ownerCredential?.type === "oauth" && isCodexAppServerAuthProvider(ownerCredential.provider) ? ownerCredential : credential;
175
+ const credentialForOwner = ownerCredential?.type === "oauth" && isCodexAppServerAuthProvider(ownerCredential.provider, params.config) ? ownerCredential : credential;
170
176
  if (params.forceRefresh) {
171
177
  store.profiles[profileId] = {
172
178
  ...credentialForOwner,
@@ -181,21 +187,21 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
181
187
  });
182
188
  const refreshed = loadAuthProfileStoreForSecretsRuntime(ownerAgentDir).profiles[profileId];
183
189
  const storedCredential = store.profiles[profileId];
184
- const candidate = refreshed?.type === "oauth" && isCodexAppServerAuthProvider(refreshed.provider) ? refreshed : storedCredential?.type === "oauth" && isCodexAppServerAuthProvider(storedCredential.provider) ? storedCredential : credential;
190
+ const candidate = refreshed?.type === "oauth" && isCodexAppServerAuthProvider(refreshed.provider, params.config) ? refreshed : storedCredential?.type === "oauth" && isCodexAppServerAuthProvider(storedCredential.provider, params.config) ? storedCredential : credential;
185
191
  return resolved?.apiKey ? {
186
192
  ...candidate,
187
193
  access: resolved.apiKey
188
194
  } : candidate;
189
195
  }
190
- function isCodexAppServerAuthProvider(provider) {
191
- return resolveProviderIdForAuth(provider) === CODEX_APP_SERVER_AUTH_PROVIDER;
196
+ function isCodexAppServerAuthProvider(provider, config) {
197
+ return resolveProviderIdForAuth(provider, { config }) === CODEX_APP_SERVER_AUTH_PROVIDER;
192
198
  }
193
199
  function shouldClearOpenAiApiKeyForCodexAuthProfile(params) {
194
200
  const profileId = params.authProfileId?.trim();
195
- return isCodexSubscriptionCredential(profileId ? params.store.profiles[profileId] : params.store.profiles[OPENAI_CODEX_DEFAULT_PROFILE_ID]);
201
+ return isCodexSubscriptionCredential(profileId ? params.store.profiles[profileId] : params.store.profiles[OPENAI_CODEX_DEFAULT_PROFILE_ID], params.config);
196
202
  }
197
- function isCodexSubscriptionCredential(credential) {
198
- if (!credential || !isCodexAppServerAuthProvider(credential.provider)) return false;
203
+ function isCodexSubscriptionCredential(credential, config) {
204
+ if (!credential || !isCodexAppServerAuthProvider(credential.provider, config)) return false;
199
205
  return credential.type === "oauth" || credential.type === "token";
200
206
  }
201
207
  function withClearedEnvironmentVariables(startOptions, envVars) {
@@ -362,13 +368,19 @@ function getSharedCodexAppServerClientState() {
362
368
  async function getSharedCodexAppServerClient(options) {
363
369
  const state = getSharedCodexAppServerClientState();
364
370
  const agentDir = options?.agentDir ?? resolveOpenClawAgentDir$1();
371
+ const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
372
+ authProfileId: options?.authProfileId,
373
+ agentDir,
374
+ config: options?.config
375
+ });
365
376
  const startOptions = await bridgeCodexAppServerStartOptions({
366
377
  startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
367
378
  agentDir,
368
- authProfileId: options?.authProfileId
379
+ authProfileId,
380
+ config: options?.config
369
381
  });
370
382
  const key = codexAppServerStartOptionsKey(startOptions, {
371
- authProfileId: options?.authProfileId,
383
+ authProfileId,
372
384
  agentDir
373
385
  });
374
386
  if (state.key && state.key !== key) clearSharedCodexAppServerClient();
@@ -382,8 +394,9 @@ async function getSharedCodexAppServerClient(options) {
382
394
  await applyCodexAppServerAuthProfile({
383
395
  client,
384
396
  agentDir,
385
- authProfileId: options?.authProfileId,
386
- startOptions
397
+ authProfileId,
398
+ startOptions,
399
+ config: options?.config
387
400
  });
388
401
  return client;
389
402
  } catch (error) {
@@ -400,10 +413,16 @@ async function getSharedCodexAppServerClient(options) {
400
413
  }
401
414
  async function createIsolatedCodexAppServerClient(options) {
402
415
  const agentDir = options?.agentDir ?? resolveOpenClawAgentDir$1();
416
+ const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
417
+ authProfileId: options?.authProfileId,
418
+ agentDir,
419
+ config: options?.config
420
+ });
403
421
  const startOptions = await bridgeCodexAppServerStartOptions({
404
422
  startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
405
423
  agentDir,
406
- authProfileId: options?.authProfileId
424
+ authProfileId,
425
+ config: options?.config
407
426
  });
408
427
  const client = CodexAppServerClient.start(startOptions);
409
428
  const initialize = client.initialize();
@@ -412,8 +431,9 @@ async function createIsolatedCodexAppServerClient(options) {
412
431
  await applyCodexAppServerAuthProfile({
413
432
  client,
414
433
  agentDir,
415
- authProfileId: options?.authProfileId,
416
- startOptions
434
+ authProfileId,
435
+ startOptions,
436
+ config: options?.config
417
437
  });
418
438
  return client;
419
439
  } catch (error) {
package/dist/test-api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as resolveCodexAppServerRuntimeOptions } from "./config-CkkoMeqF.js";
2
- import { i as buildTurnStartParams, n as buildThreadResumeParams, o as createCodexDynamicToolBridge, r as buildThreadStartParams, s as applyCodexDynamicToolProfile, t as buildDeveloperInstructions } from "./thread-lifecycle-OAlp5Pku.js";
2
+ import { i as buildTurnStartParams, n as buildThreadResumeParams, o as createCodexDynamicToolBridge, r as buildThreadStartParams, s as applyCodexDynamicToolProfile, t as buildDeveloperInstructions } from "./thread-lifecycle-C2MSeIjn.js";
3
3
  //#region extensions/codex/test-api.ts
4
4
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
5
5
  return resolveCodexAppServerRuntimeOptions({
@@ -170,7 +170,8 @@ function collectToolTelemetry(params) {
170
170
  "content"
171
171
  ]);
172
172
  if (text) params.telemetry.messagingToolSentTexts.push(text);
173
- params.telemetry.messagingToolSentMediaUrls.push(...collectMediaUrls(params.args));
173
+ const mediaUrls = collectMediaUrls(params.args);
174
+ params.telemetry.messagingToolSentMediaUrls.push(...mediaUrls);
174
175
  params.telemetry.messagingToolSentTargets.push({
175
176
  tool: params.toolName,
176
177
  provider: readFirstString(params.args, ["provider", "channel"]) ?? params.toolName,
@@ -184,7 +185,9 @@ function collectToolTelemetry(params) {
184
185
  "threadId",
185
186
  "thread_id",
186
187
  "messageThreadId"
187
- ])
188
+ ]),
189
+ ...text ? { text } : {},
190
+ ...mediaUrls.length > 0 ? { mediaUrls } : {}
188
191
  });
189
192
  }
190
193
  function isRecord(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.3",
3
+ "version": "2026.5.4-beta.1",
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.3"
30
+ "pluginApi": ">=2026.5.4-beta.1"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.3"
33
+ "openclawVersion": "2026.5.4-beta.1"
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.3"
48
+ "openclaw": ">=2026.5.4-beta.1"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {