@openclaw/codex 2026.6.11-beta.2 → 2026.7.1-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.
- package/dist/{app-server-policy-BPTiVNsW.js → app-server-policy-xi0ZmBGO.js} +2 -2
- package/dist/{attempt-notifications-BYnndyFl.js → attempt-notifications-l9LElGOU.js} +26 -2
- package/dist/{client-CLrtWgrD.js → client-IcTBKEqA.js} +5 -2
- package/dist/{client-factory-Bm6HsGob.js → client-factory-CwjdQQ4j.js} +1 -1
- package/dist/{command-handlers-DEPTJYk0.js → command-handlers-vZy8xX5X.js} +25 -19
- package/dist/{compact-aQJ0ZKhe.js → compact-BzB9AqN1.js} +5 -5
- package/dist/{computer-use-ClrJwoFp.js → computer-use-FPGG-mtX.js} +3 -3
- package/dist/{config-CszD0vP3.js → config-C_whBx3M.js} +8 -3
- package/dist/{conversation-binding-t0XMLz-j.js → conversation-binding-CEE2UyYb.js} +28 -15
- package/dist/harness.js +6 -6
- package/dist/index.js +25 -17
- package/dist/{media-understanding-provider-ZUQHN7gT.js → media-understanding-provider-C5yYzx_6.js} +6 -6
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-CAmfBWRl.js → models-Ccy1_7nN.js} +2 -2
- package/dist/{plugin-app-cache-key-C9ILt7bl.js → plugin-app-cache-key-CDioyur-.js} +8 -4
- package/dist/{protocol-validators-B19q5BIX.js → protocol-validators-CB4mtyrs.js} +106 -12
- package/dist/{provider-B-OHpbD3.js → provider-DosqwRb6.js} +53 -18
- package/dist/{provider-capabilities-D7hnTO76.js → provider-capabilities-CE5k8cmO.js} +179 -15
- package/dist/provider-catalog.js +4 -2
- package/dist/provider.js +2 -2
- package/dist/{request-Dcd452Nk.js → request-BQuSQF29.js} +2 -2
- package/dist/{run-attempt-CXxtFC9d.js → run-attempt-O3Zs32KI.js} +106 -29
- package/dist/{sandbox-guard-3tnjhjFb.js → sandbox-guard-pTY2COoC.js} +2 -0
- package/dist/{session-binding-HOuPt-E0.js → session-binding-Cm0Gg7Z1.js} +2 -1
- package/dist/{shared-client-Dtx5i7Ez.js → shared-client-rR6TDJA3.js} +98 -47
- package/dist/{side-question-C-DhgJOd.js → side-question-DDVgFmpv.js} +12 -12
- package/dist/{thread-lifecycle-DtT3-ehU.js → thread-lifecycle-DeSMZSXr.js} +148 -42
- package/dist/{web-search-provider.runtime-CkwxrXQj.js → web-search-provider.runtime-Q89rQhsL.js} +2 -2
- package/npm-shrinkwrap.json +30 -30
- package/openclaw.plugin.json +3 -3
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { d as resolveCodexAppServerRuntimeOptions, r as codexAppServerStartOptionsKey } from "./config-
|
|
3
|
-
import {
|
|
2
|
+
import { d as resolveCodexAppServerRuntimeOptions, r as codexAppServerStartOptionsKey } from "./config-C_whBx3M.js";
|
|
3
|
+
import { l as resolveCodexAppServerSpawnEnv, o as isUnsupportedCodexAppServerVersionError, s as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-IcTBKEqA.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import fs, { access } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
@@ -511,6 +511,7 @@ function resolveChatgptAccountId(profileId, credential) {
|
|
|
511
511
|
* the Codex plugin before stdio startup.
|
|
512
512
|
*/
|
|
513
513
|
const CODEX_PLUGIN_ROOT = resolveDefaultCodexPluginRoot(path.dirname(fileURLToPath(import.meta.url)));
|
|
514
|
+
const MACOS_DESKTOP_CODEX_APP_SERVER_COMMAND = "/Applications/Codex.app/Contents/Resources/codex";
|
|
514
515
|
/** Rewrites managed stdio start options to point at an executable Codex binary path. */
|
|
515
516
|
async function resolveManagedCodexAppServerStartOptions(startOptions, options = {}) {
|
|
516
517
|
if (startOptions.transport !== "stdio" || startOptions.commandSource !== "managed") return startOptions;
|
|
@@ -520,15 +521,18 @@ async function resolveManagedCodexAppServerStartOptions(startOptions, options =
|
|
|
520
521
|
pluginRoot: options.pluginRoot
|
|
521
522
|
});
|
|
522
523
|
const pathExists = options.pathExists ?? commandPathExists;
|
|
523
|
-
const
|
|
524
|
+
const commandPaths = await findManagedCodexAppServerCommandPaths({
|
|
524
525
|
candidateCommandPaths: paths.candidateCommandPaths,
|
|
525
526
|
pathExists,
|
|
526
527
|
platform
|
|
527
528
|
});
|
|
529
|
+
const commandPath = commandPaths[0];
|
|
530
|
+
const managedFallbackCommandPaths = commandPaths.slice(1);
|
|
528
531
|
return {
|
|
529
532
|
...startOptions,
|
|
530
533
|
command: commandPath,
|
|
531
|
-
commandSource: "resolved-managed"
|
|
534
|
+
commandSource: "resolved-managed",
|
|
535
|
+
...managedFallbackCommandPaths.length > 0 ? { managedFallbackCommandPaths } : {}
|
|
532
536
|
};
|
|
533
537
|
}
|
|
534
538
|
/** Returns the preferred and fallback managed Codex binary paths for a plugin root. */
|
|
@@ -544,7 +548,14 @@ function resolveManagedCodexAppServerCommandCandidates(pluginRoot, platform) {
|
|
|
544
548
|
const pathApi = pathForPlatform(platform);
|
|
545
549
|
const commandName = platform === "win32" ? "codex.cmd" : "codex";
|
|
546
550
|
const roots = resolveManagedCodexAppServerCandidateRoots(pluginRoot, platform);
|
|
547
|
-
return [...new Set([
|
|
551
|
+
return [...new Set([
|
|
552
|
+
...resolveDesktopCodexAppServerCommandCandidates(platform),
|
|
553
|
+
...roots.map((root) => pathApi.join(root, "node_modules", ".bin", commandName)),
|
|
554
|
+
...resolveManagedCodexPackageBinCandidates(roots, platform)
|
|
555
|
+
])];
|
|
556
|
+
}
|
|
557
|
+
function resolveDesktopCodexAppServerCommandCandidates(platform) {
|
|
558
|
+
return platform === "darwin" ? [MACOS_DESKTOP_CODEX_APP_SERVER_COMMAND] : [];
|
|
548
559
|
}
|
|
549
560
|
function resolveDefaultCodexPluginRoot(moduleDir) {
|
|
550
561
|
const moduleBaseName = path.basename(moduleDir);
|
|
@@ -610,8 +621,10 @@ function isDistExtensionRoot(pluginRoot, platform) {
|
|
|
610
621
|
function pathForPlatform(platform) {
|
|
611
622
|
return platform === "win32" ? path.win32 : path.posix;
|
|
612
623
|
}
|
|
613
|
-
async function
|
|
614
|
-
|
|
624
|
+
async function findManagedCodexAppServerCommandPaths(params) {
|
|
625
|
+
const commandPaths = [];
|
|
626
|
+
for (const commandPath of params.candidateCommandPaths) if (await params.pathExists(commandPath, params.platform)) commandPaths.push(commandPath);
|
|
627
|
+
if (commandPaths.length > 0) return commandPaths;
|
|
615
628
|
throw new Error([
|
|
616
629
|
`Managed Codex app-server binary was not found for ${MANAGED_CODEX_APP_SERVER_PACKAGE}.`,
|
|
617
630
|
"Reinstall or update OpenClaw, or run pnpm install in a source checkout.",
|
|
@@ -779,25 +792,21 @@ async function acquireSharedCodexAppServerClient(options, leaseOptions) {
|
|
|
779
792
|
if (options.abandonSignal.aborted) abandon();
|
|
780
793
|
}
|
|
781
794
|
const sharedPromise = entry.promise ?? (entry.promise = (async () => {
|
|
782
|
-
const client =
|
|
795
|
+
const client = await startInitializedCodexAppServerClient({
|
|
796
|
+
startOptions,
|
|
797
|
+
agentDir,
|
|
798
|
+
authProfileId: usesNativeAuth ? null : authProfileId,
|
|
799
|
+
config: options?.config,
|
|
800
|
+
onStartedClient: (startedClient) => {
|
|
801
|
+
entry.client = startedClient;
|
|
802
|
+
startedClient.setActiveSharedLeaseCountProviderForUnscopedNotifications(() => entry.activeLeases);
|
|
803
|
+
options?.onStartedClient?.(startedClient);
|
|
804
|
+
}
|
|
805
|
+
});
|
|
783
806
|
entry.client = client;
|
|
784
|
-
options?.onStartedClient?.(client);
|
|
785
807
|
client.setActiveSharedLeaseCountProviderForUnscopedNotifications(() => entry.activeLeases);
|
|
786
808
|
client.addCloseHandler((closedClient) => clearSharedClientEntryIfCurrent(key, closedClient));
|
|
787
|
-
|
|
788
|
-
await client.initialize();
|
|
789
|
-
await applyCodexAppServerAuthProfile({
|
|
790
|
-
client,
|
|
791
|
-
agentDir,
|
|
792
|
-
authProfileId: usesNativeAuth ? null : authProfileId,
|
|
793
|
-
startOptions,
|
|
794
|
-
config: options?.config
|
|
795
|
-
});
|
|
796
|
-
return client;
|
|
797
|
-
} catch (error) {
|
|
798
|
-
client.close();
|
|
799
|
-
throw error;
|
|
800
|
-
}
|
|
809
|
+
return client;
|
|
801
810
|
})());
|
|
802
811
|
try {
|
|
803
812
|
const client = await withTimeout$1(sharedPromise, options?.timeoutMs ?? 0, "codex app-server initialize timed out");
|
|
@@ -819,33 +828,75 @@ async function acquireSharedCodexAppServerClient(options, leaseOptions) {
|
|
|
819
828
|
/** Starts a non-shared Codex app-server client owned entirely by the caller. */
|
|
820
829
|
async function createIsolatedCodexAppServerClient(options) {
|
|
821
830
|
const { agentDir, usesNativeAuth, authProfileId, authProfileStore, startOptions } = await resolveCodexAppServerClientStartContext(options);
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
});
|
|
831
|
+
return await startInitializedCodexAppServerClient({
|
|
832
|
+
startOptions,
|
|
833
|
+
agentDir,
|
|
834
|
+
authProfileId: usesNativeAuth ? null : authProfileId,
|
|
835
|
+
authProfileStore,
|
|
836
|
+
config: options?.config,
|
|
837
|
+
timeoutMs: options?.timeoutMs,
|
|
838
|
+
onStartedClient: options?.onStartedClient
|
|
831
839
|
});
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
}
|
|
841
|
+
async function startInitializedCodexAppServerClient(params) {
|
|
842
|
+
const startOptionsCandidates = resolveManagedFallbackStartOptions(params.startOptions);
|
|
843
|
+
for (let index = 0; index < startOptionsCandidates.length; index += 1) {
|
|
844
|
+
const startOptions = startOptionsCandidates[index];
|
|
845
|
+
const client = CodexAppServerClient.start(startOptions);
|
|
846
|
+
params.onStartedClient?.(client);
|
|
847
|
+
const initialize = client.initialize();
|
|
848
|
+
try {
|
|
849
|
+
await withTimeout$1(initialize, params.timeoutMs ?? 0, "codex app-server initialize timed out");
|
|
850
|
+
} catch (error) {
|
|
851
|
+
client.close();
|
|
852
|
+
initialize.catch(() => void 0);
|
|
853
|
+
if (shouldTryManagedFallbackStartOption(error, startOptions, index, startOptionsCandidates)) continue;
|
|
854
|
+
throw error;
|
|
855
|
+
}
|
|
856
|
+
if (params.authProfileId) client.addRequestHandler(async (request) => {
|
|
857
|
+
if (request.method !== "account/chatgptAuthTokens/refresh") return;
|
|
858
|
+
return await refreshCodexAppServerAuthTokens({
|
|
859
|
+
agentDir: params.agentDir,
|
|
860
|
+
authProfileId: params.authProfileId,
|
|
861
|
+
...params.authProfileStore ? { authProfileStore: params.authProfileStore } : {},
|
|
862
|
+
config: params.config
|
|
863
|
+
});
|
|
842
864
|
});
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
865
|
+
try {
|
|
866
|
+
await applyCodexAppServerAuthProfile({
|
|
867
|
+
client,
|
|
868
|
+
agentDir: params.agentDir,
|
|
869
|
+
authProfileId: params.authProfileId,
|
|
870
|
+
startOptions,
|
|
871
|
+
config: params.config,
|
|
872
|
+
...params.authProfileStore ? { authProfileStore: params.authProfileStore } : {}
|
|
873
|
+
});
|
|
874
|
+
return client;
|
|
875
|
+
} catch (error) {
|
|
876
|
+
client.close();
|
|
877
|
+
throw error;
|
|
878
|
+
}
|
|
848
879
|
}
|
|
880
|
+
throw new Error("Managed Codex app-server fallback candidates were exhausted.");
|
|
881
|
+
}
|
|
882
|
+
function resolveManagedFallbackStartOptions(startOptions) {
|
|
883
|
+
const commands = [startOptions.command, ...startOptions.managedFallbackCommandPaths ?? []];
|
|
884
|
+
const candidates = [];
|
|
885
|
+
for (let index = 0; index < commands.length; index += 1) {
|
|
886
|
+
const command = commands[index];
|
|
887
|
+
const managedFallbackCommandPaths = commands.slice(index + 1);
|
|
888
|
+
const candidate = {
|
|
889
|
+
...startOptions,
|
|
890
|
+
command
|
|
891
|
+
};
|
|
892
|
+
if (managedFallbackCommandPaths.length === 0) delete candidate.managedFallbackCommandPaths;
|
|
893
|
+
else candidate.managedFallbackCommandPaths = managedFallbackCommandPaths;
|
|
894
|
+
candidates.push(candidate);
|
|
895
|
+
}
|
|
896
|
+
return candidates;
|
|
897
|
+
}
|
|
898
|
+
function shouldTryManagedFallbackStartOption(error, startOptions, index, startOptionsCandidates) {
|
|
899
|
+
return startOptions.commandSource === "resolved-managed" && index < startOptionsCandidates.length - 1 && isUnsupportedCodexAppServerVersionError(error);
|
|
849
900
|
}
|
|
850
901
|
/** Clears and closes all shared clients for deterministic tests. */
|
|
851
902
|
function resetSharedCodexAppServerClientForTests() {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { H as
|
|
3
|
-
import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-
|
|
4
|
-
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-
|
|
5
|
-
import {
|
|
6
|
-
import { i as isCodexAppServerApprovalRequest } from "./client-
|
|
7
|
-
import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-
|
|
8
|
-
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-
|
|
9
|
-
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-
|
|
10
|
-
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-
|
|
11
|
-
import { C as resolveCodexMessageToolProvider, O as filterToolsForVisionInputs, T as shouldEnableCodexAppServerNativeToolSurface, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, h as emitDynamicToolTerminalDiagnostic, k as handleCodexAppServerApprovalRequest, m as emitDynamicToolStartedDiagnostic, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, r as CODEX_NATIVE_HOOK_RELAY_EVENTS } from "./provider-capabilities-
|
|
2
|
+
import { H as readCodexNotificationThreadId, P as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, U as readCodexNotificationTurnId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, j as buildCodexPluginAppsConfigPatchFromPolicyContext, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-DeSMZSXr.js";
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-C_whBx3M.js";
|
|
4
|
+
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-CB4mtyrs.js";
|
|
5
|
+
import { a as readCodexSupportedReasoningEfforts, s as formatCodexUsageLimitErrorMessage } from "./provider-DosqwRb6.js";
|
|
6
|
+
import { i as isCodexAppServerApprovalRequest } from "./client-IcTBKEqA.js";
|
|
7
|
+
import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-Cm0Gg7Z1.js";
|
|
8
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-xi0ZmBGO.js";
|
|
9
|
+
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-rR6TDJA3.js";
|
|
10
|
+
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-pTY2COoC.js";
|
|
11
|
+
import { C as resolveCodexMessageToolProvider, O as filterToolsForVisionInputs, T as shouldEnableCodexAppServerNativeToolSurface, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, h as emitDynamicToolTerminalDiagnostic, k as handleCodexAppServerApprovalRequest, m as emitDynamicToolStartedDiagnostic, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, r as CODEX_NATIVE_HOOK_RELAY_EVENTS } from "./provider-capabilities-CE5k8cmO.js";
|
|
12
12
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
|
|
13
13
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
14
14
|
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -272,7 +272,7 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
|
|
|
272
272
|
nativeCodeModeEnabled: nativeToolSurfaceEnabled,
|
|
273
273
|
nativeCodeModeOnlyEnabled: appServer.codeModeOnly
|
|
274
274
|
});
|
|
275
|
-
const threadConfig = mergeCodexThreadConfigs(nativeHookRelayConfig, runtimeThreadConfig, modelScopedAppServer.networkProxy?.configPatch) ?? runtimeThreadConfig;
|
|
275
|
+
const threadConfig = mergeCodexThreadConfigs(nativeHookRelayConfig, runtimeThreadConfig, binding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(binding.pluginAppPolicyContext) : void 0, modelScopedAppServer.networkProxy?.configPatch) ?? runtimeThreadConfig;
|
|
276
276
|
childThreadId = assertCodexThreadForkResponse(await forkCodexSideThread(client, {
|
|
277
277
|
threadId: binding.threadId,
|
|
278
278
|
model: modelSelection.model,
|
|
@@ -298,7 +298,7 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
|
|
|
298
298
|
timeoutMs: appServer.requestTimeoutMs,
|
|
299
299
|
signal: params.opts?.abortSignal
|
|
300
300
|
});
|
|
301
|
-
const effort = resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model);
|
|
301
|
+
const effort = resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model, readCodexSupportedReasoningEfforts(params.runtimeModel?.compat));
|
|
302
302
|
turnId = assertCodexTurnStartResponse(await client.request("turn/start", {
|
|
303
303
|
threadId: childThreadId,
|
|
304
304
|
input: [{
|