@openclaw/codex 2026.6.1-beta.1 → 2026.6.1-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.
- package/dist/{client-factory-DBgo1xC5.js → client-factory-3ykiiX2z.js} +1 -1
- package/dist/{command-handlers-BnVjvHTP.js → command-handlers-VhJdcXcI.js} +5 -5
- package/dist/{compact-Dgz_jIBU.js → compact-D1dSrNrT.js} +2 -2
- package/dist/{computer-use-D0D0M1L7.js → computer-use-DYLSxIfq.js} +1 -1
- package/dist/{conversation-binding-DJVOwYW-.js → conversation-binding-CqVPKJPp.js} +4 -4
- package/dist/harness.js +5 -5
- package/dist/index.js +5 -5
- package/dist/media-understanding-provider.js +3 -3
- package/dist/{models-DEgJXKQy.js → models-DAJvlyJu.js} +1 -1
- package/dist/{native-hook-relay-BedqkHpK.js → native-hook-relay-CIJt8cLN.js} +2 -40
- package/dist/provider.js +1 -1
- package/dist/{request-DKdcodME.js → request-CPtFWp-f.js} +2 -2
- package/dist/{run-attempt-BgaRVuZH.js → run-attempt-DM53zFlW.js} +100 -10
- package/dist/{session-binding-BXJAV_xy.js → session-binding-DWiEGATW.js} +2 -0
- package/dist/{shared-client-ByKKWtYX.js → shared-client-DUWLidr5.js} +5 -1
- package/dist/{side-question-NLoSbmFG.js → side-question-dIZf9RBV.js} +4 -4
- package/dist/{thread-lifecycle-W15Byt1U.js → thread-lifecycle-6nrEQZMV.js} +129 -33
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region extensions/codex/src/app-server/client-factory.ts
|
|
2
2
|
let sharedClientModulePromise = null;
|
|
3
3
|
const loadSharedClientModule = async () => {
|
|
4
|
-
sharedClientModulePromise ??= import("./shared-client-
|
|
4
|
+
sharedClientModulePromise ??= import("./shared-client-DUWLidr5.js").then((n) => n.s);
|
|
5
5
|
return await sharedClientModulePromise;
|
|
6
6
|
};
|
|
7
7
|
const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => loadSharedClientModule().then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
|
|
2
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
2
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-DAJvlyJu.js";
|
|
3
3
|
import { l as isJsonObject } from "./client-BnOmn0y-.js";
|
|
4
|
-
import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
5
|
-
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-
|
|
4
|
+
import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
5
|
+
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
|
|
6
6
|
import { a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatSkills, l as formatComputerUseStatus, m as readString$1, o as formatAccount, p as formatThreads, s as formatCodexDisplayText, u as formatList, v as summarizeCodexAccountUsage } from "./notification-correlation-BykOI_jh.js";
|
|
7
7
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
|
|
8
|
-
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-
|
|
9
|
-
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-
|
|
8
|
+
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-CqVPKJPp.js";
|
|
9
|
+
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-DYLSxIfq.js";
|
|
10
10
|
import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
11
11
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
12
12
|
import crypto from "node:crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
|
|
2
|
-
import { a as readCodexAppServerBinding } from "./session-binding-
|
|
2
|
+
import { a as readCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
3
3
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DMCJlzmz.js";
|
|
4
|
-
import { t as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
4
|
+
import { t as defaultCodexAppServerClientFactory } from "./client-factory-3ykiiX2z.js";
|
|
5
5
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/compact.ts
|
|
7
7
|
const warnedIgnoredCompactionOverrides = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-AlzuNKCY.js";
|
|
2
|
-
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
2
|
+
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
5
5
|
var CodexComputerUseSetupError = class extends Error {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { d as resolveCodexAppServerRuntimeOptions, i as codexSandboxPolicyForTurn, m as resolveOpenClawExecPolicyForCodexAppServer, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
|
|
2
2
|
import { l as isJsonObject } from "./client-BnOmn0y-.js";
|
|
3
|
-
import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-
|
|
4
|
-
import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
5
|
-
import { r as CODEX_CONTROL_METHODS } from "./request-
|
|
3
|
+
import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-6nrEQZMV.js";
|
|
4
|
+
import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
5
|
+
import { r as CODEX_CONTROL_METHODS } from "./request-CPtFWp-f.js";
|
|
6
6
|
import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
|
|
7
|
-
import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
7
|
+
import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient } from "./shared-client-DUWLidr5.js";
|
|
8
8
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
|
|
9
9
|
import { resolveTimerTimeoutMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
10
10
|
import os from "node:os";
|
package/dist/harness.js
CHANGED
|
@@ -28,31 +28,31 @@ function createCodexAppServerAgentHarness(options) {
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
runAttempt: async (params) => {
|
|
31
|
-
const { runCodexAppServerAttempt } = await import("./run-attempt-
|
|
31
|
+
const { runCodexAppServerAttempt } = await import("./run-attempt-DM53zFlW.js");
|
|
32
32
|
return runCodexAppServerAttempt(params, {
|
|
33
33
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
34
34
|
nativeHookRelay: { enabled: true }
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
runSideQuestion: async (params) => {
|
|
38
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-
|
|
38
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-dIZf9RBV.js");
|
|
39
39
|
return runCodexAppServerSideQuestion(params, {
|
|
40
40
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
41
41
|
nativeHookRelay: { enabled: true }
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
44
|
compact: async (params) => {
|
|
45
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
45
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-D1dSrNrT.js");
|
|
46
46
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
47
47
|
},
|
|
48
48
|
reset: async (params) => {
|
|
49
49
|
if (params.sessionFile) {
|
|
50
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
50
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-DWiEGATW.js").then((n) => n.o);
|
|
51
51
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
dispose: async () => {
|
|
55
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
55
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-DUWLidr5.js").then((n) => n.s);
|
|
56
56
|
await clearSharedCodexAppServerClientAndWait();
|
|
57
57
|
}
|
|
58
58
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
2
|
import { d as resolveCodexAppServerRuntimeOptions, s as isCodexPluginsMarketplaceName, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-AlzuNKCY.js";
|
|
3
3
|
import { buildCodexProvider } from "./provider.js";
|
|
4
|
-
import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-
|
|
4
|
+
import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-6nrEQZMV.js";
|
|
5
5
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
|
-
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-
|
|
6
|
+
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
|
|
7
7
|
import { s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
|
|
8
|
-
import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, p as resolveCodexAppServerFallbackApiKeyCacheKey, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-
|
|
9
|
-
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-
|
|
8
|
+
import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, p as resolveCodexAppServerFallbackApiKeyCacheKey, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-DUWLidr5.js";
|
|
9
|
+
import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-CqVPKJPp.js";
|
|
10
10
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
11
11
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
12
12
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
@@ -48,7 +48,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
async function loadDefaultCodexSubcommandHandler() {
|
|
51
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
51
|
+
const { handleCodexSubcommand } = await import("./command-handlers-VhJdcXcI.js");
|
|
52
52
|
return handleCodexSubcommand;
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
2
|
import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
|
|
3
3
|
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-DIt7cXIp.js";
|
|
4
|
-
import { i as readModelListResult } from "./models-
|
|
4
|
+
import { i as readModelListResult } from "./models-DAJvlyJu.js";
|
|
5
5
|
import { l as isJsonObject } from "./client-BnOmn0y-.js";
|
|
6
|
-
import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-
|
|
6
|
+
import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-6nrEQZMV.js";
|
|
7
7
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
8
8
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
9
9
|
//#region extensions/codex/media-understanding-provider.ts
|
|
@@ -64,7 +64,7 @@ async function runBoundedCodexVisionTurn(params) {
|
|
|
64
64
|
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
|
|
65
65
|
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 100, 100);
|
|
66
66
|
const ownsClient = !params.options.clientFactory;
|
|
67
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-
|
|
67
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-DUWLidr5.js").then((n) => n.s).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
68
68
|
startOptions: appServer.start,
|
|
69
69
|
timeoutMs,
|
|
70
70
|
authProfileId: params.profile
|
|
@@ -40,7 +40,7 @@ async function listAllCodexAppServerModels(options = {}) {
|
|
|
40
40
|
async function withCodexAppServerModelClient(options, run) {
|
|
41
41
|
const timeoutMs = options.timeoutMs ?? 2500;
|
|
42
42
|
const useSharedClient = options.sharedClient !== false;
|
|
43
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-
|
|
43
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DUWLidr5.js").then((n) => n.s);
|
|
44
44
|
const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
|
|
45
45
|
startOptions: options.startOptions,
|
|
46
46
|
timeoutMs,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as isJsonObject } from "./client-BnOmn0y-.js";
|
|
2
|
-
import { S as invalidInlineImageText, w as sanitizeInlineImageDataUrl } from "./thread-lifecycle-
|
|
2
|
+
import { S as invalidInlineImageText, w as sanitizeInlineImageDataUrl } from "./thread-lifecycle-6nrEQZMV.js";
|
|
3
3
|
import { s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
|
|
4
4
|
import { addTimerTimeoutGraceMs, finiteSecondsToTimerSafeMilliseconds, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
@@ -880,44 +880,6 @@ function formatErrorMessage$1(error) {
|
|
|
880
880
|
return error instanceof Error ? error.message : String(error);
|
|
881
881
|
}
|
|
882
882
|
//#endregion
|
|
883
|
-
//#region extensions/codex/src/app-server/dynamic-tool-profile.ts
|
|
884
|
-
const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
|
|
885
|
-
"read",
|
|
886
|
-
"write",
|
|
887
|
-
"edit",
|
|
888
|
-
"apply_patch",
|
|
889
|
-
"exec",
|
|
890
|
-
"process",
|
|
891
|
-
"update_plan",
|
|
892
|
-
"tool_call",
|
|
893
|
-
"tool_describe",
|
|
894
|
-
"tool_search",
|
|
895
|
-
"tool_search_code"
|
|
896
|
-
];
|
|
897
|
-
const DYNAMIC_TOOL_NAME_ALIASES = {
|
|
898
|
-
bash: "exec",
|
|
899
|
-
"apply-patch": "apply_patch"
|
|
900
|
-
};
|
|
901
|
-
function normalizeCodexDynamicToolName(name) {
|
|
902
|
-
const normalized = name.trim().toLowerCase();
|
|
903
|
-
return DYNAMIC_TOOL_NAME_ALIASES[normalized] ?? normalized;
|
|
904
|
-
}
|
|
905
|
-
function isForcedPrivateQaCodexRuntime(env = process.env) {
|
|
906
|
-
return env.OPENCLAW_BUILD_PRIVATE_QA === "1" && env.OPENCLAW_QA_FORCE_RUNTIME?.trim().toLowerCase() === "codex";
|
|
907
|
-
}
|
|
908
|
-
function resolveCodexDynamicToolsLoading(config, env = process.env) {
|
|
909
|
-
return isForcedPrivateQaCodexRuntime(env) ? "direct" : config.codexDynamicToolsLoading ?? "searchable";
|
|
910
|
-
}
|
|
911
|
-
function filterCodexDynamicTools(tools, config, env = process.env) {
|
|
912
|
-
const excludes = /* @__PURE__ */ new Set();
|
|
913
|
-
if (!isForcedPrivateQaCodexRuntime(env)) for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) excludes.add(name);
|
|
914
|
-
for (const name of config.codexDynamicToolsExclude ?? []) {
|
|
915
|
-
const trimmed = normalizeCodexDynamicToolName(name);
|
|
916
|
-
if (trimmed) excludes.add(trimmed);
|
|
917
|
-
}
|
|
918
|
-
return excludes.size === 0 ? tools : tools.filter((tool) => !excludes.has(normalizeCodexDynamicToolName(tool.name)));
|
|
919
|
-
}
|
|
920
|
-
//#endregion
|
|
921
883
|
//#region extensions/codex/src/app-server/vision-tools.ts
|
|
922
884
|
function filterToolsForVisionInputs(tools, params) {
|
|
923
885
|
if (!params.modelHasVision || !params.hasInboundImages) return tools;
|
|
@@ -2167,4 +2129,4 @@ function sortJsonValue(value) {
|
|
|
2167
2129
|
return sorted;
|
|
2168
2130
|
}
|
|
2169
2131
|
//#endregion
|
|
2170
|
-
export {
|
|
2132
|
+
export { withCodexStartupTimeout as S, resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs as _, createCodexNativeHookRelay as a, resolveCodexTurnCompletionIdleTimeoutMs as b, scheduleCodexNativeHookRelayUnregister as c, emitDynamicToolErrorDiagnostic as d, emitDynamicToolStartedDiagnostic as f, CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS as g, handleCodexAppServerApprovalRequest as h, buildCodexNativeHookRelayDisabledConfig as i, handleCodexAppServerElicitationRequest as l, filterToolsForVisionInputs as m, CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS as n, resolveCodexNativeHookRelayEvents as o, emitDynamicToolTerminalDiagnostic as p, buildCodexNativeHookRelayConfig as r, resolveCodexNativeHookRelayTtlMs as s, CODEX_NATIVE_HOOK_RELAY_EVENTS as t, createCodexDynamicToolBridge as u, resolveCodexStartupTimeoutMs as v, resolveCodexTurnTerminalIdleTimeoutMs as x, resolveCodexTurnAssistantCompletionIdleTimeoutMs as y };
|
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-
|
|
126
|
+
const { listCodexAppServerModels } = await import("./models-DAJvlyJu.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as CodexAppServerRpcError } from "./client-BnOmn0y-.js";
|
|
2
|
-
import { b as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-
|
|
3
|
-
import { a as releaseLeasedSharedCodexAppServerClient, c as withTimeout, i as getLeasedSharedCodexAppServerClient, m as resolveCodexAppServerHomeDir, r as createIsolatedCodexAppServerClient } from "./shared-client-
|
|
2
|
+
import { b as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-6nrEQZMV.js";
|
|
3
|
+
import { a as releaseLeasedSharedCodexAppServerClient, c as withTimeout, i as getLeasedSharedCodexAppServerClient, m as resolveCodexAppServerHomeDir, r as createIsolatedCodexAppServerClient } from "./shared-client-DUWLidr5.js";
|
|
4
4
|
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-DMCJlzmz.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { a as isCodexAppServerApprovalPolicyAllowedByRequirements, c as isCodexSandboxExecServerEnabled, d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig, g as withMcpElicitationsApprovalPolicy, h as shouldAutoApproveCodexAppServerApprovals, m as resolveOpenClawExecPolicyForCodexAppServer, p as resolveCodexPluginsPolicy, u as readCodexPluginConfig } from "./config-AlzuNKCY.js";
|
|
2
2
|
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-DIt7cXIp.js";
|
|
3
3
|
import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, l as isJsonObject, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-BnOmn0y-.js";
|
|
4
|
-
import { C as sanitizeCodexHistoryImagePayloads, D as
|
|
5
|
-
import { a as readCodexAppServerBinding, n as clearCodexAppServerBindingForThread, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
6
|
-
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-
|
|
4
|
+
import { A as projectContextEngineAssemblyForCodex, C as sanitizeCodexHistoryImagePayloads, D as normalizeCodexDynamicToolName$1, E as isForcedPrivateQaCodexRuntime, M as resolveCodexContextEngineProjectionReserveTokens, T as filterCodexDynamicTools, _ as shouldBuildCodexPluginThreadConfig, a as buildDeveloperInstructions, c as codexDynamicToolsFingerprint, f as startOrResumeThread, g as mergeCodexThreadConfigs, h as buildCodexPluginThreadConfigInputFingerprint, i as buildContextEngineBinding, j as resolveCodexContextEngineProjectionMaxChars, k as resolveCodexDynamicToolsLoadingForModel, l as isContextEngineBindingCompatible, m as buildCodexPluginThreadConfig, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, p as isCodexAppServerProfilerEnabled, s as buildTurnStartParams, x as defaultCodexAppInventoryCache } from "./thread-lifecycle-6nrEQZMV.js";
|
|
5
|
+
import { a as readCodexAppServerBinding, n as clearCodexAppServerBindingForThread, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
6
|
+
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-CPtFWp-f.js";
|
|
7
7
|
import { _ as shouldRefreshCodexRateLimitsForUsageLimitMessage, g as resolveCodexUsageLimitResetAtMs, h as formatCodexUsageLimitErrorMessage, i as readCodexNotificationTurnId, n as isCodexNotificationForTurn, r as readCodexNotificationThreadId, s as formatCodexDisplayText, t as describeCodexNotificationCorrelation } from "./notification-correlation-BykOI_jh.js";
|
|
8
|
-
import { a as releaseLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthProfileId, f as resolveCodexAppServerAuthProfileIdForAgent, l as refreshCodexAppServerAuthTokens, m as resolveCodexAppServerHomeDir, o as retireSharedCodexAppServerClientIfCurrent, p as resolveCodexAppServerFallbackApiKeyCacheKey, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-
|
|
8
|
+
import { a as releaseLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthProfileId, f as resolveCodexAppServerAuthProfileIdForAgent, l as refreshCodexAppServerAuthTokens, m as resolveCodexAppServerHomeDir, o as retireSharedCodexAppServerClientIfCurrent, p as resolveCodexAppServerFallbackApiKeyCacheKey, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-DUWLidr5.js";
|
|
9
9
|
import { i as resolveCodexNativeExecutionPolicy } from "./sandbox-guard-DMCJlzmz.js";
|
|
10
|
-
import { n as defaultLeasedCodexAppServerClientFactory } from "./client-factory-
|
|
11
|
-
import {
|
|
12
|
-
import { t as ensureCodexComputerUse } from "./computer-use-
|
|
10
|
+
import { n as defaultLeasedCodexAppServerClientFactory } from "./client-factory-3ykiiX2z.js";
|
|
11
|
+
import { S as withCodexStartupTimeout, _ as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, a as createCodexNativeHookRelay, b as resolveCodexTurnCompletionIdleTimeoutMs, c as scheduleCodexNativeHookRelayUnregister, d as emitDynamicToolErrorDiagnostic, f as emitDynamicToolStartedDiagnostic, g as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, h as handleCodexAppServerApprovalRequest, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerElicitationRequest, m as filterToolsForVisionInputs, n as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, o as resolveCodexNativeHookRelayEvents, p as emitDynamicToolTerminalDiagnostic, r as buildCodexNativeHookRelayConfig, s as resolveCodexNativeHookRelayTtlMs, u as createCodexDynamicToolBridge, v as resolveCodexStartupTimeoutMs, x as resolveCodexTurnTerminalIdleTimeoutMs, y as resolveCodexTurnAssistantCompletionIdleTimeoutMs } from "./native-hook-relay-CIJt8cLN.js";
|
|
12
|
+
import { t as ensureCodexComputerUse } from "./computer-use-DYLSxIfq.js";
|
|
13
13
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
14
14
|
import { asDateTimestampMs, parseStrictNonNegativeInteger, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
15
15
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -1535,7 +1535,7 @@ function sendResult(socket, id, result) {
|
|
|
1535
1535
|
socket.send(JSON.stringify({
|
|
1536
1536
|
jsonrpc: "2.0",
|
|
1537
1537
|
id,
|
|
1538
|
-
result: result
|
|
1538
|
+
result: result === void 0 ? {} : result
|
|
1539
1539
|
}));
|
|
1540
1540
|
}
|
|
1541
1541
|
function sendError(socket, id, code, message) {
|
|
@@ -2930,6 +2930,10 @@ function createCodexSteeringQueue(params) {
|
|
|
2930
2930
|
});
|
|
2931
2931
|
clearBatchTimer();
|
|
2932
2932
|
const debounceMs = normalizeCodexSteerDebounceMs(options?.debounceMs);
|
|
2933
|
+
if (debounceMs === 0) {
|
|
2934
|
+
flushBatch().catch(() => void 0);
|
|
2935
|
+
return;
|
|
2936
|
+
}
|
|
2933
2937
|
batchTimer = setTimeout(() => {
|
|
2934
2938
|
batchTimer = void 0;
|
|
2935
2939
|
flushBatch().catch(() => void 0);
|
|
@@ -3052,6 +3056,12 @@ function createCodexAttemptTurnWatchController(params) {
|
|
|
3052
3056
|
scheduleCompletionIdleWatch();
|
|
3053
3057
|
scheduleTerminalIdleWatch();
|
|
3054
3058
|
}
|
|
3059
|
+
function isCompletionIdleTimeoutDueBeforeAttempt(timeoutMs) {
|
|
3060
|
+
if (params.isCompleted() || params.isTerminalTurnNotificationQueued() || params.signal.aborted || !completionIdleWatchArmed || params.getActiveAppServerTurnRequests() > 0) return false;
|
|
3061
|
+
const completionTimeoutMs = completionIdleTimeoutOverrideMs ?? turnCompletionIdleTimeoutMs;
|
|
3062
|
+
if (completionTimeoutMs > timeoutMs) return false;
|
|
3063
|
+
return Math.max(0, Date.now() - completionLastActivityAt) >= completionTimeoutMs;
|
|
3064
|
+
}
|
|
3055
3065
|
function recordAttemptProgress(reason, options) {
|
|
3056
3066
|
attemptIdleTimeoutOverrideMs = options?.attemptTimeoutMs !== void 0 ? resolveWatchTimeoutMs(options.attemptTimeoutMs) : void 0;
|
|
3057
3067
|
attemptLastProgressAt = completionLastActivityAt;
|
|
@@ -3105,6 +3115,10 @@ function createCodexAttemptTurnWatchController(params) {
|
|
|
3105
3115
|
scheduleAttemptIdleWatch();
|
|
3106
3116
|
return;
|
|
3107
3117
|
}
|
|
3118
|
+
if (isCompletionIdleTimeoutDueBeforeAttempt(timeoutMs)) {
|
|
3119
|
+
fireCompletionIdleTimeout();
|
|
3120
|
+
return;
|
|
3121
|
+
}
|
|
3108
3122
|
const timeout = {
|
|
3109
3123
|
kind: "progress",
|
|
3110
3124
|
idleMs,
|
|
@@ -3807,6 +3821,7 @@ const CODEX_PROMPT_TOTAL_INPUT_KEYS = [
|
|
|
3807
3821
|
];
|
|
3808
3822
|
const MAX_TOOL_OUTPUT_DELTA_MESSAGES_PER_ITEM = 20;
|
|
3809
3823
|
const TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 12e3;
|
|
3824
|
+
const MISSING_TOOL_RESULT_ERROR = "OpenClaw recorded a native Codex tool.call without a matching tool.result before the turn completed.";
|
|
3810
3825
|
const GENERATED_IMAGE_MEDIA_SUBDIR = "tool-image-generation";
|
|
3811
3826
|
const BYTES_PER_MB = 1024 * 1024;
|
|
3812
3827
|
const DEFAULT_GENERATED_IMAGE_MAX_BYTES = 6 * BYTES_PER_MB;
|
|
@@ -3853,6 +3868,10 @@ var CodexAppServerEventProjector = class {
|
|
|
3853
3868
|
this.toolTranscriptMessages = [];
|
|
3854
3869
|
this.toolTranscriptCallIds = /* @__PURE__ */ new Set();
|
|
3855
3870
|
this.toolTranscriptResultIds = /* @__PURE__ */ new Set();
|
|
3871
|
+
this.toolTranscriptNamesById = /* @__PURE__ */ new Map();
|
|
3872
|
+
this.toolTrajectoryCallIds = /* @__PURE__ */ new Set();
|
|
3873
|
+
this.toolTrajectoryResultIds = /* @__PURE__ */ new Set();
|
|
3874
|
+
this.toolTrajectoryNamesById = /* @__PURE__ */ new Map();
|
|
3856
3875
|
this.transcriptToolProgressCallIds = /* @__PURE__ */ new Set();
|
|
3857
3876
|
this.nativeGeneratedMediaUrls = /* @__PURE__ */ new Set();
|
|
3858
3877
|
this.nativeGeneratedMediaItemIds = /* @__PURE__ */ new Set();
|
|
@@ -3863,6 +3882,7 @@ var CodexAppServerEventProjector = class {
|
|
|
3863
3882
|
this.reasoningStarted = false;
|
|
3864
3883
|
this.reasoningEnded = false;
|
|
3865
3884
|
this.promptErrorSource = null;
|
|
3885
|
+
this.synthesizedMissingToolResultError = null;
|
|
3866
3886
|
this.aborted = false;
|
|
3867
3887
|
this.guardianReviewCount = 0;
|
|
3868
3888
|
this.completedCompactionCount = 0;
|
|
@@ -3936,6 +3956,7 @@ var CodexAppServerEventProjector = class {
|
|
|
3936
3956
|
const assistantTexts = this.collectAssistantTexts();
|
|
3937
3957
|
const reasoningText = collectReasoningTextValues(this.reasoningTextByGroup, this.reasoningItemOrder).join("\n\n");
|
|
3938
3958
|
const planText = collectTextValues(this.planTextByItem).join("\n\n");
|
|
3959
|
+
this.synthesizeMissingToolResults({ failClosed: !this.completedTurn || this.completedTurn.status !== "completed" || assistantTexts.length > 0 });
|
|
3939
3960
|
const lastAssistant = assistantTexts.length > 0 ? this.createAssistantMessage(assistantTexts.join("\n\n")) : void 0;
|
|
3940
3961
|
const turnId = this.turnId;
|
|
3941
3962
|
const messagesSnapshot = this.params.suppressNextUserMessagePersistence ? [] : [attachCodexMirrorIdentity(buildCodexUserPromptMessage(this.params), `${turnId}:prompt`)];
|
|
@@ -3944,7 +3965,7 @@ var CodexAppServerEventProjector = class {
|
|
|
3944
3965
|
messagesSnapshot.push(...this.toolTranscriptMessages);
|
|
3945
3966
|
if (lastAssistant) messagesSnapshot.push(attachCodexMirrorIdentity(lastAssistant, `${turnId}:assistant`));
|
|
3946
3967
|
const turnFailed = this.completedTurn?.status === "failed";
|
|
3947
|
-
const promptError = this.promptError ?? (turnFailed ? this.completedTurn?.error?.message ?? "codex app-server turn failed" : null);
|
|
3968
|
+
const promptError = this.promptError ?? this.synthesizedMissingToolResultError ?? (turnFailed ? this.completedTurn?.error?.message ?? "codex app-server turn failed" : null);
|
|
3948
3969
|
const agentHarnessResultClassification = classifyAgentHarnessTerminalOutcome({
|
|
3949
3970
|
assistantTexts,
|
|
3950
3971
|
reasoningText,
|
|
@@ -4595,6 +4616,8 @@ var CodexAppServerEventProjector = class {
|
|
|
4595
4616
|
}
|
|
4596
4617
|
recordToolTrajectoryEvent(params) {
|
|
4597
4618
|
if (params.phase === "start") {
|
|
4619
|
+
this.toolTrajectoryCallIds.add(params.item.id);
|
|
4620
|
+
this.toolTrajectoryNamesById.set(params.item.id, params.name);
|
|
4598
4621
|
this.options.trajectoryRecorder?.recordEvent("tool.call", {
|
|
4599
4622
|
threadId: this.threadId,
|
|
4600
4623
|
turnId: this.turnId,
|
|
@@ -4605,6 +4628,7 @@ var CodexAppServerEventProjector = class {
|
|
|
4605
4628
|
});
|
|
4606
4629
|
return;
|
|
4607
4630
|
}
|
|
4631
|
+
this.toolTrajectoryResultIds.add(params.item.id);
|
|
4608
4632
|
const toolResult = itemToolResult(params.item).result;
|
|
4609
4633
|
const output = itemOutputText(params.item, this.toolResultOutputTextByItem);
|
|
4610
4634
|
this.options.trajectoryRecorder?.recordEvent("tool.result", {
|
|
@@ -4775,6 +4799,7 @@ var CodexAppServerEventProjector = class {
|
|
|
4775
4799
|
recordToolTranscriptCall(params) {
|
|
4776
4800
|
if (!params.id || !params.name || this.toolTranscriptCallIds.has(params.id)) return;
|
|
4777
4801
|
this.toolTranscriptCallIds.add(params.id);
|
|
4802
|
+
this.toolTranscriptNamesById.set(params.id, params.name);
|
|
4778
4803
|
this.toolTranscriptArgumentsById.set(params.id, params.arguments);
|
|
4779
4804
|
if (!shouldEmitTranscriptToolProgress(params.name, params.arguments)) this.transcriptToolProgressSuppressedIds.add(params.id);
|
|
4780
4805
|
else this.transcriptToolProgressSuppressedIds.delete(params.id);
|
|
@@ -4787,6 +4812,51 @@ var CodexAppServerEventProjector = class {
|
|
|
4787
4812
|
this.emitTranscriptToolResultProgress(params);
|
|
4788
4813
|
this.toolTranscriptMessages.push(attachCodexMirrorIdentity(this.createToolResultMessage(params), `${this.turnId}:tool:${params.id}:result`));
|
|
4789
4814
|
}
|
|
4815
|
+
synthesizeMissingToolResults(params) {
|
|
4816
|
+
if (!params.failClosed) return;
|
|
4817
|
+
const missingTranscriptIds = [...this.toolTranscriptCallIds].filter((id) => !this.toolTranscriptResultIds.has(id));
|
|
4818
|
+
const missingTrajectoryIds = [...this.toolTrajectoryCallIds].filter((id) => !this.toolTrajectoryResultIds.has(id));
|
|
4819
|
+
if (missingTranscriptIds.length === 0 && missingTrajectoryIds.length === 0) return;
|
|
4820
|
+
for (const id of missingTranscriptIds) {
|
|
4821
|
+
const name = this.toolTranscriptNamesById.get(id) ?? this.toolTrajectoryNamesById.get(id);
|
|
4822
|
+
if (!name) continue;
|
|
4823
|
+
this.recordToolTranscriptResult({
|
|
4824
|
+
id,
|
|
4825
|
+
name,
|
|
4826
|
+
text: formatMissingToolResultError({
|
|
4827
|
+
id,
|
|
4828
|
+
name
|
|
4829
|
+
}),
|
|
4830
|
+
isError: true
|
|
4831
|
+
});
|
|
4832
|
+
}
|
|
4833
|
+
for (const id of missingTrajectoryIds) {
|
|
4834
|
+
const name = this.toolTrajectoryNamesById.get(id) ?? this.toolTranscriptNamesById.get(id);
|
|
4835
|
+
if (!name) continue;
|
|
4836
|
+
this.toolTrajectoryResultIds.add(id);
|
|
4837
|
+
const text = formatMissingToolResultError({
|
|
4838
|
+
id,
|
|
4839
|
+
name
|
|
4840
|
+
});
|
|
4841
|
+
this.options.trajectoryRecorder?.recordEvent("tool.result", {
|
|
4842
|
+
threadId: this.threadId,
|
|
4843
|
+
turnId: this.turnId,
|
|
4844
|
+
itemId: id,
|
|
4845
|
+
toolCallId: id,
|
|
4846
|
+
name,
|
|
4847
|
+
status: "failed",
|
|
4848
|
+
isError: true,
|
|
4849
|
+
result: {
|
|
4850
|
+
status: "failed",
|
|
4851
|
+
reason: "missing_tool_result"
|
|
4852
|
+
},
|
|
4853
|
+
output: text
|
|
4854
|
+
});
|
|
4855
|
+
}
|
|
4856
|
+
const missingCount = new Set([...missingTranscriptIds, ...missingTrajectoryIds]).size;
|
|
4857
|
+
this.synthesizedMissingToolResultError = missingCount === 1 ? MISSING_TOOL_RESULT_ERROR : `${MISSING_TOOL_RESULT_ERROR} missingToolResultCount=${missingCount}`;
|
|
4858
|
+
this.promptErrorSource = this.promptErrorSource ?? "prompt";
|
|
4859
|
+
}
|
|
4790
4860
|
emitTranscriptToolCallProgress(params) {
|
|
4791
4861
|
if (!shouldEmitTranscriptToolProgress(params.name, params.arguments)) return;
|
|
4792
4862
|
this.transcriptToolProgressCallIds.add(params.id);
|
|
@@ -5153,6 +5223,9 @@ function itemStatus(item) {
|
|
|
5153
5223
|
if (status === "inProgress" || status === "running") return "running";
|
|
5154
5224
|
return "completed";
|
|
5155
5225
|
}
|
|
5226
|
+
function formatMissingToolResultError(params) {
|
|
5227
|
+
return `${MISSING_TOOL_RESULT_ERROR} toolCallId=${params.id}; toolName=${params.name}`;
|
|
5228
|
+
}
|
|
5156
5229
|
function isNonSuccessItemStatus(status) {
|
|
5157
5230
|
return status === "failed" || status === "blocked";
|
|
5158
5231
|
}
|
|
@@ -7458,7 +7531,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
7458
7531
|
onCodexAppServerEvent: (event) => emitCodexAppServerEvent(params, event)
|
|
7459
7532
|
}),
|
|
7460
7533
|
signal: runAbortController.signal,
|
|
7461
|
-
loading:
|
|
7534
|
+
loading: resolveCodexDynamicToolsLoadingForModel(pluginConfig, params.modelId),
|
|
7462
7535
|
directToolNames: shouldForceMessageTool(params) ? ["message"] : [],
|
|
7463
7536
|
hookContext: {
|
|
7464
7537
|
agentId: sessionAgentId,
|
|
@@ -8480,6 +8553,23 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8480
8553
|
});
|
|
8481
8554
|
else {
|
|
8482
8555
|
thread = await restartContextEngineCodexThread();
|
|
8556
|
+
{
|
|
8557
|
+
const retryBinding = await readCodexAppServerBinding(activeSessionFile);
|
|
8558
|
+
if (retryBinding && retryBinding.threadId === thread.threadId && retryBinding.contextEngine?.projection) {
|
|
8559
|
+
const { schemaVersion: _schemaVersion, sessionFile: _boundSessionFile, updatedAt: _updatedAt, ...bindingForWrite } = retryBinding;
|
|
8560
|
+
await writeCodexAppServerBinding(activeSessionFile, {
|
|
8561
|
+
...bindingForWrite,
|
|
8562
|
+
contextEngine: bindingForWrite.contextEngine ? {
|
|
8563
|
+
...bindingForWrite.contextEngine,
|
|
8564
|
+
projection: void 0
|
|
8565
|
+
} : void 0
|
|
8566
|
+
});
|
|
8567
|
+
embeddedAgentLog.info("codex app-server cleared stale context-engine projection after overflow retry", {
|
|
8568
|
+
threadId: thread.threadId,
|
|
8569
|
+
previousEpoch: retryBinding.contextEngine.projection.epoch
|
|
8570
|
+
});
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8483
8573
|
emitCodexAppServerEvent(params, {
|
|
8484
8574
|
stream: "codex_app_server.lifecycle",
|
|
8485
8575
|
data: {
|
|
@@ -51,6 +51,7 @@ async function readCodexAppServerBinding(sessionFile, lookup = {}) {
|
|
|
51
51
|
sandbox: readSandboxMode(parsed.sandbox),
|
|
52
52
|
serviceTier: readServiceTier(parsed.serviceTier),
|
|
53
53
|
dynamicToolsFingerprint: typeof parsed.dynamicToolsFingerprint === "string" ? parsed.dynamicToolsFingerprint : void 0,
|
|
54
|
+
dynamicToolsContainDeferred: typeof parsed.dynamicToolsContainDeferred === "boolean" ? parsed.dynamicToolsContainDeferred : void 0,
|
|
54
55
|
userMcpServersFingerprint: typeof parsed.userMcpServersFingerprint === "string" ? parsed.userMcpServersFingerprint : void 0,
|
|
55
56
|
mcpServersFingerprint: typeof parsed.mcpServersFingerprint === "string" ? parsed.mcpServersFingerprint : void 0,
|
|
56
57
|
nativeHookRelayGeneration: typeof parsed.nativeHookRelayGeneration === "string" && parsed.nativeHookRelayGeneration.trim() ? parsed.nativeHookRelayGeneration : void 0,
|
|
@@ -88,6 +89,7 @@ async function writeCodexAppServerBinding(sessionFile, binding, lookup = {}) {
|
|
|
88
89
|
sandbox: binding.sandbox,
|
|
89
90
|
serviceTier: binding.serviceTier,
|
|
90
91
|
dynamicToolsFingerprint: binding.dynamicToolsFingerprint,
|
|
92
|
+
dynamicToolsContainDeferred: binding.dynamicToolsContainDeferred,
|
|
91
93
|
userMcpServersFingerprint: binding.userMcpServersFingerprint,
|
|
92
94
|
mcpServersFingerprint: binding.mcpServersFingerprint,
|
|
93
95
|
nativeHookRelayGeneration: binding.nativeHookRelayGeneration,
|
|
@@ -713,7 +713,11 @@ async function createIsolatedCodexAppServerClient(options) {
|
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
function resetSharedCodexAppServerClientForTests() {
|
|
716
|
-
getSharedCodexAppServerClientState()
|
|
716
|
+
const state = getSharedCodexAppServerClientState();
|
|
717
|
+
const clients = collectSharedClients(state);
|
|
718
|
+
state.clients.clear();
|
|
719
|
+
state.leasedReleases = /* @__PURE__ */ new WeakMap();
|
|
720
|
+
for (const client of clients) client.close();
|
|
717
721
|
}
|
|
718
722
|
function clearSharedCodexAppServerClient() {
|
|
719
723
|
const state = getSharedCodexAppServerClientState();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as resolveCodexAppServerRuntimeOptions, h as shouldAutoApproveCodexAppServerApprovals, u as readCodexPluginConfig } from "./config-AlzuNKCY.js";
|
|
2
2
|
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-DIt7cXIp.js";
|
|
3
3
|
import { i as isCodexAppServerApprovalRequest, l as isJsonObject } from "./client-BnOmn0y-.js";
|
|
4
|
-
import { d as resolveReasoningEffort, g as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-
|
|
5
|
-
import { a as readCodexAppServerBinding } from "./session-binding-
|
|
4
|
+
import { O as resolveCodexDynamicToolsLoading, T as filterCodexDynamicTools, d as resolveReasoningEffort, g as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-6nrEQZMV.js";
|
|
5
|
+
import { a as readCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
6
6
|
import { h as formatCodexUsageLimitErrorMessage, i as readCodexNotificationTurnId, r as readCodexNotificationThreadId } from "./notification-correlation-BykOI_jh.js";
|
|
7
|
-
import { a as releaseLeasedSharedCodexAppServerClient, i as getLeasedSharedCodexAppServerClient, l as refreshCodexAppServerAuthTokens } from "./shared-client-
|
|
7
|
+
import { a as releaseLeasedSharedCodexAppServerClient, i as getLeasedSharedCodexAppServerClient, l as refreshCodexAppServerAuthTokens } from "./shared-client-DUWLidr5.js";
|
|
8
8
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DMCJlzmz.js";
|
|
9
|
-
import { d as emitDynamicToolErrorDiagnostic, f as emitDynamicToolStartedDiagnostic, h as
|
|
9
|
+
import { d as emitDynamicToolErrorDiagnostic, f as emitDynamicToolStartedDiagnostic, h as handleCodexAppServerApprovalRequest, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerElicitationRequest, m as filterToolsForVisionInputs, p as emitDynamicToolTerminalDiagnostic, r as buildCodexNativeHookRelayConfig, t as CODEX_NATIVE_HOOK_RELAY_EVENTS, u as createCodexDynamicToolBridge } from "./native-hook-relay-CIJt8cLN.js";
|
|
10
10
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
11
11
|
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
12
|
//#region extensions/codex/src/app-server/side-question.ts
|
|
@@ -3,7 +3,7 @@ import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartRespon
|
|
|
3
3
|
import { a as isCodexAppServerConnectionClosedError, l as isJsonObject, n as CodexAppServerRpcError } from "./client-BnOmn0y-.js";
|
|
4
4
|
import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
|
|
5
5
|
import { isModernCodexModel } from "./provider.js";
|
|
6
|
-
import { a as readCodexAppServerBinding, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
6
|
+
import { a as readCodexAppServerBinding, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
|
|
7
7
|
import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
9
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -227,6 +227,59 @@ function truncateOlderContext(text, maxChars) {
|
|
|
227
227
|
return `${marker}${text.slice(text.length - tailChars).trimStart()}`;
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|
|
230
|
+
//#region extensions/codex/src/app-server/dynamic-tool-profile.ts
|
|
231
|
+
const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
|
|
232
|
+
"read",
|
|
233
|
+
"write",
|
|
234
|
+
"edit",
|
|
235
|
+
"apply_patch",
|
|
236
|
+
"exec",
|
|
237
|
+
"process",
|
|
238
|
+
"update_plan",
|
|
239
|
+
"tool_call",
|
|
240
|
+
"tool_describe",
|
|
241
|
+
"tool_search",
|
|
242
|
+
"tool_search_code"
|
|
243
|
+
];
|
|
244
|
+
const DYNAMIC_TOOL_NAME_ALIASES = {
|
|
245
|
+
bash: "exec",
|
|
246
|
+
"apply-patch": "apply_patch"
|
|
247
|
+
};
|
|
248
|
+
function normalizeCodexDynamicToolName(name) {
|
|
249
|
+
const normalized = name.trim().toLowerCase();
|
|
250
|
+
return DYNAMIC_TOOL_NAME_ALIASES[normalized] ?? normalized;
|
|
251
|
+
}
|
|
252
|
+
function isForcedPrivateQaCodexRuntime(env = process.env) {
|
|
253
|
+
return env.OPENCLAW_BUILD_PRIVATE_QA === "1" && env.OPENCLAW_QA_FORCE_RUNTIME?.trim().toLowerCase() === "codex";
|
|
254
|
+
}
|
|
255
|
+
function resolveCodexDynamicToolsLoading(config, env = process.env) {
|
|
256
|
+
return isForcedPrivateQaCodexRuntime(env) ? "direct" : config.codexDynamicToolsLoading ?? "searchable";
|
|
257
|
+
}
|
|
258
|
+
function normalizeCodexModelId(modelId) {
|
|
259
|
+
const normalized = modelId?.trim().toLowerCase();
|
|
260
|
+
if (!normalized) return "";
|
|
261
|
+
return normalized.includes("/") ? normalized.split("/").at(-1) : normalized;
|
|
262
|
+
}
|
|
263
|
+
function shouldUseDirectCodexDynamicToolsForModel(modelId) {
|
|
264
|
+
return shouldDisableCodexToolSearchForModel(modelId);
|
|
265
|
+
}
|
|
266
|
+
function shouldDisableCodexToolSearchForModel(modelId) {
|
|
267
|
+
return normalizeCodexModelId(modelId) === "gpt-5.4-nano";
|
|
268
|
+
}
|
|
269
|
+
function resolveCodexDynamicToolsLoadingForModel(config, modelId, env = process.env) {
|
|
270
|
+
const loading = resolveCodexDynamicToolsLoading(config, env);
|
|
271
|
+
return loading === "searchable" && shouldUseDirectCodexDynamicToolsForModel(modelId) ? "direct" : loading;
|
|
272
|
+
}
|
|
273
|
+
function filterCodexDynamicTools(tools, config, env = process.env) {
|
|
274
|
+
const excludes = /* @__PURE__ */ new Set();
|
|
275
|
+
if (!isForcedPrivateQaCodexRuntime(env)) for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) excludes.add(name);
|
|
276
|
+
for (const name of config.codexDynamicToolsExclude ?? []) {
|
|
277
|
+
const trimmed = normalizeCodexDynamicToolName(name);
|
|
278
|
+
if (trimmed) excludes.add(trimmed);
|
|
279
|
+
}
|
|
280
|
+
return excludes.size === 0 ? tools : tools.filter((tool) => !excludes.has(normalizeCodexDynamicToolName(tool.name)));
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
230
283
|
//#region extensions/codex/src/app-server/image-payload-sanitizer.ts
|
|
231
284
|
const IMAGE_OMITTED_TEXT = "omitted image payload: invalid inline image data";
|
|
232
285
|
function sanitizeInlineImageDataUrl$1(imageUrl) {
|
|
@@ -1037,38 +1090,50 @@ const CODEX_CODE_MODE_DISABLED_THREAD_CONFIG = {
|
|
|
1037
1090
|
"features.code_mode_only": false
|
|
1038
1091
|
};
|
|
1039
1092
|
const CODEX_LIGHTWEIGHT_CONTEXT_THREAD_CONFIG = { project_doc_max_bytes: 0 };
|
|
1093
|
+
const CODEX_TOOL_SEARCH_UNSUPPORTED_THREAD_CONFIG = { "features.multi_agent": false };
|
|
1040
1094
|
const CODEX_THREAD_LIFECYCLE_TIMING_WARN_TOTAL_MS = 1e3;
|
|
1041
1095
|
const CODEX_THREAD_LIFECYCLE_TIMING_WARN_STAGE_MS = 500;
|
|
1096
|
+
function shouldWarnCodexThreadLifecycleTimingSummary(summary, options = {}) {
|
|
1097
|
+
const totalThresholdMs = options.totalThresholdMs ?? CODEX_THREAD_LIFECYCLE_TIMING_WARN_TOTAL_MS;
|
|
1098
|
+
const stageThresholdMs = options.stageThresholdMs ?? CODEX_THREAD_LIFECYCLE_TIMING_WARN_STAGE_MS;
|
|
1099
|
+
return summary.totalMs >= totalThresholdMs || summary.spans.some((span) => span.durationMs >= stageThresholdMs);
|
|
1100
|
+
}
|
|
1101
|
+
function formatCodexThreadLifecycleTimingSummary(params) {
|
|
1102
|
+
const spans = params.summary.spans.length > 0 ? params.summary.spans.map((span) => `${span.name}:${span.durationMs}ms@${span.elapsedMs}ms`).join(",") : "none";
|
|
1103
|
+
return `[trace:codex-app-server] thread lifecycle: runId=${params.runId} sessionId=${params.sessionId} sessionKey=${params.sessionKey ?? "unknown"} action=${params.action} totalMs=${params.summary.totalMs} stages=${spans}`;
|
|
1104
|
+
}
|
|
1042
1105
|
function createCodexThreadLifecycleTimingTracker(options = {}) {
|
|
1043
|
-
|
|
1106
|
+
const log = options.log ?? embeddedAgentLog;
|
|
1107
|
+
if (!options.enabled && log.isEnabled?.("trace") !== true) return {
|
|
1044
1108
|
async measure(_name, run) {
|
|
1045
1109
|
return await run();
|
|
1046
1110
|
},
|
|
1047
1111
|
measureSync(_name, run) {
|
|
1048
1112
|
return run();
|
|
1049
1113
|
},
|
|
1050
|
-
|
|
1114
|
+
mark() {},
|
|
1115
|
+
logSummary() {}
|
|
1051
1116
|
};
|
|
1052
|
-
const
|
|
1117
|
+
const now = options.now ?? Date.now;
|
|
1118
|
+
const startedAt = now();
|
|
1053
1119
|
let didLog = false;
|
|
1054
1120
|
const spans = [];
|
|
1055
1121
|
const toMs = (value) => Math.max(0, Math.round(value));
|
|
1056
1122
|
const record = (name, spanStartedAt) => {
|
|
1123
|
+
const currentAt = now();
|
|
1057
1124
|
spans.push({
|
|
1058
1125
|
name,
|
|
1059
|
-
durationMs: toMs(
|
|
1060
|
-
elapsedMs: toMs(
|
|
1126
|
+
durationMs: toMs(currentAt - spanStartedAt),
|
|
1127
|
+
elapsedMs: toMs(currentAt - startedAt)
|
|
1061
1128
|
});
|
|
1062
1129
|
};
|
|
1063
1130
|
const snapshot = () => ({
|
|
1064
|
-
totalMs: toMs(
|
|
1131
|
+
totalMs: toMs(now() - startedAt),
|
|
1065
1132
|
spans: spans.slice()
|
|
1066
1133
|
});
|
|
1067
|
-
const shouldLog = (summary) => summary.totalMs >= CODEX_THREAD_LIFECYCLE_TIMING_WARN_TOTAL_MS || summary.spans.some((span) => span.durationMs >= CODEX_THREAD_LIFECYCLE_TIMING_WARN_STAGE_MS);
|
|
1068
|
-
const formatSpans = (summary) => summary.spans.length > 0 ? summary.spans.map((span) => `${span.name}:${span.durationMs}ms@${span.elapsedMs}ms`).join(",") : "none";
|
|
1069
1134
|
return {
|
|
1070
1135
|
async measure(name, run) {
|
|
1071
|
-
const spanStartedAt =
|
|
1136
|
+
const spanStartedAt = now();
|
|
1072
1137
|
try {
|
|
1073
1138
|
return await run();
|
|
1074
1139
|
} finally {
|
|
@@ -1076,19 +1141,30 @@ function createCodexThreadLifecycleTimingTracker(options = {}) {
|
|
|
1076
1141
|
}
|
|
1077
1142
|
},
|
|
1078
1143
|
measureSync(name, run) {
|
|
1079
|
-
const spanStartedAt =
|
|
1144
|
+
const spanStartedAt = now();
|
|
1080
1145
|
try {
|
|
1081
1146
|
return run();
|
|
1082
1147
|
} finally {
|
|
1083
1148
|
record(name, spanStartedAt);
|
|
1084
1149
|
}
|
|
1085
1150
|
},
|
|
1086
|
-
|
|
1151
|
+
mark(name) {
|
|
1152
|
+
record(name, now());
|
|
1153
|
+
},
|
|
1154
|
+
logSummary(params) {
|
|
1087
1155
|
if (didLog) return;
|
|
1088
1156
|
const summary = snapshot();
|
|
1089
|
-
|
|
1157
|
+
const shouldWarn = shouldWarnCodexThreadLifecycleTimingSummary(summary, options);
|
|
1158
|
+
if (!shouldWarn && !log.isEnabled?.("trace")) return;
|
|
1090
1159
|
didLog = true;
|
|
1091
|
-
|
|
1160
|
+
const message = formatCodexThreadLifecycleTimingSummary({
|
|
1161
|
+
runId: params.runId,
|
|
1162
|
+
sessionId: params.sessionId,
|
|
1163
|
+
sessionKey: params.sessionKey,
|
|
1164
|
+
action: params.action,
|
|
1165
|
+
summary
|
|
1166
|
+
});
|
|
1167
|
+
const meta = {
|
|
1092
1168
|
runId: params.runId,
|
|
1093
1169
|
sessionId: params.sessionId,
|
|
1094
1170
|
sessionKey: params.sessionKey,
|
|
@@ -1096,18 +1172,24 @@ function createCodexThreadLifecycleTimingTracker(options = {}) {
|
|
|
1096
1172
|
threadId: params.threadId,
|
|
1097
1173
|
totalMs: summary.totalMs,
|
|
1098
1174
|
spans: summary.spans
|
|
1099
|
-
}
|
|
1175
|
+
};
|
|
1176
|
+
if (shouldWarn) log.warn(message, meta);
|
|
1177
|
+
else log.trace(message, meta);
|
|
1100
1178
|
}
|
|
1101
1179
|
};
|
|
1102
1180
|
}
|
|
1103
1181
|
async function startOrResumeThread(params) {
|
|
1104
|
-
const lifecycleTiming = createCodexThreadLifecycleTimingTracker({
|
|
1105
|
-
|
|
1106
|
-
|
|
1182
|
+
const lifecycleTiming = createCodexThreadLifecycleTimingTracker({
|
|
1183
|
+
...params.timing,
|
|
1184
|
+
enabled: params.timing?.enabled ?? isCodexAppServerProfilerEnabled(params.params.config)
|
|
1185
|
+
});
|
|
1186
|
+
const dynamicToolsFingerprint = lifecycleTiming.measureSync("dynamic-tools-fingerprint", () => fingerprintDynamicTools(params.dynamicTools));
|
|
1187
|
+
const dynamicToolsContainDeferred = params.dynamicTools.some((tool) => tool.deferLoading === true);
|
|
1188
|
+
const contextEngineBinding = lifecycleTiming.measureSync("context-engine-binding", () => buildContextEngineBinding(params.params, params.contextEngineProjection));
|
|
1107
1189
|
const userMcpServersConfigPatch = params.userMcpServersEnabled === false ? void 0 : buildCodexUserMcpServersThreadConfigPatch(params.params.config, { agentId: params.agentId ?? params.params.agentId });
|
|
1108
1190
|
const userMcpServersFingerprint = fingerprintUserMcpServersConfigPatch(userMcpServersConfigPatch);
|
|
1109
1191
|
const environmentSelectionFingerprint = fingerprintEnvironmentSelection(params.environmentSelection);
|
|
1110
|
-
let binding = await lifecycleTiming.measure("
|
|
1192
|
+
let binding = await lifecycleTiming.measure("read-binding", () => readCodexAppServerBinding(params.params.sessionFile, {
|
|
1111
1193
|
authProfileStore: params.params.authProfileStore,
|
|
1112
1194
|
agentDir: params.params.agentDir,
|
|
1113
1195
|
config: params.params.config
|
|
@@ -1173,7 +1255,7 @@ async function startOrResumeThread(params) {
|
|
|
1173
1255
|
binding,
|
|
1174
1256
|
pluginThreadConfig: params.pluginThreadConfig
|
|
1175
1257
|
})) try {
|
|
1176
|
-
prebuiltPluginThreadConfig = await lifecycleTiming.measure("
|
|
1258
|
+
prebuiltPluginThreadConfig = await lifecycleTiming.measure("plugin-config-recovery", () => params.pluginThreadConfig?.build());
|
|
1177
1259
|
pluginBindingStale = prebuiltPluginThreadConfig?.fingerprint !== binding.pluginAppsFingerprint;
|
|
1178
1260
|
} catch (error) {
|
|
1179
1261
|
embeddedAgentLog.warn("codex app-server plugin app config recovery check failed", {
|
|
@@ -1192,6 +1274,13 @@ async function startOrResumeThread(params) {
|
|
|
1192
1274
|
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
1193
1275
|
binding = void 0;
|
|
1194
1276
|
}
|
|
1277
|
+
if (binding?.threadId) {
|
|
1278
|
+
if (binding.dynamicToolsFingerprint && params.dynamicTools.length > 0 && binding.dynamicToolsContainDeferred !== dynamicToolsContainDeferred && (binding.dynamicToolsContainDeferred !== void 0 || !dynamicToolsContainDeferred)) {
|
|
1279
|
+
embeddedAgentLog.debug("codex app-server dynamic tool loading changed; starting a new thread", { threadId: binding.threadId });
|
|
1280
|
+
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
1281
|
+
binding = void 0;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1195
1284
|
if (binding?.threadId) if (binding.dynamicToolsFingerprint && !areDynamicToolFingerprintsCompatible(binding.dynamicToolsFingerprint, dynamicToolsFingerprint)) {
|
|
1196
1285
|
preserveExistingBinding = shouldStartTransientNoToolThread({
|
|
1197
1286
|
previous: binding.dynamicToolsFingerprint,
|
|
@@ -1212,7 +1301,7 @@ async function startOrResumeThread(params) {
|
|
|
1212
1301
|
nativeHookRelayGeneration: params.nativeHookRelayGeneration
|
|
1213
1302
|
};
|
|
1214
1303
|
const resumeConfig = mergeCodexThreadConfigs(params.config, userMcpServersConfigPatch, finalConfigPatch.configPatch);
|
|
1215
|
-
const resumeParams = lifecycleTiming.measureSync("
|
|
1304
|
+
const resumeParams = lifecycleTiming.measureSync("thread-resume-params", () => buildThreadResumeParams(params.params, {
|
|
1216
1305
|
threadId: binding.threadId,
|
|
1217
1306
|
authProfileId,
|
|
1218
1307
|
appServer: params.appServer,
|
|
@@ -1222,7 +1311,7 @@ async function startOrResumeThread(params) {
|
|
|
1222
1311
|
nativeCodeModeEnabled: params.nativeCodeModeEnabled,
|
|
1223
1312
|
nativeCodeModeOnlyEnabled: params.nativeCodeModeOnlyEnabled
|
|
1224
1313
|
}));
|
|
1225
|
-
const response = assertCodexThreadResumeResponse(await lifecycleTiming.measure("
|
|
1314
|
+
const response = assertCodexThreadResumeResponse(await lifecycleTiming.measure("thread-resume-request", () => params.client.request("thread/resume", resumeParams, { signal: params.signal })));
|
|
1226
1315
|
throwIfAborted();
|
|
1227
1316
|
const boundAuthProfileId = authProfileId;
|
|
1228
1317
|
const fallbackModelProvider = resolveCodexAppServerModelProvider({
|
|
@@ -1233,13 +1322,14 @@ async function startOrResumeThread(params) {
|
|
|
1233
1322
|
config: params.params.config
|
|
1234
1323
|
});
|
|
1235
1324
|
const nextMcpServersFingerprint = params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : binding.mcpServersFingerprint;
|
|
1236
|
-
await lifecycleTiming.measure("
|
|
1325
|
+
await lifecycleTiming.measure("thread-resume-write-binding", () => writeCodexAppServerBinding(params.params.sessionFile, {
|
|
1237
1326
|
threadId: response.thread.id,
|
|
1238
1327
|
cwd: params.cwd,
|
|
1239
1328
|
authProfileId: boundAuthProfileId,
|
|
1240
1329
|
model: params.params.modelId,
|
|
1241
1330
|
modelProvider: response.modelProvider ?? fallbackModelProvider,
|
|
1242
1331
|
dynamicToolsFingerprint,
|
|
1332
|
+
dynamicToolsContainDeferred,
|
|
1243
1333
|
userMcpServersFingerprint,
|
|
1244
1334
|
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
1245
1335
|
nativeHookRelayGeneration: finalConfigPatch.nativeHookRelayGeneration ?? binding.nativeHookRelayGeneration,
|
|
@@ -1263,7 +1353,8 @@ async function startOrResumeThread(params) {
|
|
|
1263
1353
|
fingerprint: contextEngineBinding.projection?.fingerprint,
|
|
1264
1354
|
action: "resumed"
|
|
1265
1355
|
});
|
|
1266
|
-
lifecycleTiming.
|
|
1356
|
+
lifecycleTiming.mark("thread-ready");
|
|
1357
|
+
lifecycleTiming.logSummary({
|
|
1267
1358
|
runId: params.params.runId,
|
|
1268
1359
|
sessionId: params.params.sessionId,
|
|
1269
1360
|
sessionKey: params.params.sessionKey,
|
|
@@ -1278,6 +1369,7 @@ async function startOrResumeThread(params) {
|
|
|
1278
1369
|
model: params.params.modelId,
|
|
1279
1370
|
modelProvider: response.modelProvider ?? fallbackModelProvider,
|
|
1280
1371
|
dynamicToolsFingerprint,
|
|
1372
|
+
dynamicToolsContainDeferred,
|
|
1281
1373
|
userMcpServersFingerprint,
|
|
1282
1374
|
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
1283
1375
|
nativeHookRelayGeneration: finalConfigPatch.nativeHookRelayGeneration ?? binding.nativeHookRelayGeneration,
|
|
@@ -1293,13 +1385,13 @@ async function startOrResumeThread(params) {
|
|
|
1293
1385
|
embeddedAgentLog.warn("codex app-server thread resume failed; starting a new thread", { error });
|
|
1294
1386
|
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
1295
1387
|
}
|
|
1296
|
-
const pluginThreadConfig = params.pluginThreadConfig?.enabled ? prebuiltPluginThreadConfig ?? await lifecycleTiming.measure("
|
|
1388
|
+
const pluginThreadConfig = params.pluginThreadConfig?.enabled ? prebuiltPluginThreadConfig ?? await lifecycleTiming.measure("plugin-config-build", () => params.pluginThreadConfig?.build()) : void 0;
|
|
1297
1389
|
const finalConfigPatch = params.buildFinalConfigPatch?.({ action: "start" }) ?? {
|
|
1298
1390
|
configPatch: params.finalConfigPatch,
|
|
1299
1391
|
nativeHookRelayGeneration: params.nativeHookRelayGeneration
|
|
1300
1392
|
};
|
|
1301
|
-
const config = lifecycleTiming.measureSync("
|
|
1302
|
-
const startParams = lifecycleTiming.measureSync("
|
|
1393
|
+
const config = lifecycleTiming.measureSync("merge-thread-config", () => mergeCodexThreadConfigs(params.config, userMcpServersConfigPatch, pluginThreadConfig?.configPatch, finalConfigPatch.configPatch));
|
|
1394
|
+
const startParams = lifecycleTiming.measureSync("thread-start-params", () => buildThreadStartParams(params.params, {
|
|
1303
1395
|
cwd: params.cwd,
|
|
1304
1396
|
dynamicTools: params.dynamicTools,
|
|
1305
1397
|
appServer: params.appServer,
|
|
@@ -1309,7 +1401,7 @@ async function startOrResumeThread(params) {
|
|
|
1309
1401
|
nativeCodeModeOnlyEnabled: params.nativeCodeModeOnlyEnabled,
|
|
1310
1402
|
environmentSelection: params.environmentSelection
|
|
1311
1403
|
}));
|
|
1312
|
-
const response = assertCodexThreadStartResponse(await lifecycleTiming.measure("
|
|
1404
|
+
const response = assertCodexThreadStartResponse(await lifecycleTiming.measure("thread-start-request", async () => {
|
|
1313
1405
|
try {
|
|
1314
1406
|
return await params.client.request("thread/start", startParams, { signal: params.signal });
|
|
1315
1407
|
} catch (error) {
|
|
@@ -1328,13 +1420,14 @@ async function startOrResumeThread(params) {
|
|
|
1328
1420
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1329
1421
|
const nextMcpServersFingerprint = params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : void 0;
|
|
1330
1422
|
if (!preserveExistingBinding) {
|
|
1331
|
-
await lifecycleTiming.measure("
|
|
1423
|
+
await lifecycleTiming.measure("thread-start-write-binding", () => writeCodexAppServerBinding(params.params.sessionFile, {
|
|
1332
1424
|
threadId: response.thread.id,
|
|
1333
1425
|
cwd: params.cwd,
|
|
1334
1426
|
authProfileId: params.params.authProfileId,
|
|
1335
1427
|
model: response.model ?? params.params.modelId,
|
|
1336
1428
|
modelProvider: response.modelProvider ?? modelProvider,
|
|
1337
1429
|
dynamicToolsFingerprint,
|
|
1430
|
+
dynamicToolsContainDeferred,
|
|
1338
1431
|
userMcpServersFingerprint,
|
|
1339
1432
|
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
1340
1433
|
nativeHookRelayGeneration: finalConfigPatch.nativeHookRelayGeneration,
|
|
@@ -1359,7 +1452,8 @@ async function startOrResumeThread(params) {
|
|
|
1359
1452
|
action: rotatedContextEngineBinding ? "rotated" : "started"
|
|
1360
1453
|
});
|
|
1361
1454
|
}
|
|
1362
|
-
lifecycleTiming.
|
|
1455
|
+
lifecycleTiming.mark("thread-ready");
|
|
1456
|
+
lifecycleTiming.logSummary({
|
|
1363
1457
|
runId: params.params.runId,
|
|
1364
1458
|
sessionId: params.params.sessionId,
|
|
1365
1459
|
sessionKey: params.params.sessionKey,
|
|
@@ -1375,6 +1469,7 @@ async function startOrResumeThread(params) {
|
|
|
1375
1469
|
model: response.model ?? params.params.modelId,
|
|
1376
1470
|
modelProvider: response.modelProvider ?? modelProvider,
|
|
1377
1471
|
dynamicToolsFingerprint,
|
|
1472
|
+
dynamicToolsContainDeferred,
|
|
1378
1473
|
userMcpServersFingerprint,
|
|
1379
1474
|
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
1380
1475
|
nativeHookRelayGeneration: finalConfigPatch.nativeHookRelayGeneration,
|
|
@@ -1522,7 +1617,8 @@ function buildCodexRuntimeThreadConfig(config, options = {}) {
|
|
|
1522
1617
|
return mergeCodexThreadConfigs(codeModeConfig, config) ?? { ...codeModeConfig };
|
|
1523
1618
|
}
|
|
1524
1619
|
function buildCodexRuntimeThreadConfigForRun(params, config, options = {}) {
|
|
1525
|
-
const
|
|
1620
|
+
const baseConfig = buildCodexRuntimeThreadConfig(config, options);
|
|
1621
|
+
const runtimeConfig = mergeCodexThreadConfigs(baseConfig, shouldDisableCodexToolSearchForModel(params.modelId) ? CODEX_TOOL_SEARCH_UNSUPPORTED_THREAD_CONFIG : void 0) ?? baseConfig;
|
|
1526
1622
|
if (params.bootstrapContextMode !== "lightweight") return runtimeConfig;
|
|
1527
1623
|
return mergeCodexThreadConfigs(runtimeConfig, CODEX_LIGHTWEIGHT_CONTEXT_THREAD_CONFIG) ?? {
|
|
1528
1624
|
...runtimeConfig,
|
|
@@ -1624,7 +1720,7 @@ function fingerprintDynamicToolSpec(tool) {
|
|
|
1624
1720
|
if (!isJsonObject(tool)) return stabilizeJsonValue(tool);
|
|
1625
1721
|
const stable = {};
|
|
1626
1722
|
for (const [key, child] of Object.entries(tool).toSorted(([left], [right]) => left.localeCompare(right))) {
|
|
1627
|
-
if (key === "description"
|
|
1723
|
+
if (key === "description") continue;
|
|
1628
1724
|
stable[key] = stabilizeJsonValue(child);
|
|
1629
1725
|
}
|
|
1630
1726
|
return stable;
|
|
@@ -1707,4 +1803,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
|
|
|
1707
1803
|
return null;
|
|
1708
1804
|
}
|
|
1709
1805
|
//#endregion
|
|
1710
|
-
export { sanitizeCodexHistoryImagePayloads as C,
|
|
1806
|
+
export { projectContextEngineAssemblyForCodex as A, sanitizeCodexHistoryImagePayloads as C, normalizeCodexDynamicToolName as D, isForcedPrivateQaCodexRuntime as E, resolveCodexContextEngineProjectionReserveTokens as M, resolveCodexDynamicToolsLoading as O, invalidInlineImageText as S, filterCodexDynamicTools as T, shouldBuildCodexPluginThreadConfig as _, buildDeveloperInstructions as a, buildCodexAppInventoryCacheKey as b, codexDynamicToolsFingerprint as c, resolveReasoningEffort as d, startOrResumeThread as f, mergeCodexThreadConfigs as g, buildCodexPluginThreadConfigInputFingerprint as h, buildContextEngineBinding as i, resolveCodexContextEngineProjectionMaxChars as j, resolveCodexDynamicToolsLoadingForModel as k, isContextEngineBindingCompatible as l, buildCodexPluginThreadConfig as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, isCodexAppServerProfilerEnabled as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, ensureCodexPluginActivation as v, sanitizeInlineImageDataUrl$1 as w, defaultCodexAppInventoryCache as x, pluginReadParams as y };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.6.1-beta.
|
|
3
|
+
"version": "2026.6.1-beta.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/codex",
|
|
9
|
-
"version": "2026.6.1-beta.
|
|
9
|
+
"version": "2026.6.1-beta.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@openai/codex": "0.135.0",
|
|
12
12
|
"typebox": "1.1.39",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.6.1-beta.
|
|
3
|
+
"version": "2026.6.1-beta.2",
|
|
4
4
|
"description": "OpenClaw Codex app-server harness and model provider plugin with a Codex-managed GPT catalog.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"minHostVersion": ">=2026.5.1-beta.1"
|
|
27
27
|
},
|
|
28
28
|
"compat": {
|
|
29
|
-
"pluginApi": ">=2026.6.1-beta.
|
|
29
|
+
"pluginApi": ">=2026.6.1-beta.2"
|
|
30
30
|
},
|
|
31
31
|
"build": {
|
|
32
|
-
"openclawVersion": "2026.6.1-beta.
|
|
32
|
+
"openclawVersion": "2026.6.1-beta.2"
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
35
35
|
"publishToClawHub": true,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"README.md"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"openclaw": ">=2026.6.1-beta.
|
|
50
|
+
"openclaw": ">=2026.6.1-beta.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"openclaw": {
|