@openclaw/codex 2026.6.9-beta.1 → 2026.6.10-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-KpyUye2D.js → app-server-policy-BPTiVNsW.js} +2 -2
- package/dist/{attempt-notifications-Meja3TX6.js → attempt-notifications-C3zROmkk.js} +1 -1
- package/dist/{client-m7XiCQpO.js → client-CLrtWgrD.js} +1 -1
- package/dist/{client-factory-CPuoOOx6.js → client-factory-Bm6HsGob.js} +1 -1
- package/dist/{command-handlers-CqS0Kv3Z.js → command-handlers-CLJjbqL9.js} +9 -9
- package/dist/{compact-CMVlldii.js → compact-aQJ0ZKhe.js} +4 -4
- package/dist/{computer-use-qLm7Gf35.js → computer-use-BViK8fu1.js} +3 -3
- package/dist/{config-BksX0T33.js → config-CszD0vP3.js} +16 -5
- package/dist/{conversation-binding-DBof5w9J.js → conversation-binding-CndXa45M.js} +6 -6
- package/dist/harness.js +6 -6
- package/dist/index.js +11 -11
- package/dist/{media-understanding-provider-CiwPkR58.js → media-understanding-provider-DSQ2ry-4.js} +5 -5
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-BsyV1Psm.js → models-CAmfBWRl.js} +1 -1
- package/dist/{plugin-app-cache-key-CN9zBiCG.js → plugin-app-cache-key-DX14mGOE.js} +3 -3
- package/dist/prompt-overlay.js +2 -6
- package/dist/{provider-qJygHQx4.js → provider-B-OHpbD3.js} +3 -3
- package/dist/{provider-capabilities-BOvTfMhF.js → provider-capabilities-D2Ee9YEI.js} +4 -4
- package/dist/provider.js +1 -1
- package/dist/{request-DTIEyUrA.js → request-Dcd452Nk.js} +1 -1
- package/dist/{run-attempt-DRhB6bTc.js → run-attempt-4z6t1PlH.js} +187 -51
- package/dist/{session-binding-BRUi8y6E.js → session-binding-HOuPt-E0.js} +1 -1
- package/dist/{shared-client-Bg5d7VV9.js → shared-client-Dtx5i7Ez.js} +2 -2
- package/dist/{side-question-BdYL4kj1.js → side-question-BO7GbMFO.js} +8 -8
- package/dist/{thread-lifecycle-CbJqqnEw.js → thread-lifecycle-CJdHuthD.js} +66 -14
- package/dist/{web-search-provider.runtime-DrpQ8Cyd.js → web-search-provider.runtime-CMEYazjn.js} +2 -2
- package/npm-shrinkwrap.json +2 -2
- package/openclaw.plugin.json +11 -2
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-
|
|
3
|
-
import { a as hasCodexRateLimitSnapshots, c as summarizeCodexAccountRateLimits, u as summarizeCodexRateLimits } from "./provider-
|
|
2
|
+
import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CszD0vP3.js";
|
|
3
|
+
import { a as hasCodexRateLimitSnapshots, c as summarizeCodexAccountRateLimits, u as summarizeCodexRateLimits } from "./provider-B-OHpbD3.js";
|
|
4
4
|
//#region extensions/codex/src/command-formatters.ts
|
|
5
5
|
/** Formats the combined `/codex status` probe result. */
|
|
6
6
|
function formatCodexStatus(probes) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as isCodexNotificationForTurn } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
3
|
import { asBoolean } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/codex/src/app-server/attempt-notifications.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as isRpcResponse } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { d as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
+
import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
|
|
3
3
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
4
4
|
import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import { createInterface } from "node:readline";
|
|
@@ -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-Dtx5i7Ez.js").then((n) => n.c);
|
|
5
5
|
return await sharedClientModulePromise;
|
|
6
6
|
};
|
|
7
7
|
/** Returns a leased shared client so startup can release ownership explicitly. */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-
|
|
3
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
4
|
-
import { l as summarizeCodexAccountUsage } from "./provider-
|
|
5
|
-
import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-
|
|
6
|
-
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-
|
|
7
|
-
import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-
|
|
2
|
+
import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-CszD0vP3.js";
|
|
3
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-CAmfBWRl.js";
|
|
4
|
+
import { l as summarizeCodexAccountUsage } from "./provider-B-OHpbD3.js";
|
|
5
|
+
import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
|
|
6
|
+
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-DX14mGOE.js";
|
|
7
|
+
import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-BPTiVNsW.js";
|
|
8
8
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
|
|
9
|
-
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-
|
|
10
|
-
import { t as requestCodexAppServerJson } from "./request-
|
|
11
|
-
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-
|
|
9
|
+
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-CndXa45M.js";
|
|
10
|
+
import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
|
|
11
|
+
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-BViK8fu1.js";
|
|
12
12
|
import { n as rememberCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
|
|
13
13
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
14
14
|
import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-
|
|
3
|
-
import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
1
|
+
import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
|
|
2
|
+
import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-HOuPt-E0.js";
|
|
3
|
+
import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
|
|
4
4
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.js";
|
|
5
|
-
import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-
|
|
5
|
+
import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bm6HsGob.js";
|
|
6
6
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
7
7
|
//#region extensions/codex/src/app-server/compact.ts
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-
|
|
2
|
-
import { i as describeControlFailure } from "./plugin-app-cache-key-
|
|
3
|
-
import { t as requestCodexAppServerJson } from "./request-
|
|
1
|
+
import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-CszD0vP3.js";
|
|
2
|
+
import { i as describeControlFailure } from "./plugin-app-cache-key-DX14mGOE.js";
|
|
3
|
+
import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
6
6
|
/**
|
|
@@ -7,6 +7,7 @@ import { hostname } from "node:os";
|
|
|
7
7
|
import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
|
|
8
8
|
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
9
9
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
10
|
+
import { buildSecretInputSchema, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
10
11
|
import { detectWindowsSpawnCommandInlineArgs } from "openclaw/plugin-sdk/windows-spawn";
|
|
11
12
|
import { z } from "zod";
|
|
12
13
|
//#region extensions/codex/src/app-server/config.ts
|
|
@@ -26,6 +27,7 @@ const DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME = "computer-use";
|
|
|
26
27
|
const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 6e4;
|
|
27
28
|
const DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX = "openclaw-network";
|
|
28
29
|
const codexAppServerTransportSchema = z.enum(["stdio", "websocket"]);
|
|
30
|
+
const SecretInputSchema = buildSecretInputSchema();
|
|
29
31
|
const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
|
|
30
32
|
const codexAppServerApprovalPolicySchema = z.enum([
|
|
31
33
|
"never",
|
|
@@ -101,8 +103,8 @@ const codexPluginConfigSchema = z.object({
|
|
|
101
103
|
command: z.string().optional(),
|
|
102
104
|
args: z.union([z.array(z.string()), z.string()]).optional(),
|
|
103
105
|
url: z.string().optional(),
|
|
104
|
-
authToken:
|
|
105
|
-
headers: z.record(z.string(),
|
|
106
|
+
authToken: SecretInputSchema.optional(),
|
|
107
|
+
headers: z.record(z.string(), SecretInputSchema).optional(),
|
|
106
108
|
clearEnv: z.array(z.string()).optional(),
|
|
107
109
|
remoteWorkspaceRoot: codexAppServerRemoteWorkspaceRootSchema.optional(),
|
|
108
110
|
codeModeOnly: z.boolean().optional(),
|
|
@@ -189,7 +191,10 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
189
191
|
const args = resolveArgs(config.args, env.OPENCLAW_CODEX_APP_SERVER_ARGS);
|
|
190
192
|
const headers = normalizeHeaders(config.headers);
|
|
191
193
|
const clearEnv = normalizeStringList(config.clearEnv);
|
|
192
|
-
const authToken =
|
|
194
|
+
const authToken = normalizeCodexAppServerSecretInput({
|
|
195
|
+
value: config.authToken,
|
|
196
|
+
path: "plugins.entries.codex.config.appServer.authToken"
|
|
197
|
+
});
|
|
193
198
|
const url = readNonEmptyString(config.url);
|
|
194
199
|
const connectionClass = inferCodexAppServerConnectionClass({
|
|
195
200
|
transport,
|
|
@@ -364,7 +369,7 @@ function codexAppServerStartOptionsKey(options, params = {}) {
|
|
|
364
369
|
args: options.args,
|
|
365
370
|
url: options.url ?? null,
|
|
366
371
|
authToken: hashSecretForKey(options.authToken, "authToken"),
|
|
367
|
-
headers: Object.entries(options.headers).toSorted(([left], [right]) => left.localeCompare(right)),
|
|
372
|
+
headers: Object.entries(options.headers).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, value]) => [key, hashSecretForKey(value, `header:${key}`)]),
|
|
368
373
|
env: Object.entries(options.env ?? {}).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, value]) => [key, hashSecretForKey(value, `env:${key}`)]),
|
|
369
374
|
clearEnv: [...options.clearEnv ?? []].toSorted(),
|
|
370
375
|
authProfileId: params.authProfileId ?? null,
|
|
@@ -1020,7 +1025,13 @@ function normalizePositiveNumber(value, fallback) {
|
|
|
1020
1025
|
}
|
|
1021
1026
|
function normalizeHeaders(value) {
|
|
1022
1027
|
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
1023
|
-
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key.trim(),
|
|
1028
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key.trim(), normalizeCodexAppServerSecretInput({
|
|
1029
|
+
value: child,
|
|
1030
|
+
path: `plugins.entries.codex.config.appServer.headers.${key}`
|
|
1031
|
+
})]).filter((entry) => Boolean(entry[0] && entry[1])));
|
|
1032
|
+
}
|
|
1033
|
+
function normalizeCodexAppServerSecretInput(params) {
|
|
1034
|
+
return normalizeResolvedSecretInputString(params);
|
|
1024
1035
|
}
|
|
1025
1036
|
function normalizeStringList(value) {
|
|
1026
1037
|
return normalizeTrimmedStringList(value);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import {
|
|
3
|
-
import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-
|
|
2
|
+
import { H as readCodexNotificationTurnId, V as readCodexNotificationThreadId, d as resolveCodexAppServerRequestModelSelection, p as resolveCodexBindingModelProviderFallback, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-CszD0vP3.js";
|
|
4
4
|
import { r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
|
|
5
|
-
import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-
|
|
6
|
-
import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-
|
|
7
|
-
import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-
|
|
8
|
-
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-
|
|
5
|
+
import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
|
|
6
|
+
import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-DX14mGOE.js";
|
|
7
|
+
import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
|
|
8
|
+
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Dtx5i7Ez.js";
|
|
9
9
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
|
|
10
10
|
import fs from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
package/dist/harness.js
CHANGED
|
@@ -32,25 +32,25 @@ function createCodexAppServerAgentHarness(options) {
|
|
|
32
32
|
};
|
|
33
33
|
},
|
|
34
34
|
runAttempt: async (params) => {
|
|
35
|
-
const { runCodexAppServerAttempt } = await import("./run-attempt-
|
|
35
|
+
const { runCodexAppServerAttempt } = await import("./run-attempt-4z6t1PlH.js");
|
|
36
36
|
return runCodexAppServerAttempt(params, {
|
|
37
37
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
38
38
|
nativeHookRelay: { enabled: true }
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
41
|
runSideQuestion: async (params) => {
|
|
42
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-
|
|
42
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-BO7GbMFO.js");
|
|
43
43
|
return runCodexAppServerSideQuestion(params, {
|
|
44
44
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
45
45
|
nativeHookRelay: { enabled: true }
|
|
46
46
|
});
|
|
47
47
|
},
|
|
48
48
|
compact: async (params) => {
|
|
49
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
49
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
|
|
50
50
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
51
51
|
},
|
|
52
52
|
compactAfterContextEngine: async (params) => {
|
|
53
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
53
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
|
|
54
54
|
return maybeCompactCodexAppServerSession(params, {
|
|
55
55
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
56
56
|
allowNonManualNativeRequest: true
|
|
@@ -58,12 +58,12 @@ function createCodexAppServerAgentHarness(options) {
|
|
|
58
58
|
},
|
|
59
59
|
reset: async (params) => {
|
|
60
60
|
if (params.sessionFile) {
|
|
61
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
61
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-HOuPt-E0.js").then((n) => n.s);
|
|
62
62
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
dispose: async () => {
|
|
66
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
66
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
|
|
67
67
|
await clearSharedCodexAppServerClientAndWait();
|
|
68
68
|
}
|
|
69
69
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
|
-
import { F as
|
|
3
|
-
import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-
|
|
4
|
-
import { t as buildCodexProvider } from "./provider-
|
|
5
|
-
import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-
|
|
6
|
-
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
7
|
-
import { a as formatCodexDisplayText } from "./app-server-policy-
|
|
8
|
-
import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } 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-
|
|
10
|
-
import { t as requestCodexAppServerJson } from "./request-
|
|
2
|
+
import { F as ensureCodexPluginActivation, I as pluginReadParams, R as defaultCodexAppInventoryCache } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
4
|
+
import { t as buildCodexProvider } from "./provider-B-OHpbD3.js";
|
|
5
|
+
import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-DSQ2ry-4.js";
|
|
6
|
+
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-DX14mGOE.js";
|
|
7
|
+
import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
|
|
8
|
+
import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-Dtx5i7Ez.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-CndXa45M.js";
|
|
10
|
+
import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
|
|
11
11
|
import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
|
|
12
12
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
13
13
|
import { resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -52,7 +52,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async function loadDefaultCodexSubcommandHandler() {
|
|
55
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
55
|
+
const { handleCodexSubcommand } = await import("./command-handlers-CLJjbqL9.js");
|
|
56
56
|
return handleCodexSubcommand;
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
@@ -1542,7 +1542,7 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
1542
1542
|
//#region extensions/codex/src/web-search-provider.ts
|
|
1543
1543
|
let codexWebSearchRuntimePromise;
|
|
1544
1544
|
function loadCodexWebSearchRuntime() {
|
|
1545
|
-
codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-
|
|
1545
|
+
codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-CMEYazjn.js");
|
|
1546
1546
|
return codexWebSearchRuntimePromise;
|
|
1547
1547
|
}
|
|
1548
1548
|
const CodexWebSearchSchema = {
|
package/dist/{media-understanding-provider-CiwPkR58.js → media-understanding-provider-DSQ2ry-4.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
2
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
3
|
-
import {
|
|
4
|
-
import { S as readCodexNotificationItem } from "./attempt-notifications-
|
|
5
|
-
import { d as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
3
|
+
import { N as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-CJdHuthD.js";
|
|
4
|
+
import { S as readCodexNotificationItem } from "./attempt-notifications-C3zROmkk.js";
|
|
5
|
+
import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
|
|
6
6
|
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
|
|
7
|
-
import { i as readModelListResult } from "./models-
|
|
7
|
+
import { i as readModelListResult } from "./models-CAmfBWRl.js";
|
|
8
8
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import path from "node:path";
|
|
@@ -51,7 +51,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
51
51
|
const agentDir = params.agentDir?.trim() || void 0;
|
|
52
52
|
const startOptions = workspace.codexHome ? buildPrivateCodexAppServerStartOptions(appServer.start, workspace.codexHome) : appServer.start;
|
|
53
53
|
const ownsClient = !params.options.clientFactory;
|
|
54
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-
|
|
54
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
55
55
|
startOptions,
|
|
56
56
|
timeoutMs,
|
|
57
57
|
authProfileId: params.profile,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-
|
|
1
|
+
import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-DSQ2ry-4.js";
|
|
2
2
|
export { buildCodexMediaUnderstandingProvider };
|
|
@@ -46,7 +46,7 @@ async function listAllCodexAppServerModels(options = {}) {
|
|
|
46
46
|
async function withCodexAppServerModelClient(options, run) {
|
|
47
47
|
const timeoutMs = options.timeoutMs ?? 2500;
|
|
48
48
|
const useSharedClient = options.sharedClient !== false;
|
|
49
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-
|
|
49
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
|
|
50
50
|
const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
|
|
51
51
|
startOptions: options.startOptions,
|
|
52
52
|
timeoutMs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
3
|
-
import { h as resolveCodexAppServerHomeDir } from "./shared-client-
|
|
1
|
+
import { L as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-CJdHuthD.js";
|
|
2
|
+
import { n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
|
|
3
|
+
import { h as resolveCodexAppServerHomeDir } from "./shared-client-Dtx5i7Ez.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
6
6
|
/**
|
package/dist/prompt-overlay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GPT5_BEHAVIOR_CONTRACT, GPT5_HEARTBEAT_PROMPT_OVERLAY,
|
|
1
|
+
import { GPT5_BEHAVIOR_CONTRACT, GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveGpt5SystemPromptContribution } from "openclaw/plugin-sdk/provider-model-shared";
|
|
2
2
|
//#region extensions/codex/prompt-overlay.ts
|
|
3
3
|
/**
|
|
4
4
|
* Codex prompt-overlay facade for GPT-5 behavior and heartbeat guidance.
|
|
@@ -11,9 +11,5 @@ const CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY = GPT5_HEARTBEAT_PROMPT_OVERLAY;
|
|
|
11
11
|
function resolveCodexSystemPromptContribution(params) {
|
|
12
12
|
return resolveGpt5SystemPromptContribution(params);
|
|
13
13
|
}
|
|
14
|
-
/** Renders the Codex prompt overlay text for supported GPT-5-family models. */
|
|
15
|
-
function renderCodexPromptOverlay(params) {
|
|
16
|
-
return renderGpt5PromptOverlay(params);
|
|
17
|
-
}
|
|
18
14
|
//#endregion
|
|
19
|
-
export { CODEX_GPT5_BEHAVIOR_CONTRACT, CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY,
|
|
15
|
+
export { CODEX_GPT5_BEHAVIOR_CONTRACT, CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveCodexSystemPromptContribution };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig } from "./provider-catalog.js";
|
|
2
2
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
3
|
-
import { d as resolveCodexAppServerRuntimeOptions, u as readCodexPluginConfig } from "./config-
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
4
4
|
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
|
|
5
5
|
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
6
6
|
import { MAX_DATE_TIMESTAMP_MS, resolveExpiresAtMsFromEpochSeconds } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -541,11 +541,11 @@ async function listModelsBestEffort(params) {
|
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
async function listCodexAppServerModelsLazy(options) {
|
|
544
|
-
const { listCodexAppServerModels } = await import("./models-
|
|
544
|
+
const { listCodexAppServerModels } = await import("./models-CAmfBWRl.js").then((n) => n.r);
|
|
545
545
|
return listCodexAppServerModels(options);
|
|
546
546
|
}
|
|
547
547
|
async function requestCodexAppServerRateLimitsLazy(options) {
|
|
548
|
-
const { requestCodexAppServerJson } = await import("./request-
|
|
548
|
+
const { requestCodexAppServerJson } = await import("./request-Dcd452Nk.js").then((n) => n.n);
|
|
549
549
|
return await requestCodexAppServerJson({
|
|
550
550
|
method: "account/rateLimits/read",
|
|
551
551
|
timeoutMs: options.timeoutMs,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, _ as resolveCodexWebSearchPlan, w as normalizeCodexDynamicToolName, x as sanitizeInlineImageDataUrl, y as invalidInlineImageText } from "./thread-lifecycle-
|
|
3
|
-
import { c as isTrustedCodexModelBackedOpenAIProvider, u as readCodexPluginConfig } from "./config-
|
|
4
|
-
import { a as formatCodexDisplayText } from "./app-server-policy-
|
|
5
|
-
import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
+
import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, _ as resolveCodexWebSearchPlan, w as normalizeCodexDynamicToolName, x as sanitizeInlineImageDataUrl, y as invalidInlineImageText } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { c as isTrustedCodexModelBackedOpenAIProvider, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
4
|
+
import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
|
|
5
|
+
import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
|
|
6
6
|
import { i as resolveCodexNativeExecutionPolicy } from "./sandbox-guard-3tnjhjFb.js";
|
|
7
7
|
import { addTimerTimeoutGraceMs, finiteSecondsToTimerSafeMilliseconds, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
8
8
|
import { asOptionalRecord, isRecord, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/provider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildCodexProviderCatalog, r as isModernCodexModel, t as buildCodexProvider } from "./provider-
|
|
1
|
+
import { n as buildCodexProviderCatalog, r as isModernCodexModel, t as buildCodexProvider } from "./provider-B-OHpbD3.js";
|
|
2
2
|
export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
+
import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
|
|
3
3
|
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-3tnjhjFb.js";
|
|
4
4
|
//#region extensions/codex/src/app-server/request.ts
|
|
5
5
|
var request_exports = /* @__PURE__ */ __exportAll({ requestCodexAppServerJson: () => requestCodexAppServerJson });
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import { C as readNotificationItemId, E as updateActiveTurnItemIds, S as readCodexNotificationItem, T as shouldDisarmAssistantCompletionIdleWatch, _ as isReasoningItemCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isTerminalTurnStatus, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawToolOutputCompletionNotification, h as isRawReasoningCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningProgressNotification, w as readRawResponseToolCallId, x as isTurnNotification, y as isRetryableErrorNotification } from "./attempt-notifications-
|
|
4
|
-
import { _ as withMcpElicitationsApprovalPolicy, a as isCodexAppServerApprovalPolicyAllowedByRequirements, d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, m as resolveCodexPluginsPolicy, p as resolveCodexModelBackedReviewerPolicyContext, s as isCodexSandboxExecServerEnabled, u as readCodexPluginConfig } from "./config-
|
|
2
|
+
import { A as resolveCodexContextEngineProjectionReserveTokens, D as fitCodexProjectedContextForTurnStart, E as resolveCodexDynamicToolsLoadingForRuntime, H as readCodexNotificationTurnId, M as buildCodexPluginThreadConfigInputFingerprint, N as mergeCodexThreadConfigs, O as projectContextEngineAssemblyForCodex, P as shouldBuildCodexPluginThreadConfig, R as defaultCodexAppInventoryCache, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, a as buildDeveloperInstructions, b as sanitizeCodexHistoryImagePayloads, c as codexDynamicToolsFingerprint, f as resolveCodexAppServerThreadModelSelection, h as startOrResumeThread, i as buildContextEngineBinding, j as buildCodexPluginThreadConfig, k as resolveCodexContextEngineProjectionMaxChars, l as isContextEngineBindingCompatible, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, s as buildTurnStartParams, v as isCodexAppServerProfilerEnabled, z as describeCodexNotificationCorrelation } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { C as readNotificationItemId, E as updateActiveTurnItemIds, S as readCodexNotificationItem, T as shouldDisarmAssistantCompletionIdleWatch, _ as isReasoningItemCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isTerminalTurnStatus, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawToolOutputCompletionNotification, h as isRawReasoningCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningProgressNotification, w as readRawResponseToolCallId, x as isTurnNotification, y as isRetryableErrorNotification } from "./attempt-notifications-C3zROmkk.js";
|
|
4
|
+
import { _ as withMcpElicitationsApprovalPolicy, a as isCodexAppServerApprovalPolicyAllowedByRequirements, d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, m as resolveCodexPluginsPolicy, p as resolveCodexModelBackedReviewerPolicyContext, s as isCodexSandboxExecServerEnabled, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
5
5
|
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-B19q5BIX.js";
|
|
6
|
-
import { i as formatCodexUsageLimitErrorMessage, o as resolveCodexUsageLimitResetAtMs, s as shouldRefreshCodexRateLimitsForUsageLimitMessage } from "./provider-
|
|
7
|
-
import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, n as CodexAppServerRpcError, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-
|
|
8
|
-
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding, r as clearCodexAppServerBindingForThread } from "./session-binding-
|
|
9
|
-
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-
|
|
10
|
-
import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-
|
|
11
|
-
import { d as resolveCodexAppServerAuthAccountCacheKey, f as resolveCodexAppServerAuthProfileId, h as resolveCodexAppServerHomeDir, m as resolveCodexAppServerFallbackApiKeyCacheKey, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, s as retireSharedCodexAppServerClientIfCurrent, t as clearSharedCodexAppServerClientIfCurrent, u as refreshCodexAppServerAuthTokens } from "./shared-client-
|
|
12
|
-
import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-
|
|
13
|
-
import { A as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as resolveCodexMessageToolProvider, D as shouldWarnCodexDynamicToolBuildStageSummary, E as shouldRequireCodexSandboxExecServerEnvironment, F as resolveCodexTurnTerminalIdleTimeoutMs, I as withCodexStartupTimeout, M as resolveCodexStartupTimeoutMs, N as resolveCodexTurnAssistantCompletionIdleTimeoutMs, P as resolveCodexTurnCompletionIdleTimeoutMs, S as resolveCodexExternalSandboxPolicyForOpenClawSandbox, T as shouldEnableCodexAppServerNativeToolSurface, _ as createCodexDynamicToolBuildStageTracker, a as buildCodexNativeHookRelayConfig, b as resolveCodexAppServerExecutionCwd, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as buildDynamicTools, h as emitDynamicToolTerminalDiagnostic, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, k as handleCodexAppServerApprovalRequest, l as resolveCodexNativeHookRelayTtlMs, m as emitDynamicToolStartedDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as disableCodexPluginThreadConfig, w as resolveCodexSandboxEnvironmentSelection, x as resolveCodexAppServerHookChannelId, y as formatCodexDynamicToolBuildStageSummary } from "./provider-capabilities-
|
|
14
|
-
import { t as ensureCodexComputerUse } from "./computer-use-
|
|
6
|
+
import { i as formatCodexUsageLimitErrorMessage, o as resolveCodexUsageLimitResetAtMs, s as shouldRefreshCodexRateLimitsForUsageLimitMessage } from "./provider-B-OHpbD3.js";
|
|
7
|
+
import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, n as CodexAppServerRpcError, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-CLrtWgrD.js";
|
|
8
|
+
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding, r as clearCodexAppServerBindingForThread } from "./session-binding-HOuPt-E0.js";
|
|
9
|
+
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-DX14mGOE.js";
|
|
10
|
+
import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
|
|
11
|
+
import { d as resolveCodexAppServerAuthAccountCacheKey, f as resolveCodexAppServerAuthProfileId, h as resolveCodexAppServerHomeDir, m as resolveCodexAppServerFallbackApiKeyCacheKey, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, s as retireSharedCodexAppServerClientIfCurrent, t as clearSharedCodexAppServerClientIfCurrent, u as refreshCodexAppServerAuthTokens } from "./shared-client-Dtx5i7Ez.js";
|
|
12
|
+
import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bm6HsGob.js";
|
|
13
|
+
import { A as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as resolveCodexMessageToolProvider, D as shouldWarnCodexDynamicToolBuildStageSummary, E as shouldRequireCodexSandboxExecServerEnvironment, F as resolveCodexTurnTerminalIdleTimeoutMs, I as withCodexStartupTimeout, M as resolveCodexStartupTimeoutMs, N as resolveCodexTurnAssistantCompletionIdleTimeoutMs, P as resolveCodexTurnCompletionIdleTimeoutMs, S as resolveCodexExternalSandboxPolicyForOpenClawSandbox, T as shouldEnableCodexAppServerNativeToolSurface, _ as createCodexDynamicToolBuildStageTracker, a as buildCodexNativeHookRelayConfig, b as resolveCodexAppServerExecutionCwd, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as buildDynamicTools, h as emitDynamicToolTerminalDiagnostic, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, k as handleCodexAppServerApprovalRequest, l as resolveCodexNativeHookRelayTtlMs, m as emitDynamicToolStartedDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as disableCodexPluginThreadConfig, w as resolveCodexSandboxEnvironmentSelection, x as resolveCodexAppServerHookChannelId, y as formatCodexDynamicToolBuildStageSummary } from "./provider-capabilities-D2Ee9YEI.js";
|
|
14
|
+
import { t as ensureCodexComputerUse } from "./computer-use-BViK8fu1.js";
|
|
15
15
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
|
|
16
16
|
import fs from "node:fs/promises";
|
|
17
17
|
import path, { posix } from "node:path";
|
|
@@ -21,7 +21,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
21
21
|
import fsSync from "node:fs";
|
|
22
22
|
import { markAuthProfileBlockedUntil, resolveAgentDir, resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
23
23
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
24
|
-
import { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, assertContextEngineHostSupport,
|
|
24
|
+
import { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, assertContextEngineHostSupport, awaitAgentEndSideEffects, bootstrapHarnessContextEngine, buildBootstrapContextForFiles, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, getAgentHarnessHookRunner, getBeforeToolCallPolicyDiagnosticState, inferToolMetaFromArgs, isActiveHarnessContextEngine, loadCodexBundleMcpThreadConfig, normalizeUsage, resolveAgentHarnessBeforePromptBuildResult, resolveBootstrapFilesForRun, resolveContextEngineOwnerPluginId, resolveSandboxContext, resolveSessionAgentIds as resolveSessionAgentIds$1, resolveSessionWriteLockOptions, resolveUserPath, runAgentCleanupStep, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
25
25
|
import { buildMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
|
|
26
26
|
import { spawn } from "node:child_process";
|
|
27
27
|
import { once } from "node:events";
|
|
@@ -528,6 +528,25 @@ function prependCodexOpenClawPromptContext(prompt, context, options = {}) {
|
|
|
528
528
|
promptSection
|
|
529
529
|
].filter(Boolean).join("\n\n");
|
|
530
530
|
}
|
|
531
|
+
/**
|
|
532
|
+
* Maps the surviving user-request portion of an input range after delivery
|
|
533
|
+
* metadata has been relocated before the request.
|
|
534
|
+
*/
|
|
535
|
+
function resolveCodexDeliveryHintPreservedInputRange(params) {
|
|
536
|
+
const { prompt, promptInputRange, decoratedPrompt } = params;
|
|
537
|
+
const { deliveryHint, prompt: promptWithoutDeliveryHint } = splitLeadingCodexDeliveryHint(prompt);
|
|
538
|
+
if (!deliveryHint || !promptInputRange || promptInputRange.start < 0 || promptInputRange.end < promptInputRange.start || promptInputRange.end > prompt.length || !decoratedPrompt.endsWith(promptWithoutDeliveryHint)) return;
|
|
539
|
+
const promptWithoutDeliveryHintStart = prompt.length - promptWithoutDeliveryHint.length;
|
|
540
|
+
const inputStart = Math.max(promptInputRange.start, promptWithoutDeliveryHintStart);
|
|
541
|
+
const inputEnd = Math.max(inputStart, Math.min(promptInputRange.end, promptWithoutDeliveryHint.length + promptWithoutDeliveryHintStart));
|
|
542
|
+
const decoratedPromptSuffixStart = decoratedPrompt.length - promptWithoutDeliveryHint.length;
|
|
543
|
+
const requestHeader = "Current user request:\n";
|
|
544
|
+
const requestHeaderStart = decoratedPromptSuffixStart - 22;
|
|
545
|
+
return {
|
|
546
|
+
start: inputStart === promptWithoutDeliveryHintStart && decoratedPrompt.slice(requestHeaderStart, decoratedPromptSuffixStart) === requestHeader ? requestHeaderStart : decoratedPromptSuffixStart + inputStart - promptWithoutDeliveryHintStart,
|
|
547
|
+
end: decoratedPromptSuffixStart + inputEnd - promptWithoutDeliveryHintStart
|
|
548
|
+
};
|
|
549
|
+
}
|
|
531
550
|
function splitLeadingCodexDeliveryHint(prompt) {
|
|
532
551
|
const trimmedStart = prompt.trimStart();
|
|
533
552
|
const matchedHint = MESSAGE_TOOL_DELIVERY_HINTS.find((hint) => trimmedStart.startsWith(hint));
|
|
@@ -6137,25 +6156,58 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6137
6156
|
continue;
|
|
6138
6157
|
}
|
|
6139
6158
|
const completion = toThreadCompletion(nativeCompletion, childState.childThreadId);
|
|
6140
|
-
|
|
6141
|
-
const eventAt = Date.now();
|
|
6142
|
-
if (!await this.reconcileChildTranscript(childState.childThreadId)) {
|
|
6143
|
-
this.scheduleTranscriptPoll(childState);
|
|
6144
|
-
this.scheduleNoFinalCompletionFallback(state, childState, completion, eventAt);
|
|
6145
|
-
}
|
|
6146
|
-
continue;
|
|
6147
|
-
}
|
|
6148
|
-
await this.processCompletion(state, completion);
|
|
6159
|
+
await this.processChildCompletion(state, childState, completion);
|
|
6149
6160
|
}
|
|
6150
6161
|
}
|
|
6151
6162
|
captureChildAssistantMessage(notification) {
|
|
6152
|
-
if (notification.method !== "item/completed") return;
|
|
6153
6163
|
const params = isJsonObject(notification.params) ? notification.params : void 0;
|
|
6154
6164
|
const childThreadId = readString$2(params, "threadId")?.trim();
|
|
6155
6165
|
const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
|
|
6166
|
+
if (!childState || childState.transcriptTerminal) return;
|
|
6167
|
+
if (notification.method === "item/agentMessage/delta") {
|
|
6168
|
+
const turnId = readString$2(params, "turnId");
|
|
6169
|
+
const itemId = readString$2(params, "itemId");
|
|
6170
|
+
const delta = readString$2(params, "delta");
|
|
6171
|
+
if (turnId && itemId && delta) this.recordChildAssistantMessage(childState, turnId, itemId, delta);
|
|
6172
|
+
return;
|
|
6173
|
+
}
|
|
6174
|
+
if (notification.method !== "item/started" && notification.method !== "item/completed") return;
|
|
6175
|
+
const turnId = readString$2(params, "turnId");
|
|
6156
6176
|
const item = isJsonObject(params?.item) ? params.item : void 0;
|
|
6157
|
-
|
|
6158
|
-
|
|
6177
|
+
this.captureChildAssistantMessageItem(childState, turnId, item);
|
|
6178
|
+
}
|
|
6179
|
+
captureChildAssistantMessageItem(childState, turnId, item) {
|
|
6180
|
+
if (readString$2(item, "type") !== "agentMessage") return;
|
|
6181
|
+
const itemId = readString$2(item, "id");
|
|
6182
|
+
if (!turnId || !itemId) return;
|
|
6183
|
+
const assistantMessages = this.getChildAssistantMessages(childState, turnId);
|
|
6184
|
+
if (readString$2(item, "phase") === "commentary") assistantMessages.commentaryIds.add(itemId);
|
|
6185
|
+
else assistantMessages.finalMessageIds.add(itemId);
|
|
6186
|
+
const text = readString$2(item, "text");
|
|
6187
|
+
if (text) this.recordChildAssistantMessage(childState, turnId, itemId, text, { replace: true });
|
|
6188
|
+
}
|
|
6189
|
+
captureChildTurnAssistantMessages(childState, turn) {
|
|
6190
|
+
const turnId = readString$2(turn, "id");
|
|
6191
|
+
if (!turnId || !Array.isArray(turn.items)) return;
|
|
6192
|
+
for (const item of turn.items) this.captureChildAssistantMessageItem(childState, turnId, isJsonObject(item) ? item : void 0);
|
|
6193
|
+
}
|
|
6194
|
+
recordChildAssistantMessage(childState, turnId, itemId, text, options = {}) {
|
|
6195
|
+
const assistantMessages = this.getChildAssistantMessages(childState, turnId);
|
|
6196
|
+
if (!assistantMessages.texts.has(itemId)) assistantMessages.order.push(itemId);
|
|
6197
|
+
const existing = assistantMessages.texts.get(itemId) ?? "";
|
|
6198
|
+
assistantMessages.texts.set(itemId, options.replace ? text : `${existing}${text}`);
|
|
6199
|
+
}
|
|
6200
|
+
getChildAssistantMessages(childState, turnId) {
|
|
6201
|
+
const existing = childState.assistantMessagesByTurn.get(turnId);
|
|
6202
|
+
if (existing) return existing;
|
|
6203
|
+
const assistantMessages = {
|
|
6204
|
+
texts: /* @__PURE__ */ new Map(),
|
|
6205
|
+
order: [],
|
|
6206
|
+
commentaryIds: /* @__PURE__ */ new Set(),
|
|
6207
|
+
finalMessageIds: /* @__PURE__ */ new Set()
|
|
6208
|
+
};
|
|
6209
|
+
childState.assistantMessagesByTurn.set(turnId, assistantMessages);
|
|
6210
|
+
return assistantMessages;
|
|
6159
6211
|
}
|
|
6160
6212
|
async handleChildTurnCompletion(notification) {
|
|
6161
6213
|
if (notification.method !== "turn/completed") return;
|
|
@@ -6164,8 +6216,25 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6164
6216
|
const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
|
|
6165
6217
|
const state = childState ? this.parentStates.get(childState.parentThreadId) : void 0;
|
|
6166
6218
|
const turn = isJsonObject(params?.turn) ? params.turn : void 0;
|
|
6219
|
+
if (childState && turn && readString$2(turn, "status") === "interrupted") {
|
|
6220
|
+
const turnId = readString$2(turn, "id");
|
|
6221
|
+
if (turnId) childState.assistantMessagesByTurn.delete(turnId);
|
|
6222
|
+
return;
|
|
6223
|
+
}
|
|
6224
|
+
if (childState && turn) this.captureChildTurnAssistantMessages(childState, turn);
|
|
6167
6225
|
const completion = childState && turn ? toChildTurnCompletion(childState, turn) : void 0;
|
|
6168
6226
|
if (!state || !childState || childState.transcriptTerminal || !completion) return;
|
|
6227
|
+
await this.processChildCompletion(state, childState, completion);
|
|
6228
|
+
}
|
|
6229
|
+
async processChildCompletion(state, childState, completion) {
|
|
6230
|
+
if (shouldWaitForTranscriptCompletion(completion, this.codexHome)) {
|
|
6231
|
+
const eventAt = Date.now();
|
|
6232
|
+
if (!await this.reconcileChildTranscript(childState.childThreadId)) {
|
|
6233
|
+
this.scheduleTranscriptPoll(childState);
|
|
6234
|
+
this.scheduleNoFinalCompletionFallback(state, childState, completion, eventAt);
|
|
6235
|
+
}
|
|
6236
|
+
return;
|
|
6237
|
+
}
|
|
6169
6238
|
await this.processCompletion(state, completion);
|
|
6170
6239
|
}
|
|
6171
6240
|
async reconcileChildTranscript(childThreadId, options = {}) {
|
|
@@ -6325,6 +6394,7 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6325
6394
|
childState = {
|
|
6326
6395
|
childThreadId: normalizedChildThreadId,
|
|
6327
6396
|
parentThreadId: normalizedParentThreadId,
|
|
6397
|
+
assistantMessagesByTurn: /* @__PURE__ */ new Map(),
|
|
6328
6398
|
transcriptPollAttempt: 0,
|
|
6329
6399
|
transcriptTerminal: false,
|
|
6330
6400
|
completionDeliveryAttempt: 0
|
|
@@ -6522,18 +6592,16 @@ function buildCompletionDedupeKey(parentThreadId, completion) {
|
|
|
6522
6592
|
}
|
|
6523
6593
|
function toChildTurnCompletion(childState, turn) {
|
|
6524
6594
|
const status = readString$2(turn, "status");
|
|
6525
|
-
if (status === "completed")
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
result: "Codex native subagent was interrupted."
|
|
6536
|
-
};
|
|
6595
|
+
if (status === "completed") {
|
|
6596
|
+
const turnId = readString$2(turn, "id");
|
|
6597
|
+
const result = turnId ? lastChildAssistantMessage(childState, turnId) : void 0;
|
|
6598
|
+
return {
|
|
6599
|
+
childThreadId: childState.childThreadId,
|
|
6600
|
+
status: "succeeded",
|
|
6601
|
+
statusLabel: result ? "turn_completed" : "completed_without_final_message",
|
|
6602
|
+
result: result ?? "Codex native subagent completed without a final assistant message."
|
|
6603
|
+
};
|
|
6604
|
+
}
|
|
6537
6605
|
if (status === "failed") return {
|
|
6538
6606
|
childThreadId: childState.childThreadId,
|
|
6539
6607
|
status: "failed",
|
|
@@ -6541,6 +6609,17 @@ function toChildTurnCompletion(childState, turn) {
|
|
|
6541
6609
|
result: readTurnErrorMessage(turn) ?? "Codex native subagent failed."
|
|
6542
6610
|
};
|
|
6543
6611
|
}
|
|
6612
|
+
function lastChildAssistantMessage(childState, turnId) {
|
|
6613
|
+
const assistantMessages = childState.assistantMessagesByTurn.get(turnId);
|
|
6614
|
+
if (!assistantMessages) return;
|
|
6615
|
+
for (let index = assistantMessages.order.length - 1; index >= 0; index -= 1) {
|
|
6616
|
+
const itemId = assistantMessages.order[index];
|
|
6617
|
+
if (assistantMessages.finalMessageIds.has(itemId) && !assistantMessages.commentaryIds.has(itemId)) {
|
|
6618
|
+
const text = normalizeOptionalString(assistantMessages.texts.get(itemId));
|
|
6619
|
+
if (text) return text;
|
|
6620
|
+
}
|
|
6621
|
+
}
|
|
6622
|
+
}
|
|
6544
6623
|
function readTurnErrorMessage(turn) {
|
|
6545
6624
|
const error = isJsonObject(turn.error) ? turn.error : void 0;
|
|
6546
6625
|
return normalizeOptionalString(readString$2(error, "message")) ?? normalizeOptionalString(isJsonObject(error?.codexErrorInfo) ? readString$2(error.codexErrorInfo, "message") : void 0);
|
|
@@ -7591,11 +7670,18 @@ function shouldAwaitCodexAgentEndHook(params) {
|
|
|
7591
7670
|
return !params.messageChannel && !params.messageProvider;
|
|
7592
7671
|
}
|
|
7593
7672
|
async function runCodexAgentEndHook(params, hookParams) {
|
|
7673
|
+
const sideEffectParams = {
|
|
7674
|
+
...hookParams,
|
|
7675
|
+
ctx: {
|
|
7676
|
+
...hookParams.ctx,
|
|
7677
|
+
config: params.config
|
|
7678
|
+
}
|
|
7679
|
+
};
|
|
7594
7680
|
if (shouldAwaitCodexAgentEndHook(params)) {
|
|
7595
|
-
await
|
|
7681
|
+
await awaitAgentEndSideEffects(sideEffectParams);
|
|
7596
7682
|
return;
|
|
7597
7683
|
}
|
|
7598
|
-
|
|
7684
|
+
runAgentEndSideEffects(sideEffectParams);
|
|
7599
7685
|
}
|
|
7600
7686
|
async function runCodexAppServerAttempt(params, options = {}) {
|
|
7601
7687
|
const attemptStartedAt = Date.now();
|
|
@@ -7996,8 +8082,13 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
7996
8082
|
skillsPrompt: params.skillsSnapshot?.prompt
|
|
7997
8083
|
});
|
|
7998
8084
|
let promptText = params.prompt;
|
|
8085
|
+
let promptContextRange;
|
|
7999
8086
|
let developerInstructions = baseDeveloperInstructions;
|
|
8000
8087
|
let prePromptMessageCount = historyMessages.length;
|
|
8088
|
+
const codexContextProjectionMaxChars = resolveCodexContextEngineProjectionMaxChars({
|
|
8089
|
+
contextTokenBudget: params.contextTokenBudget,
|
|
8090
|
+
reserveTokens: resolveCodexContextEngineProjectionReserveTokens({ config: params.config })
|
|
8091
|
+
});
|
|
8001
8092
|
let contextEngineProjection;
|
|
8002
8093
|
let precomputedStaleBindingContinuityProjectionApplied = false;
|
|
8003
8094
|
let staleBindingContinuityForcedFreshStart = false;
|
|
@@ -8006,9 +8097,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8006
8097
|
const projection = projectContextEngineAssemblyForCodex({
|
|
8007
8098
|
assembledMessages: historyMessages,
|
|
8008
8099
|
originalHistoryMessages: historyMessages,
|
|
8009
|
-
prompt: params.prompt
|
|
8100
|
+
prompt: params.prompt,
|
|
8101
|
+
maxRenderedContextChars: codexContextProjectionMaxChars
|
|
8010
8102
|
});
|
|
8011
8103
|
promptText = projection.promptText;
|
|
8104
|
+
promptContextRange = projection.promptContextRange;
|
|
8012
8105
|
prePromptMessageCount = projection.prePromptMessageCount;
|
|
8013
8106
|
};
|
|
8014
8107
|
const applyActiveContextEngineProjection = async (decisionStartupBinding) => {
|
|
@@ -8036,10 +8129,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8036
8129
|
originalHistoryMessages: historyMessages,
|
|
8037
8130
|
prompt: params.prompt,
|
|
8038
8131
|
systemPromptAddition: assembled.systemPromptAddition,
|
|
8039
|
-
maxRenderedContextChars:
|
|
8040
|
-
contextTokenBudget: params.contextTokenBudget,
|
|
8041
|
-
reserveTokens: resolveCodexContextEngineProjectionReserveTokens({ config: params.config })
|
|
8042
|
-
}),
|
|
8132
|
+
maxRenderedContextChars: codexContextProjectionMaxChars,
|
|
8043
8133
|
toolPayloadMode: contextEngineProjection ? "preserve" : "elide"
|
|
8044
8134
|
});
|
|
8045
8135
|
const projectionDecision = contextEngineProjection ? resolveContextEngineBootstrapProjectionDecision({
|
|
@@ -8069,6 +8159,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8069
8159
|
developerInstructionAdditionChars: projection.developerInstructionAddition?.length ?? 0
|
|
8070
8160
|
});
|
|
8071
8161
|
promptText = projectionDecision.project ? projection.promptText : params.prompt;
|
|
8162
|
+
promptContextRange = projectionDecision.project ? projection.promptContextRange : void 0;
|
|
8072
8163
|
developerInstructions = joinPresentSections(baseDeveloperInstructions, projection.developerInstructionAddition);
|
|
8073
8164
|
prePromptMessageCount = projection.prePromptMessageCount;
|
|
8074
8165
|
};
|
|
@@ -8082,11 +8173,52 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8082
8173
|
prompt: prependCurrentInboundContext(promptText, params.currentInboundContext),
|
|
8083
8174
|
developerInstructions,
|
|
8084
8175
|
messages: codexModelInputHistoryMessages,
|
|
8085
|
-
ctx: hookContext
|
|
8176
|
+
ctx: hookContext,
|
|
8177
|
+
..."beforeAgentStartResult" in params ? { beforeAgentStartResult: params.beforeAgentStartResult } : {}
|
|
8086
8178
|
});
|
|
8179
|
+
const resolveShiftedPromptInputRange = (prompt, promptInputRange, turnPromptText) => {
|
|
8180
|
+
if (!promptInputRange || promptInputRange.start < 0 || promptInputRange.end < promptInputRange.start || promptInputRange.end > prompt.length || !turnPromptText.endsWith(prompt)) return;
|
|
8181
|
+
const turnPromptOffset = turnPromptText.length - prompt.length;
|
|
8182
|
+
return {
|
|
8183
|
+
start: turnPromptOffset + promptInputRange.start,
|
|
8184
|
+
end: turnPromptOffset + promptInputRange.end
|
|
8185
|
+
};
|
|
8186
|
+
};
|
|
8187
|
+
const resolveShiftedPromptContextRange = (prompt, promptInputRange, turnPromptText) => {
|
|
8188
|
+
const promptTextInputOffset = promptInputRange ? promptInputRange.end - promptText.length : void 0;
|
|
8189
|
+
if (!promptContextRange || !promptInputRange || promptTextInputOffset === void 0 || promptInputRange.start < 0 || promptInputRange.end < promptInputRange.start || promptInputRange.end > prompt.length || promptTextInputOffset < promptInputRange.start || prompt.slice(promptTextInputOffset, promptInputRange.end) !== promptText || !turnPromptText.endsWith(prompt)) return;
|
|
8190
|
+
const promptTextOffset = prompt.endsWith(promptText) ? prompt.length - promptText.length : promptTextInputOffset;
|
|
8191
|
+
if (promptTextOffset < 0) return;
|
|
8192
|
+
const turnPromptOffset = turnPromptText.length - prompt.length + promptTextOffset;
|
|
8193
|
+
const contextRange = {
|
|
8194
|
+
start: turnPromptOffset + promptContextRange.start,
|
|
8195
|
+
end: turnPromptOffset + promptContextRange.end
|
|
8196
|
+
};
|
|
8197
|
+
return {
|
|
8198
|
+
contextRange,
|
|
8199
|
+
requestRange: {
|
|
8200
|
+
start: contextRange.end,
|
|
8201
|
+
end: turnPromptOffset + promptText.length
|
|
8202
|
+
}
|
|
8203
|
+
};
|
|
8204
|
+
};
|
|
8087
8205
|
let promptBuild = await buildPromptFromCurrentInputs();
|
|
8088
|
-
const decorateCodexTurnPromptText = (
|
|
8089
|
-
|
|
8206
|
+
const decorateCodexTurnPromptText = (promptBuildResult) => {
|
|
8207
|
+
const turnPromptText = prependCodexOpenClawPromptContext(promptBuildResult.prompt, openClawPromptContext, { preservePromptWithoutContext: params.bootstrapContextMode === "lightweight" && params.bootstrapContextRunKind === "cron" });
|
|
8208
|
+
const projectedRanges = resolveShiftedPromptContextRange(promptBuildResult.prompt, promptBuildResult.promptInputRange, turnPromptText);
|
|
8209
|
+
const preservedRange = resolveShiftedPromptInputRange(promptBuildResult.prompt, promptBuildResult.promptInputRange, turnPromptText) ?? resolveCodexDeliveryHintPreservedInputRange({
|
|
8210
|
+
prompt: promptBuildResult.prompt,
|
|
8211
|
+
promptInputRange: promptBuildResult.promptInputRange,
|
|
8212
|
+
decoratedPrompt: turnPromptText
|
|
8213
|
+
});
|
|
8214
|
+
return fitCodexProjectedContextForTurnStart({
|
|
8215
|
+
promptText: turnPromptText,
|
|
8216
|
+
contextRange: projectedRanges?.contextRange,
|
|
8217
|
+
requestRange: projectedRanges?.requestRange,
|
|
8218
|
+
preservedRange
|
|
8219
|
+
});
|
|
8220
|
+
};
|
|
8221
|
+
let codexTurnPromptText = decorateCodexTurnPromptText(promptBuild);
|
|
8090
8222
|
const buildCodexTurnCollaborationDeveloperInstructions = () => buildTurnCollaborationMode(params, {
|
|
8091
8223
|
turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
|
|
8092
8224
|
skillsCollaborationInstructions,
|
|
@@ -8096,15 +8228,16 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8096
8228
|
const buildRenderedCodexDeveloperInstructions = () => joinPresentSections(promptBuild.developerInstructions, buildCodexTurnCollaborationDeveloperInstructions());
|
|
8097
8229
|
const rebuildCodexPromptBuildFromCurrentProjection = async () => {
|
|
8098
8230
|
promptBuild = await buildPromptFromCurrentInputs();
|
|
8099
|
-
codexTurnPromptText = decorateCodexTurnPromptText(promptBuild
|
|
8231
|
+
codexTurnPromptText = decorateCodexTurnPromptText(promptBuild);
|
|
8100
8232
|
};
|
|
8101
8233
|
const rebuildCodexTurnPromptTextFromCurrentProjection = async () => {
|
|
8102
8234
|
const nextPromptBuild = await buildPromptFromCurrentInputs();
|
|
8103
8235
|
promptBuild = {
|
|
8104
8236
|
...promptBuild,
|
|
8105
|
-
prompt: nextPromptBuild.prompt
|
|
8237
|
+
prompt: nextPromptBuild.prompt,
|
|
8238
|
+
promptInputRange: nextPromptBuild.promptInputRange
|
|
8106
8239
|
};
|
|
8107
|
-
codexTurnPromptText = decorateCodexTurnPromptText(nextPromptBuild
|
|
8240
|
+
codexTurnPromptText = decorateCodexTurnPromptText(nextPromptBuild);
|
|
8108
8241
|
};
|
|
8109
8242
|
const selectNewerVisibleHistoryAfterBinding = (binding) => {
|
|
8110
8243
|
const bindingUpdatedAt = Date.parse(binding.updatedAt);
|
|
@@ -8127,9 +8260,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8127
8260
|
const projection = projectContextEngineAssemblyForCodex({
|
|
8128
8261
|
assembledMessages: newerVisibleMessages,
|
|
8129
8262
|
originalHistoryMessages: historyMessages,
|
|
8130
|
-
prompt: params.prompt
|
|
8263
|
+
prompt: params.prompt,
|
|
8264
|
+
maxRenderedContextChars: codexContextProjectionMaxChars
|
|
8131
8265
|
});
|
|
8132
8266
|
promptText = projection.promptText;
|
|
8267
|
+
promptContextRange = projection.promptContextRange;
|
|
8133
8268
|
prePromptMessageCount = projection.prePromptMessageCount;
|
|
8134
8269
|
return true;
|
|
8135
8270
|
};
|
|
@@ -8178,6 +8313,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8178
8313
|
if (startupBinding?.threadId) return;
|
|
8179
8314
|
inactiveThreadBootstrapBindingForcedFreshStart = hadInactiveThreadBootstrapBinding;
|
|
8180
8315
|
staleBindingContinuityForcedFreshStart = precomputedStaleBindingContinuityProjectionApplied && !inactiveThreadBootstrapBindingForcedFreshStart;
|
|
8316
|
+
if (staleBindingContinuityForcedFreshStart) applyFreshThreadContinuityProjection();
|
|
8181
8317
|
if (activeContextEngine) {
|
|
8182
8318
|
contextEngineProjection = void 0;
|
|
8183
8319
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { l as normalizeCodexServiceTier } from "./config-
|
|
2
|
+
import { l as normalizeCodexServiceTier } from "./config-CszD0vP3.js";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -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 { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-
|
|
2
|
+
import { d as resolveCodexAppServerRuntimeOptions, r as codexAppServerStartOptionsKey } from "./config-CszD0vP3.js";
|
|
3
|
+
import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-CLrtWgrD.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import fs, { access } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import {
|
|
3
|
-
import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-
|
|
2
|
+
import { H as readCodexNotificationTurnId, N as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
|
|
4
4
|
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-B19q5BIX.js";
|
|
5
|
-
import { i as formatCodexUsageLimitErrorMessage } from "./provider-
|
|
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-
|
|
5
|
+
import { i as formatCodexUsageLimitErrorMessage } from "./provider-B-OHpbD3.js";
|
|
6
|
+
import { i as isCodexAppServerApprovalRequest } from "./client-CLrtWgrD.js";
|
|
7
|
+
import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
|
|
8
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
|
|
9
|
+
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-Dtx5i7Ez.js";
|
|
10
10
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.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-
|
|
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-D2Ee9YEI.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";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-
|
|
2
|
+
import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-CszD0vP3.js";
|
|
3
3
|
import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
|
|
4
4
|
import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
|
|
5
|
-
import { r as isModernCodexModel } from "./provider-
|
|
6
|
-
import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-
|
|
7
|
-
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-
|
|
5
|
+
import { r as isModernCodexModel } from "./provider-B-OHpbD3.js";
|
|
6
|
+
import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
|
|
7
|
+
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
|
|
8
8
|
import "node:fs/promises";
|
|
9
9
|
import "node:path";
|
|
10
10
|
import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -860,6 +860,7 @@ const MAX_RENDERED_CONTEXT_CHARS = 1e6;
|
|
|
860
860
|
const DEFAULT_TEXT_PART_CHARS = 6e3;
|
|
861
861
|
const MAX_TEXT_PART_CHARS = 128e3;
|
|
862
862
|
const APPROX_RENDERED_CHARS_PER_TOKEN = 4;
|
|
863
|
+
const CODEX_TURN_START_TEXT_INPUT_MAX_CHARS = 1 << 20;
|
|
863
864
|
/** Default token reserve kept out of rendered context-engine prompt text. */
|
|
864
865
|
const DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS = 2e4;
|
|
865
866
|
const MIN_PROMPT_BUDGET_RATIO = .5;
|
|
@@ -873,20 +874,23 @@ function projectContextEngineAssemblyForCodex(params) {
|
|
|
873
874
|
maxTextPartChars: resolveTextPartMaxChars(maxRenderedContextChars),
|
|
874
875
|
toolPayloadMode: params.toolPayloadMode ?? "elide"
|
|
875
876
|
});
|
|
876
|
-
const
|
|
877
|
+
const boundedContext = renderedContext ? truncateOlderContext(renderedContext, maxRenderedContextChars) : void 0;
|
|
878
|
+
const promptPrefix = boundedContext ? [
|
|
877
879
|
CONTEXT_HEADER,
|
|
878
880
|
CONTEXT_SAFETY_NOTE,
|
|
879
881
|
"",
|
|
880
|
-
CONTEXT_OPEN
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
882
|
+
CONTEXT_OPEN
|
|
883
|
+
].join("\n") + "\n" : void 0;
|
|
884
|
+
const promptSuffix = boundedContext ? `\n${CONTEXT_CLOSE}\n\n${REQUEST_HEADER}\n${prompt}` : "";
|
|
885
|
+
const promptText = boundedContext ? `${promptPrefix}${boundedContext}${promptSuffix}` : prompt;
|
|
886
|
+
const promptContextRange = promptPrefix && boundedContext ? {
|
|
887
|
+
start: promptPrefix.length,
|
|
888
|
+
end: promptPrefix.length + boundedContext.length
|
|
889
|
+
} : void 0;
|
|
887
890
|
return {
|
|
888
891
|
...params.systemPromptAddition?.trim() ? { developerInstructionAddition: params.systemPromptAddition.trim() } : {},
|
|
889
892
|
promptText,
|
|
893
|
+
...promptContextRange ? { promptContextRange } : {},
|
|
890
894
|
assembledMessages: params.assembledMessages,
|
|
891
895
|
prePromptMessageCount: params.originalHistoryMessages.length
|
|
892
896
|
};
|
|
@@ -908,6 +912,46 @@ function resolveCodexContextEngineProjectionReserveTokens(params) {
|
|
|
908
912
|
if (configuredReserveTokens !== void 0) return Math.max(configuredReserveTokens, configuredReserveTokensFloor ?? 2e4);
|
|
909
913
|
if (configuredReserveTokensFloor !== void 0) return configuredReserveTokensFloor;
|
|
910
914
|
}
|
|
915
|
+
/** Fits projected context prompts under Codex app-server turn/start text limits. */
|
|
916
|
+
function fitCodexProjectedContextForTurnStart(params) {
|
|
917
|
+
const maxChars = typeof params.maxChars === "number" && Number.isFinite(params.maxChars) ? Math.max(0, Math.floor(params.maxChars)) : CODEX_TURN_START_TEXT_INPUT_MAX_CHARS;
|
|
918
|
+
if (params.promptText.length <= maxChars) return params.promptText;
|
|
919
|
+
const range = normalizeProjectedContextRange(params.contextRange, params.promptText.length);
|
|
920
|
+
if (!range) {
|
|
921
|
+
const preservedRange = normalizeProjectedContextRange(params.preservedRange, params.promptText.length);
|
|
922
|
+
if (!preservedRange) return params.promptText;
|
|
923
|
+
const preservedText = params.promptText.slice(preservedRange.start, preservedRange.end);
|
|
924
|
+
if (!preservedText) return truncateOlderContext(params.promptText, maxChars);
|
|
925
|
+
if (preservedText.length >= maxChars) return truncateOlderContext(preservedText, maxChars);
|
|
926
|
+
return `${truncateOlderContext(params.promptText.slice(0, preservedRange.start), maxChars - preservedText.length)}${preservedText}`;
|
|
927
|
+
}
|
|
928
|
+
const beforeContext = params.promptText.slice(0, range.start);
|
|
929
|
+
const context = params.promptText.slice(range.start, range.end);
|
|
930
|
+
const afterContext = params.promptText.slice(range.end);
|
|
931
|
+
const requestRange = normalizeProjectedContextRange(params.requestRange, params.promptText.length);
|
|
932
|
+
if (requestRange && requestRange.start >= range.end && requestRange.end < params.promptText.length) {
|
|
933
|
+
const request = params.promptText.slice(requestRange.start, requestRange.end);
|
|
934
|
+
if (request.length >= maxChars) return truncateOlderContext(request, maxChars);
|
|
935
|
+
const fittedAppendedContext = truncateOlderContext(params.promptText.slice(requestRange.end), maxChars - request.length);
|
|
936
|
+
const fittedContext = truncateOlderContext(context, maxChars - request.length - fittedAppendedContext.length);
|
|
937
|
+
return `${truncateOlderContext(beforeContext, maxChars - fittedContext.length - request.length - fittedAppendedContext.length)}${fittedContext}${request}${fittedAppendedContext}`;
|
|
938
|
+
}
|
|
939
|
+
const contextBudget = maxChars - beforeContext.length - afterContext.length;
|
|
940
|
+
if (contextBudget > 0) return `${beforeContext}${truncateOlderContext(context, contextBudget)}${afterContext}`;
|
|
941
|
+
const afterContextText = truncateOlderContext(afterContext, maxChars);
|
|
942
|
+
return `${truncateOlderContext(context, maxChars - afterContextText.length)}${afterContextText}`;
|
|
943
|
+
}
|
|
944
|
+
function normalizeProjectedContextRange(range, textLength) {
|
|
945
|
+
if (!range) return;
|
|
946
|
+
const start = Math.floor(range.start);
|
|
947
|
+
const end = Math.floor(range.end);
|
|
948
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || start < 0 || end < start) return;
|
|
949
|
+
if (end > textLength) return;
|
|
950
|
+
return {
|
|
951
|
+
start,
|
|
952
|
+
end
|
|
953
|
+
};
|
|
954
|
+
}
|
|
911
955
|
function resolveProjectionPromptBudgetTokens(params) {
|
|
912
956
|
const requestedReserveTokens = typeof params.reserveTokens === "number" && Number.isFinite(params.reserveTokens) && params.reserveTokens >= 0 ? Math.floor(params.reserveTokens) : DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS;
|
|
913
957
|
const minPromptBudget = Math.min(MIN_PROMPT_BUDGET_TOKENS, Math.max(1, Math.floor(params.contextTokenBudget * MIN_PROMPT_BUDGET_RATIO)));
|
|
@@ -1059,7 +1103,15 @@ function truncateOlderContext(text, maxChars) {
|
|
|
1059
1103
|
marker = buildMarker(text.length - tailChars);
|
|
1060
1104
|
if (marker.length >= maxChars) return marker.slice(0, maxChars);
|
|
1061
1105
|
tailChars = maxChars - marker.length;
|
|
1062
|
-
return `${marker}${
|
|
1106
|
+
return `${marker}${sliceTailFromCodePointBoundary(text, tailChars).trimStart()}`;
|
|
1107
|
+
}
|
|
1108
|
+
function sliceTailFromCodePointBoundary(text, tailChars) {
|
|
1109
|
+
let start = text.length - tailChars;
|
|
1110
|
+
if (start > 0 && start < text.length) {
|
|
1111
|
+
const code = text.charCodeAt(start);
|
|
1112
|
+
if (code >= 56320 && code <= 57343) start += 1;
|
|
1113
|
+
}
|
|
1114
|
+
return text.slice(start);
|
|
1063
1115
|
}
|
|
1064
1116
|
//#endregion
|
|
1065
1117
|
//#region extensions/codex/src/app-server/dynamic-tool-profile.ts
|
|
@@ -2213,4 +2265,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
|
|
|
2213
2265
|
return null;
|
|
2214
2266
|
}
|
|
2215
2267
|
//#endregion
|
|
2216
|
-
export {
|
|
2268
|
+
export { resolveCodexContextEngineProjectionReserveTokens as A, isCodexNotificationForTurn as B, isForcedPrivateQaCodexRuntime as C, fitCodexProjectedContextForTurnStart as D, resolveCodexDynamicToolsLoadingForRuntime as E, ensureCodexPluginActivation as F, readCodexNotificationTurnId as H, pluginReadParams as I, buildCodexAppInventoryCacheKey as L, buildCodexPluginThreadConfigInputFingerprint as M, mergeCodexThreadConfigs as N, projectContextEngineAssemblyForCodex as O, shouldBuildCodexPluginThreadConfig as P, defaultCodexAppInventoryCache as R, filterCodexDynamicTools as S, resolveCodexDynamicToolsLoading as T, readCodexNotificationThreadId as V, resolveCodexWebSearchPlan as _, buildDeveloperInstructions as a, sanitizeCodexHistoryImagePayloads as b, codexDynamicToolsFingerprint as c, resolveCodexAppServerRequestModelSelection as d, resolveCodexAppServerThreadModelSelection as f, buildCodexNativeWebSearchThreadConfig as g, startOrResumeThread as h, buildContextEngineBinding as i, buildCodexPluginThreadConfig as j, resolveCodexContextEngineProjectionMaxChars as k, isContextEngineBindingCompatible as l, resolveReasoningEffort as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, resolveCodexBindingModelProviderFallback as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, isCodexAppServerProfilerEnabled as v, normalizeCodexDynamicToolName as w, sanitizeInlineImageDataUrl$1 as x, invalidInlineImageText as y, describeCodexNotificationCorrelation as z };
|
package/dist/{web-search-provider.runtime-DrpQ8Cyd.js → web-search-provider.runtime-CMEYazjn.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-
|
|
3
|
-
import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-
|
|
2
|
+
import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-CJdHuthD.js";
|
|
3
|
+
import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-DSQ2ry-4.js";
|
|
4
4
|
import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
5
|
//#region extensions/codex/src/web-search-provider.runtime.ts
|
|
6
6
|
async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.10-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/codex",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.10-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@openai/codex": "0.139.0",
|
|
12
12
|
"typebox": "1.1.39",
|
package/openclaw.plugin.json
CHANGED
|
@@ -152,10 +152,10 @@
|
|
|
152
152
|
]
|
|
153
153
|
},
|
|
154
154
|
"url": { "type": "string" },
|
|
155
|
-
"authToken": { "type": "string" },
|
|
155
|
+
"authToken": { "type": ["string", "object"] },
|
|
156
156
|
"headers": {
|
|
157
157
|
"type": "object",
|
|
158
|
-
"additionalProperties": { "type": "string" }
|
|
158
|
+
"additionalProperties": { "type": ["string", "object"] }
|
|
159
159
|
},
|
|
160
160
|
"clearEnv": {
|
|
161
161
|
"type": "array",
|
|
@@ -254,6 +254,14 @@
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
},
|
|
257
|
+
"configContracts": {
|
|
258
|
+
"secretInputs": {
|
|
259
|
+
"paths": [
|
|
260
|
+
{ "path": "appServer.authToken", "expected": "string" },
|
|
261
|
+
{ "path": "appServer.headers.*", "expected": "string" }
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
},
|
|
257
265
|
"uiHints": {
|
|
258
266
|
"codexDynamicToolsLoading": {
|
|
259
267
|
"label": "Dynamic Tools Loading",
|
|
@@ -382,6 +390,7 @@
|
|
|
382
390
|
"appServer.headers": {
|
|
383
391
|
"label": "Headers",
|
|
384
392
|
"help": "Additional headers sent to the WebSocket app-server.",
|
|
393
|
+
"sensitive": true,
|
|
385
394
|
"advanced": true
|
|
386
395
|
},
|
|
387
396
|
"appServer.clearEnv": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.10-beta.1",
|
|
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",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
36
|
"compat": {
|
|
37
|
-
"pluginApi": ">=2026.6.
|
|
37
|
+
"pluginApi": ">=2026.6.10-beta.1"
|
|
38
38
|
},
|
|
39
39
|
"build": {
|
|
40
|
-
"openclawVersion": "2026.6.
|
|
40
|
+
"openclawVersion": "2026.6.10-beta.1"
|
|
41
41
|
},
|
|
42
42
|
"release": {
|
|
43
43
|
"publishToClawHub": true,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"README.md"
|
|
56
56
|
],
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"openclaw": ">=2026.6.
|
|
58
|
+
"openclaw": ">=2026.6.10-beta.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"openclaw": {
|