@openclaw/codex 2026.8.1 → 2026.8.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 (54) hide show
  1. package/dist/api.js +2 -2
  2. package/dist/{attempt-client-cleanup-CVPvp9dL.js → attempt-client-cleanup-CpVfwctT.js} +1 -1
  3. package/dist/{binding-connection-CCQFs8lf.js → binding-connection-CF7BmrDk.js} +2 -2
  4. package/dist/{bounded-turn-rq5tiSXk.js → bounded-turn-DRC3hcjm.js} +10 -9
  5. package/dist/{capabilities-CGm_94eL.js → capabilities-D6m_TdVy.js} +1 -1
  6. package/dist/cli-metadata.js +1 -1
  7. package/dist/{command-formatters-C54Yg3eA.js → command-formatters--UToCokS.js} +4 -3
  8. package/dist/{command-handlers-BvOAHTrA.js → command-handlers-CLFx2Ypa.js} +41 -33
  9. package/dist/{compact-Hd7SAc0N.js → compact-5xqW1oCh.js} +13 -11
  10. package/dist/{config-Cxw3Cl3k.js → config-CcYL77O6.js} +6 -4
  11. package/dist/{conversation-binding-data-CW2GuupV.js → conversation-binding-data-BiodpIzq.js} +2 -1
  12. package/dist/doctor-contract-api.js +8 -4
  13. package/dist/{dynamic-tools-BFoUcRdx.js → dynamic-tools-BmeXjwNZ.js} +103 -106
  14. package/dist/{effective-mcp-catalog-BTJHnDSx.js → effective-mcp-catalog-XXQKgK1U.js} +2 -2
  15. package/dist/{event-projector-usage-D3PHFFXh.js → event-projector-usage-B2r5vhWH.js} +7 -12
  16. package/dist/{harness-DVfUQBlQ.js → harness-BgeB7LnD.js} +13 -13
  17. package/dist/harness.js +1 -1
  18. package/dist/index.js +56 -37
  19. package/dist/{isolated-completion-Cbbx_5Ed.js → isolated-completion-CxTus3vZ.js} +3 -3
  20. package/dist/media-understanding-provider.js +1 -1
  21. package/dist/{model-catalog-o6Cgjoss.js → model-catalog-DULBcniB.js} +5 -5
  22. package/dist/{models-DgFWSuxA.js → models-DaWfETQk.js} +4 -3
  23. package/dist/{native-subagent-monitor-CwFyoylz.js → native-subagent-monitor-vXYUZH37.js} +24 -104
  24. package/dist/{node-exec-server.runtime-DXrqpw1c.js → node-exec-server.runtime-DirKVZ5h.js} +2 -2
  25. package/dist/{plugin-approval-roundtrip-D80UZiJ_.js → plugin-approval-roundtrip-CCWQGlAI.js} +2 -1
  26. package/dist/{plugin-marketplace-discovery-mdmScYOj.js → plugin-marketplace-discovery-BXjIFEiw.js} +14 -13
  27. package/dist/{plugin-metadata-cache-CulOABwu.js → plugin-metadata-cache-DQQm4gWT.js} +5 -5
  28. package/dist/{rate-limits-hFtzt2Up.js → rate-limits-BqHEHXQJ.js} +3 -2
  29. package/dist/{request-CCm4LaED.js → request-BWxweEdK.js} +2 -2
  30. package/dist/{run-attempt-BwNQDH2u.js → run-attempt-BVLE4Gbi.js} +133 -182
  31. package/dist/{runtime-artifact-DeBvleJw.js → runtime-artifact-D9pYp4zL.js} +3 -3
  32. package/dist/{session-binding-q2WSTVmC.js → session-binding-D0zinCP1.js} +1 -1
  33. package/dist/{session-catalog-C2Tae4rI.js → session-catalog-eMhVm0Ql.js} +232 -204
  34. package/dist/{session-catalog-home-id-DAKUrm3C.js → session-catalog-home-id-Dt2GiG5o.js} +3 -3
  35. package/dist/{session-cli-BuDjm5Ou.js → session-cli-B2lyjJA0.js} +1 -1
  36. package/dist/session-history-C5J1AKzG.js +87 -0
  37. package/dist/{session-permission-policy-gLm40Vtq.js → session-permission-policy-ScnAyG90.js} +1 -1
  38. package/dist/{session-retirement-CdkI0bvb.js → session-retirement-CtUtUTr9.js} +4 -4
  39. package/dist/{session-upstream-marker-Bcy33kam.js → session-upstream-marker-gqrYIRHk.js} +1 -1
  40. package/dist/settled-turn-context-Bk3IUwod.js +290 -0
  41. package/dist/settled-turn-finalizer-BXLN9PfJ.js +104 -0
  42. package/dist/{shared-client-kNkljY-R.js → shared-client-B1tT5U6r.js} +33 -35
  43. package/dist/{side-question-GwD73tX6.js → side-question-CZ-mCw-t.js} +18 -15
  44. package/dist/{thread-lifecycle-Ss-uwnC4.js → thread-lifecycle-CGGKP720.js} +206 -163
  45. package/dist/{thread-ownership-CeYBqg_4.js → thread-ownership-RkaoZCmQ.js} +2 -2
  46. package/dist/{thread-resume-DF54hagX.js → thread-resume-BFt1-ZDa.js} +7 -6
  47. package/dist/{transcript-mirror-CkEQIna-.js → transcript-mirror-1ep4XjzF.js} +14 -7
  48. package/dist/{transport-stdio-C7-s9TLG.js → transport-stdio-NT_Dpd9V.js} +40 -24
  49. package/dist/{upstream-prompt-provenance-CFmsKwr9.js → upstream-prompt-provenance-LphB8slG.js} +8 -4
  50. package/dist/{upstream-session-fork-BACGlOFa.js → upstream-session-fork-Dc8BFExw.js} +13 -19
  51. package/dist/{usage-C2l8Mils.js → usage-DUhd58gI.js} +3 -3
  52. package/dist/{web-search-provider.runtime-B2XgRdFv.js → web-search-provider.runtime-BEmlE7ov.js} +3 -3
  53. package/package.json +5 -5
  54. package/dist/settled-turn-finalizer-B8JJcxCi.js +0 -329
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { F as resolveCodexAppServerLocalHomeDir, I as resolveCodexAppServerUserHomeDir, L as withEphemeralCodexAuthStore, P as resolveCodexAppServerHomeDir, a as resolveCodexAppServerStartOptionsForAgent, i as resolveCodexAppServerRuntimeOptions, o as resolveCodexComputerUseConfig, t as codexAppServerStartOptionsKey } from "./config-Cxw3Cl3k.js";
2
+ import { F as resolveCodexAppServerLocalHomeDir, I as resolveCodexAppServerUserHomeDir, L as withEphemeralCodexAuthStore, P as resolveCodexAppServerHomeDir, a as resolveCodexAppServerStartOptionsForAgent, i as resolveCodexAppServerRuntimeOptions, o as resolveCodexComputerUseConfig, t as codexAppServerStartOptionsKey } from "./config-CcYL77O6.js";
3
3
  import { a as CODEX_APP_SERVER_VERSION, c as resolveMacOSDesktopCodexAppPathCandidates, l as resolveMacOSDesktopCodexBundledMarketplaceCandidates, n as resolveManagedCodexAppServerStartOptions, o as MIN_SUPPORTED_CODEX_APP_SERVER_VERSION, r as resolveManagedCodexNativeCommand, s as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand, u as resolveMacOSDesktopCodexComputerUseServiceAppCandidates } from "./managed-binary-ZkGodW19.js";
4
- import { o as isCodexAppServerNativeAuthProfile } from "./session-binding-q2WSTVmC.js";
5
- import { a as hasCodexAppServerNaturalExit, i as closeCodexAppServerTransportAndWait, n as resolveCodexAppServerSpawnEnv, r as closeCodexAppServerTransport, t as createStdioTransport } from "./transport-stdio-C7-s9TLG.js";
4
+ import { o as isCodexAppServerNativeAuthProfile } from "./session-binding-D0zinCP1.js";
5
+ import { a as hasCodexAppServerNaturalExit, i as closeCodexAppServerTransportAndWait, n as resolveCodexAppServerSpawnEnv, r as closeCodexAppServerTransport, t as createStdioTransport } from "./transport-stdio-NT_Dpd9V.js";
6
6
  import { l as readCodexDynamicToolCallParams } from "./protocol-validators-Bg5rpNxk.js";
7
7
  import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import fs from "node:fs/promises";
@@ -1215,21 +1215,15 @@ async function applyCodexAppServerAuthProfile(params) {
1215
1215
  await assertNativeCodexAccountMatchesRoute(params.client, params.authRequirement);
1216
1216
  return;
1217
1217
  }
1218
- let loginParams;
1219
- try {
1220
- loginParams = params.preparedAuth?.kind === "profile" ? params.preparedAuth.snapshot.loginParams : params.preparedAuth?.kind === "api-key" ? {
1221
- type: "apiKey",
1222
- apiKey: params.preparedAuth.apiKey
1223
- } : await resolveCodexAppServerAuthProfileLoginParams({
1224
- agentDir: params.agentDir,
1225
- authProfileId: params.authProfileId ?? void 0,
1226
- authProfileStore: params.authProfileStore,
1227
- config: params.config
1228
- });
1229
- } catch (error) {
1230
- if (params.authRequirement === "subscription" && error instanceof CodexAppServerAuthProfileUnavailableError) throw createCodexAppServerAuthError("Codex subscription auth profile could not produce login credentials. Sign in with `openclaw models auth login --provider openai`, select that profile, then retry.", error);
1231
- throw error;
1232
- }
1218
+ const loginParams = params.preparedAuth?.kind === "profile" ? params.preparedAuth.snapshot.loginParams : params.preparedAuth?.kind === "api-key" ? {
1219
+ type: "apiKey",
1220
+ apiKey: params.preparedAuth.apiKey
1221
+ } : await resolveCodexAppServerAuthProfileLoginParams({
1222
+ agentDir: params.agentDir,
1223
+ authProfileId: params.authProfileId ?? void 0,
1224
+ authProfileStore: params.authProfileStore,
1225
+ config: params.config
1226
+ });
1233
1227
  if (params.authRequirement === "subscription" && loginParams?.type !== "chatgptAuthTokens") throw createCodexAppServerAuthError("Codex subscription auth profile could not produce login credentials. Sign in with `openclaw models auth login --provider openai`, select that profile, then retry.");
1234
1228
  if (!loginParams) {
1235
1229
  if (params.authRequirement !== "api-key" || params.startOptions?.transport !== "stdio") return;
@@ -1269,6 +1263,7 @@ var CodexAppServerAuthProfileUnavailableError = class extends Error {
1269
1263
  constructor(..._args) {
1270
1264
  super(..._args);
1271
1265
  this.status = 401;
1266
+ this.code = "selected_auth_profile_unavailable";
1272
1267
  }
1273
1268
  };
1274
1269
  async function resolveCodexAppServerAuthProfileLoginParams(params) {
@@ -1325,8 +1320,8 @@ async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
1325
1320
  });
1326
1321
  if (!profileId) return;
1327
1322
  const credential = store.profiles[profileId];
1328
- if (!credential) throw new Error(`Codex app-server auth profile "${profileId}" was not found. Select an existing OpenAI profile or sign in again with OpenClaw, then retry.`);
1329
- if (!isCodexAppServerAuthProfileCredential(credential)) throw new Error(`Codex app-server auth profile "${profileId}" must use the canonical OpenAI auth provider; run "openclaw doctor --fix" to migrate legacy provider IDs.`);
1323
+ if (!credential) throw new CodexAppServerAuthProfileUnavailableError(`Codex app-server auth profile "${profileId}" was not found. Select an existing OpenAI profile or sign in again with OpenClaw, then retry.`);
1324
+ if (!isCodexAppServerAuthProfileCredential(credential)) throw new CodexAppServerAuthProfileUnavailableError(`Codex app-server auth profile "${profileId}" must use the canonical OpenAI auth provider; run "openclaw doctor --fix" to migrate legacy provider IDs.`);
1330
1325
  const loginParams = await resolveLoginParamsForCredential(profileId, credential, {
1331
1326
  agentDir: params.agentDir,
1332
1327
  store,
@@ -1573,7 +1568,7 @@ function resolveExplicitChatgptAccountId(credential) {
1573
1568
  }
1574
1569
  //#endregion
1575
1570
  //#region extensions/codex/src/app-server/rate-limit-cache.ts
1576
- const DEFAULT_CODEX_RATE_LIMIT_CACHE_MAX_AGE_MS = 10 * 6e4;
1571
+ const DEFAULT_CODEX_RATE_LIMIT_CACHE_MAX_AGE_MS = 6e5;
1577
1572
  const SPARSE_ACCOUNT_METADATA_KEYS = [
1578
1573
  "credits",
1579
1574
  "individualLimit",
@@ -1705,7 +1700,7 @@ async function withAbortableTimeout(params) {
1705
1700
  //#region extensions/codex/src/app-server/client-runtime.ts
1706
1701
  /** Client-scoped Codex auth and account observers. */
1707
1702
  /** Match Codex's native grace window without retaining inactive conversations indefinitely. */
1708
- const CODEX_APP_SERVER_LIVE_THREAD_IDLE_TIMEOUT_MS = 30 * 6e4;
1703
+ const CODEX_APP_SERVER_LIVE_THREAD_IDLE_TIMEOUT_MS = 18e5;
1709
1704
  /** Native-child parents are active ownership, so only otherwise-idle threads count against this cap. */
1710
1705
  const CODEX_APP_SERVER_LIVE_THREAD_MAX_IDLE = 64;
1711
1706
  /** Return a deterministic error before Codex cancels its ten-second external-auth request. */
@@ -2178,7 +2173,7 @@ function normalizeLogField(value) {
2178
2173
  if (typeof value !== "string") return;
2179
2174
  const normalized = value.replaceAll(String.fromCharCode(27), " ").replaceAll("\r", " ").replaceAll("\n", " ").replaceAll(" ", " ").trim();
2180
2175
  if (!normalized) return;
2181
- return normalized.length > LOG_FIELD_MAX_LENGTH ? `${truncateUtf16Safe(normalized, LOG_FIELD_MAX_LENGTH - 3)}...` : normalized;
2176
+ return normalized.length > LOG_FIELD_MAX_LENGTH ? `${truncateUtf16Safe(normalized, 157)}...` : normalized;
2182
2177
  }
2183
2178
  function readNumericTimeoutMs(value) {
2184
2179
  if (typeof value === "number" && Number.isFinite(value)) return Math.max(0, Math.floor(value));
@@ -2692,7 +2687,7 @@ function websocketFrameToText(data) {
2692
2687
  * routing, notification fanout, server request handlers, and version checks.
2693
2688
  */
2694
2689
  const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
2695
- const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 8 * 1024 * 1024;
2690
+ const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 8388608;
2696
2691
  const CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES = 1e3;
2697
2692
  const CODEX_APP_SERVER_STDERR_TAIL_MAX = 2e3;
2698
2693
  const CODEX_APP_SERVER_OVERLOADED_ERROR_CODE = -32001;
@@ -3424,12 +3419,12 @@ const CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS = 100;
3424
3419
  const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 6e4;
3425
3420
  /** Short guard after apparent assistant completion. */
3426
3421
  const CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 1e4;
3427
- const CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 5 * 6e4;
3422
+ const CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 3e5;
3428
3423
  /** Guard after reasoning/commentary progress when no tool handoff occurred. */
3429
- const CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS = 5 * 6e4;
3424
+ const CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS = 3e5;
3430
3425
  /** Long terminal idle watch for app-server turns that never send completion. */
3431
- const CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS = 30 * 6e4;
3432
- const TURN_TERMINAL_SETTLEMENT_IDLE_TIMEOUT_MS = 2 * 6e4;
3426
+ const CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS = 18e5;
3427
+ const TURN_TERMINAL_SETTLEMENT_IDLE_TIMEOUT_MS = 12e4;
3433
3428
  const TURN_FINALIZE_DRAIN_ABORT_GRACE_MS = 5e3;
3434
3429
  var CodexAppServerStartupError = class extends Error {
3435
3430
  constructor(reason, message = reason === "timed_out" ? "codex app-server startup timed out" : "codex app-server startup aborted") {
@@ -3443,7 +3438,8 @@ function isCodexAppServerStartupError(error, reason) {
3443
3438
  return error instanceof Error && "code" in error && error.code === "CODEX_APP_SERVER_STARTUP_CANCELLED" && "reason" in error && (error.reason === "aborted" || error.reason === "timed_out") && (reason === void 0 || error.reason === reason);
3444
3439
  }
3445
3440
  function resolvePositiveIntegerTimeoutMs(value, fallbackMs) {
3446
- return resolveTimerTimeoutMs(value, resolveTimerTimeoutMs(fallbackMs, 1));
3441
+ const fallback = resolveTimerTimeoutMs(fallbackMs, 1);
3442
+ return resolveTimerTimeoutMs(value, fallback);
3447
3443
  }
3448
3444
  /** Runs startup work with abort and timeout handling plus optional cleanup. */
3449
3445
  async function withCodexStartupTimeout(params) {
@@ -3509,7 +3505,8 @@ function resolveCodexTurnTerminalIdleTimeoutMs(value, runTimeoutOverrideMs) {
3509
3505
  /** Adds gateway grace time to a caller timeout without overflowing invalid values. */
3510
3506
  function resolveCodexGatewayTimeoutWithGraceMs(timeoutMs, graceMs = 1e4) {
3511
3507
  const timeout = resolvePositiveIntegerTimeoutMs(timeoutMs, 1);
3512
- return addTimerTimeoutGraceMs(timeout, resolveTimerTimeoutMs(graceMs, 0, 0)) ?? timeout;
3508
+ const grace = resolveTimerTimeoutMs(graceMs, 0, 0);
3509
+ return addTimerTimeoutGraceMs(timeout, grace) ?? timeout;
3513
3510
  }
3514
3511
  //#endregion
3515
3512
  //#region extensions/codex/src/app-server/desktop-generation-fingerprint.ts
@@ -4101,6 +4098,10 @@ async function resolveCodexAppServerClientStartContext(options) {
4101
4098
  store: authProfileStore,
4102
4099
  snapshot: preparedAuthProfileSnapshot
4103
4100
  } : void 0;
4101
+ const agentStartOptions = resolveCodexAppServerStartOptionsForAgent({
4102
+ startOptions: requestedStartOptions,
4103
+ agentDir
4104
+ });
4104
4105
  return {
4105
4106
  agentDir,
4106
4107
  usesNativeAuth,
@@ -4110,10 +4111,7 @@ async function resolveCodexAppServerClientStartContext(options) {
4110
4111
  preparedAuth: resolvedPreparedAuth,
4111
4112
  authRequirement,
4112
4113
  startOptions: await bridgeCodexAppServerStartOptions({
4113
- startOptions: await resolveManagedCodexAppServerStartOptions(resolveCodexAppServerStartOptionsForAgent({
4114
- startOptions: requestedStartOptions,
4115
- agentDir
4116
- })),
4114
+ startOptions: await resolveManagedCodexAppServerStartOptions(agentStartOptions),
4117
4115
  agentId: options?.agentId,
4118
4116
  agentDir,
4119
4117
  authProfileId: usesNativeAuth || preparedAuth?.kind === "api-key" ? null : authProfileId,
@@ -4448,7 +4446,7 @@ async function startInitializedCodexAppServerClient(params) {
4448
4446
  } finally {
4449
4447
  artifactDrain?.cancel();
4450
4448
  }
4451
- const runtimeArtifactModule = params.runtimeArtifactMode ? await import("./runtime-artifact-DeBvleJw.js") : void 0;
4449
+ const runtimeArtifactModule = params.runtimeArtifactMode ? await import("./runtime-artifact-D9pYp4zL.js") : void 0;
4452
4450
  const nativeCommandBeforeStart = startOptions.commandSource === "resolved-managed" ? resolveManagedCodexNativeCommand(startOptions.command) : void 0;
4453
4451
  const runtimeArtifactBeforeStart = runtimeArtifactModule ? await runtimeArtifactModule.captureCodexAppServerRuntimeArtifactBeforeStart({
4454
4452
  startOptions,
@@ -1,14 +1,14 @@
1
- import { C as isCodexRemoteExecPlacementSandbox, D as resolveOpenClawExecPolicyForCodexAppServer, S as isCodexPairedNodeRemoteExecPlacementSandbox, T as readCodexPluginConfig, m as resolveCodexModelBackedReviewerPolicyContext, p as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveCodexAppServerHomeScope, u as shouldAutoApproveCodexAppServerApprovals, v as readCodexRequirementsToml, w as isCodexSandboxExecServerEnabled } from "./config-Cxw3Cl3k.js";
2
- import { C as withLeasedCodexAppServerClientStartSelectionRetry, Ht as isJsonObject, K as isCodexAppServerIndeterminateRequestCancellationError, Lt as resolveCodexAppServerPreparedAuthHandoff, Ot as readRecentCodexRateLimits, U as isCodexAppServerApprovalRequest, _t as ensureCodexAppServerClientRuntime, at as resolveDynamicToolCallTimeoutMs, c as getLeasedSharedCodexAppServerClient, dt as resolveCodexToolAbortTerminalReason, et as createCodexElicitationResponse, m as releaseCodexAppServerClientLease, tt as handleDynamicToolCallWithTimeout } from "./shared-client-kNkljY-R.js";
3
- import { d as sessionBindingIdentity } from "./session-binding-q2WSTVmC.js";
1
+ import { C as isCodexRemoteExecPlacementSandbox, D as resolveOpenClawExecPolicyForCodexAppServer, S as isCodexPairedNodeRemoteExecPlacementSandbox, T as readCodexPluginConfig, m as resolveCodexModelBackedReviewerPolicyContext, p as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveCodexAppServerHomeScope, u as shouldAutoApproveCodexAppServerApprovals, v as readCodexRequirementsToml, w as isCodexSandboxExecServerEnabled } from "./config-CcYL77O6.js";
2
+ import { C as withLeasedCodexAppServerClientStartSelectionRetry, Ht as isJsonObject, K as isCodexAppServerIndeterminateRequestCancellationError, Lt as resolveCodexAppServerPreparedAuthHandoff, Ot as readRecentCodexRateLimits, U as isCodexAppServerApprovalRequest, _t as ensureCodexAppServerClientRuntime, at as resolveDynamicToolCallTimeoutMs, c as getLeasedSharedCodexAppServerClient, dt as resolveCodexToolAbortTerminalReason, et as createCodexElicitationResponse, m as releaseCodexAppServerClientLease, tt as handleDynamicToolCallWithTimeout } from "./shared-client-B1tT5U6r.js";
3
+ import { d as sessionBindingIdentity } from "./session-binding-D0zinCP1.js";
4
4
  import { a as assertCodexThreadForkResponse, c as assertCodexTurnStartResponse, d as readCodexTurn, l as readCodexDynamicToolCallParams } from "./protocol-validators-Bg5rpNxk.js";
5
- import { f as unsubscribeCodexThreadBestEffort, g as isCodexNotificationForTurn, s as isCodexAlreadyTerminalInterruptError, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CVPvp9dL.js";
6
- import { A as readCodexSupportedReasoningEfforts, E as resolveCodexAppServerRequestModelSelection, L as filterCodexDynamicTools, O as resolveCodexBindingModelProviderFallback, T as resolveCodexAppServerModelProvider, U as resolveCodexDynamicToolsLoading, c as buildCodexNativeHookRelayConfig, d as emitCodexNativePreToolUseFailureDiagnostic, et as buildCodexPluginAppsConfigPatchFromPolicyContext, k as resolveReasoningEffort, l as buildCodexNativeHookRelayDisabledConfig, o as CODEX_NATIVE_HOOK_RELAY_EVENTS, ot as mergeCodexThreadConfigs, v as buildCodexRuntimeThreadConfig, w as CODEX_NATIVE_PERSONALITY_NONE, x as resolveCodexWebSearchPlan } from "./thread-lifecycle-Ss-uwnC4.js";
7
- import { s as resolveCodexNativeExecutionBlock } from "./request-CCm4LaED.js";
8
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-hFtzt2Up.js";
9
- import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-gLm40Vtq.js";
10
- import { n as resolveCodexBindingAppServerConnection, t as requireCodexSupervisionModelSelection } from "./binding-connection-CCQFs8lf.js";
11
- import { C as shouldRequireCodexSandboxExecServerEnvironment, D as CodexNativeToolLifecycleProjector, S as shouldEnableCodexAppServerNativeToolSurface, T as filterCodexVisionTools, a as emitDynamicToolStartedDiagnostic, b as resolveCodexNodePlacementToolConstructionPlan, d as releaseCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as resolveCodexProviderWebSearchSupportForClient, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as ensureCodexSandboxExecServerEnvironment, v as resolveCodexExternalSandboxPolicyForOpenClawSandbox, x as resolveCodexSandboxEnvironmentSelection, y as resolveCodexMessageToolProvider } from "./dynamic-tools-BFoUcRdx.js";
5
+ import { f as unsubscribeCodexThreadBestEffort, g as isCodexNotificationForTurn, s as isCodexAlreadyTerminalInterruptError, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CpVfwctT.js";
6
+ import { A as readCodexSupportedReasoningEfforts, E as resolveCodexAppServerRequestModelSelection, L as filterCodexDynamicTools, O as resolveCodexBindingModelProviderFallback, T as resolveCodexAppServerModelProvider, U as resolveCodexDynamicToolsLoading, c as buildCodexNativeHookRelayConfig, d as emitCodexNativePreToolUseFailureDiagnostic, et as buildCodexPluginAppsConfigPatchFromPolicyContext, k as resolveReasoningEffort, l as buildCodexNativeHookRelayDisabledConfig, o as CODEX_NATIVE_HOOK_RELAY_EVENTS, ot as mergeCodexThreadConfigs, v as buildCodexRuntimeThreadConfig, w as CODEX_NATIVE_PERSONALITY_NONE, x as resolveCodexWebSearchPlan } from "./thread-lifecycle-CGGKP720.js";
7
+ import { s as resolveCodexNativeExecutionBlock } from "./request-BWxweEdK.js";
8
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-BqHEHXQJ.js";
9
+ import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-ScnAyG90.js";
10
+ import { n as resolveCodexBindingAppServerConnection, t as requireCodexSupervisionModelSelection } from "./binding-connection-CF7BmrDk.js";
11
+ import { C as shouldRequireCodexSandboxExecServerEnvironment, D as CodexNativeToolLifecycleProjector, S as shouldEnableCodexAppServerNativeToolSurface, T as filterCodexVisionTools, a as emitDynamicToolStartedDiagnostic, b as resolveCodexNodePlacementToolConstructionPlan, d as releaseCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as resolveCodexProviderWebSearchSupportForClient, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as ensureCodexSandboxExecServerEnvironment, v as resolveCodexExternalSandboxPolicyForOpenClawSandbox, x as resolveCodexSandboxEnvironmentSelection, y as resolveCodexMessageToolProvider } from "./dynamic-tools-BmeXjwNZ.js";
12
12
  import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
13
13
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
14
14
  import { randomUUID } from "node:crypto";
@@ -23,8 +23,8 @@ var CodexSideQuestionTimeoutError = class extends Error {
23
23
  this.name = "TimeoutError";
24
24
  }
25
25
  };
26
- const CODEX_SIDE_NATIVE_HOOK_RELAY_MIN_TTL_MS = 30 * 6e4;
27
- const CODEX_SIDE_NATIVE_HOOK_RELAY_TTL_GRACE_MS = 5 * 6e4;
26
+ const CODEX_SIDE_NATIVE_HOOK_RELAY_MIN_TTL_MS = 18e5;
27
+ const CODEX_SIDE_NATIVE_HOOK_RELAY_TTL_GRACE_MS = 3e5;
28
28
  const CODEX_SIDE_NATIVE_HOOK_RELAY_STARTUP_REQUEST_COUNT = 3;
29
29
  const CODEX_SIDE_NATIVE_HOOK_RELAY_EVENTS_WITH_APP_SERVER_APPROVALS = CODEX_NATIVE_HOOK_RELAY_EVENTS.filter((event) => event !== "permission_request");
30
30
  const SIDE_BOUNDARY_PROMPT = `Side conversation boundary.
@@ -461,7 +461,8 @@ async function runCodexAppServerSideQuestion(params, options) {
461
461
  nativeCodeModeEnabled: nativeToolSurfaceEnabled,
462
462
  nativeCodeModeOnlyEnabled: appServer.codeModeOnly
463
463
  });
464
- const threadConfig = mergeCodexThreadConfigs(nativeHookRelayConfig, runtimeThreadConfig, binding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(binding.pluginAppPolicyContext) : void 0, appServer.networkProxy?.configPatch) ?? runtimeThreadConfig;
464
+ const pluginAppsConfigPatch = binding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(binding.pluginAppPolicyContext) : void 0;
465
+ const threadConfig = mergeCodexThreadConfigs(nativeHookRelayConfig, runtimeThreadConfig, pluginAppsConfigPatch, appServer.networkProxy?.configPatch) ?? runtimeThreadConfig;
465
466
  const forkResponse = assertCodexThreadForkResponse(await withLeasedCodexAppServerClientStartSelectionRetry({
466
467
  lease: clientLease,
467
468
  options: clientOptions,
@@ -695,7 +696,7 @@ async function createCodexSideToolBridge(input) {
695
696
  workspaceDir: input.cwd
696
697
  });
697
698
  const toolConstructionPlan = resolveCodexNodePlacementToolConstructionPlan(sandbox, input.nativeToolSurfaceEnabled);
698
- tools = filterCodexVisionTools(filterCodexDynamicTools(createOpenClawCodingTools({
699
+ const allTools = createOpenClawCodingTools({
699
700
  agentId: input.sessionAgentId,
700
701
  sessionKey: sandboxSessionKey,
701
702
  runSessionKey: input.params.sessionKey && input.params.sessionKey !== sandboxSessionKey ? input.params.sessionKey : void 0,
@@ -752,7 +753,9 @@ async function createCodexSideToolBridge(input) {
752
753
  emitBeforeToolCallDiagnostics: false,
753
754
  modelHasVision: runtimeModel.input?.includes("image") ?? false,
754
755
  requireExplicitMessageTarget: true
755
- }), input.pluginConfig), {
756
+ });
757
+ const codexFilteredTools = filterCodexDynamicTools(allTools, input.pluginConfig);
758
+ tools = filterCodexVisionTools(codexFilteredTools, {
756
759
  modelHasVision: runtimeModel.input?.includes("image") ?? false,
757
760
  nativeImageInspectionEnabled: input.nativeToolSurfaceEnabled
758
761
  });