@openclaw/codex 2026.5.14-beta.2 → 2026.5.16-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/{command-formatters-DRJaVHhN.js → command-formatters-BRW7_Nu7.js} +10 -2
- package/dist/{command-handlers-CXxykxjq.js → command-handlers-CbJPJwK_.js} +2 -2
- package/dist/{compact-DWa8cylR.js → compact-CKWfgifa.js} +87 -108
- package/dist/harness.js +3 -3
- package/dist/index.js +3 -3
- package/dist/{node-cli-sessions-CiexDHeV.js → node-cli-sessions-xstpFJmx.js} +1 -1
- package/dist/{run-attempt-DG9NQab2.js → run-attempt-frGYsF9Y.js} +70 -25
- package/dist/{side-question-CVWPOkY-.js → side-question-CDcvaIKA.js} +3 -3
- package/dist/test-api.js +1 -1
- package/dist/{thread-lifecycle-DrbViNpf.js → thread-lifecycle-BzY-GLGu.js} +6 -2
- package/dist/{vision-tools-CzTdigBu.js → vision-tools-CyhFwJIY.js} +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -4
|
@@ -474,7 +474,10 @@ function formatCodexRateLimitDetails(value) {
|
|
|
474
474
|
}
|
|
475
475
|
function summarizeRateLimits(value) {
|
|
476
476
|
const entries = extractArray(value);
|
|
477
|
-
if (entries.length > 0)
|
|
477
|
+
if (entries.length > 0) {
|
|
478
|
+
const count = entries.filter(isMeaningfulRateLimitSnapshot).length;
|
|
479
|
+
return count > 0 ? `${count}` : "none returned";
|
|
480
|
+
}
|
|
478
481
|
if (!isJsonObject(value)) return "none returned";
|
|
479
482
|
const keyed = value.rateLimitsByLimitId;
|
|
480
483
|
if (isJsonObject(keyed)) {
|
|
@@ -484,7 +487,12 @@ function summarizeRateLimits(value) {
|
|
|
484
487
|
return isMeaningfulRateLimitSnapshot(value.rateLimits) ? "1" : "none returned";
|
|
485
488
|
}
|
|
486
489
|
function isMeaningfulRateLimitSnapshot(value) {
|
|
487
|
-
|
|
490
|
+
if (!isJsonObject(value)) return false;
|
|
491
|
+
if (readString(value, "rateLimitReachedType") ?? readString(value, "rate_limit_reached_type")) return true;
|
|
492
|
+
return ["primary", "secondary"].some((key) => {
|
|
493
|
+
const window = value[key];
|
|
494
|
+
return isJsonObject(window) && Object.values(window).some((entry) => entry != null);
|
|
495
|
+
});
|
|
488
496
|
}
|
|
489
497
|
function extractArray(value) {
|
|
490
498
|
if (Array.isArray(value)) return value;
|
|
@@ -2,9 +2,9 @@ import { i as isCodexFastServiceTier, s as resolveCodexAppServerRuntimeOptions }
|
|
|
2
2
|
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-GCYf5s8J.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
4
|
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-CKYiRqsN.js";
|
|
5
|
-
import { a as formatComputerUseStatus, c as formatThreads, i as formatCodexStatus, l as readString$1, n as formatAccount, o as formatList, p as summarizeCodexAccountUsage, r as formatCodexDisplayText, s as formatModels, t as buildHelp } from "./command-formatters-
|
|
5
|
+
import { a as formatComputerUseStatus, c as formatThreads, i as formatCodexStatus, l as readString$1, n as formatAccount, o as formatList, p as summarizeCodexAccountUsage, r as formatCodexDisplayText, s as formatModels, t as buildHelp } from "./command-formatters-BRW7_Nu7.js";
|
|
6
6
|
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
7
|
-
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-
|
|
7
|
+
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-xstpFJmx.js";
|
|
8
8
|
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-DsJxRRtm.js";
|
|
9
9
|
import { n as rememberCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.js";
|
|
10
10
|
import crypto from "node:crypto";
|
|
@@ -2,65 +2,99 @@ import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
|
2
2
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
3
3
|
import { i as readCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
4
4
|
import { t as defaultCodexAppServerClientFactory } from "./client-factory-Be6RD28K.js";
|
|
5
|
-
import { embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
|
+
import { embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, resolveContextEngineOwnerPluginId, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/compact.ts
|
|
7
7
|
const DEFAULT_CODEX_COMPACTION_WAIT_TIMEOUT_MS = 300 * 1e3;
|
|
8
|
+
const warnedIgnoredCompactionOverrides = /* @__PURE__ */ new Set();
|
|
8
9
|
async function maybeCompactCodexAppServerSession(params, options = {}) {
|
|
9
10
|
const activeContextEngine = isActiveHarnessContextEngine(params.contextEngine) ? params.contextEngine : void 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
embeddedAgentLog.warn("context engine compaction failed; attempting Codex native compaction", {
|
|
28
|
-
sessionId: params.sessionId,
|
|
29
|
-
engineId: activeContextEngine.info.id,
|
|
30
|
-
error: primaryError
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (primary?.ok && primary.compacted) try {
|
|
34
|
-
await runHarnessContextEngineMaintenance({
|
|
35
|
-
contextEngine: activeContextEngine,
|
|
36
|
-
sessionId: params.sessionId,
|
|
37
|
-
sessionKey: params.sessionKey,
|
|
38
|
-
sessionFile: params.sessionFile,
|
|
39
|
-
reason: "compaction",
|
|
40
|
-
runtimeContext: params.contextEngineRuntimeContext,
|
|
41
|
-
config: params.config
|
|
42
|
-
});
|
|
43
|
-
} catch (error) {
|
|
44
|
-
embeddedAgentLog.warn("context engine compaction maintenance failed; continuing Codex native compaction", {
|
|
45
|
-
sessionId: params.sessionId,
|
|
46
|
-
engineId: activeContextEngine.info.id,
|
|
47
|
-
error: formatErrorMessage(error)
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
const nativeResult = await compactCodexNativeThread(params, options);
|
|
51
|
-
if (!primary) return buildContextEngineCompactionFailureResult({
|
|
52
|
-
primaryError,
|
|
53
|
-
nativeResult,
|
|
54
|
-
currentTokenCount: params.currentTokenCount
|
|
11
|
+
warnIfIgnoringOpenClawCompactionOverrides(params);
|
|
12
|
+
const nativeResult = await compactCodexNativeThread(params, options);
|
|
13
|
+
if (activeContextEngine && nativeResult?.ok && nativeResult.compacted) try {
|
|
14
|
+
await runHarnessContextEngineMaintenance({
|
|
15
|
+
contextEngine: activeContextEngine,
|
|
16
|
+
sessionId: params.sessionId,
|
|
17
|
+
sessionKey: params.sessionKey,
|
|
18
|
+
sessionFile: params.sessionFile,
|
|
19
|
+
reason: "compaction",
|
|
20
|
+
runtimeContext: params.contextEngineRuntimeContext,
|
|
21
|
+
config: params.config
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
embeddedAgentLog.warn("context engine compaction maintenance failed after Codex compaction", {
|
|
25
|
+
sessionId: params.sessionId,
|
|
26
|
+
engineId: activeContextEngine.info.id,
|
|
27
|
+
error: formatErrorMessage(error)
|
|
55
28
|
});
|
|
56
|
-
return {
|
|
57
|
-
ok: primary.ok,
|
|
58
|
-
compacted: primary.compacted,
|
|
59
|
-
reason: primary.reason,
|
|
60
|
-
result: buildContextEnginePrimaryResult(primary, nativeResult, params.currentTokenCount)
|
|
61
|
-
};
|
|
62
29
|
}
|
|
63
|
-
return
|
|
30
|
+
return nativeResult;
|
|
31
|
+
}
|
|
32
|
+
function warnIfIgnoringOpenClawCompactionOverrides(params) {
|
|
33
|
+
const ignoredConfig = readIgnoredCompactionOverridePaths(params, isActiveHarnessContextEngine(params.contextEngine) ? params.contextEngine : void 0);
|
|
34
|
+
if (ignoredConfig.length === 0) return;
|
|
35
|
+
const warningKey = ignoredConfig.join("\0");
|
|
36
|
+
if (warnedIgnoredCompactionOverrides.has(warningKey)) return;
|
|
37
|
+
warnedIgnoredCompactionOverrides.add(warningKey);
|
|
38
|
+
embeddedAgentLog.warn("ignoring OpenClaw compaction overrides for Codex app-server compaction; Codex uses native server-side compaction", {
|
|
39
|
+
sessionId: params.sessionId,
|
|
40
|
+
sessionKey: params.sessionKey,
|
|
41
|
+
ignoredConfig
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function readIgnoredCompactionOverridePaths(params, activeContextEngine) {
|
|
45
|
+
const ignored = /* @__PURE__ */ new Set();
|
|
46
|
+
const configuredContextEngine = readStringPath(params.config, [
|
|
47
|
+
"plugins",
|
|
48
|
+
"slots",
|
|
49
|
+
"contextEngine"
|
|
50
|
+
]);
|
|
51
|
+
const runtimeContextEnginePlugin = typeof params.contextEngineRuntimeContext?.contextEnginePluginId === "string" ? params.contextEngineRuntimeContext.contextEnginePluginId.trim() : "";
|
|
52
|
+
const activeContextEnginePlugin = resolveContextEngineOwnerPluginId(activeContextEngine);
|
|
53
|
+
for (const entry of readCompactionOverrideEntries(params)) {
|
|
54
|
+
const localProvider = typeof entry.record.provider === "string" ? entry.record.provider.trim() : "";
|
|
55
|
+
const inheritedProvider = !localProvider && typeof entry.inheritedRecord?.provider === "string" ? entry.inheritedRecord.provider.trim() : "";
|
|
56
|
+
const provider = localProvider || inheritedProvider;
|
|
57
|
+
const providerPath = localProvider ? `${entry.path}.compaction.provider` : inheritedProvider && entry.inheritedPath ? `${entry.inheritedPath}.compaction.provider` : void 0;
|
|
58
|
+
if (provider.toLowerCase() === "lossless-claw" && (activeContextEnginePlugin === "lossless-claw" || runtimeContextEnginePlugin.toLowerCase() === "lossless-claw" || configuredContextEngine?.toLowerCase() === "lossless-claw")) continue;
|
|
59
|
+
if (typeof entry.record.model === "string" && entry.record.model.trim()) ignored.add(`${entry.path}.compaction.model`);
|
|
60
|
+
if (providerPath) ignored.add(providerPath);
|
|
61
|
+
}
|
|
62
|
+
return [...ignored];
|
|
63
|
+
}
|
|
64
|
+
function readCompactionOverrideEntries(params) {
|
|
65
|
+
const entries = [];
|
|
66
|
+
const defaultCompaction = readRecord(readRecord(params.config?.agents)?.defaults)?.compaction;
|
|
67
|
+
const defaultRecord = readRecord(defaultCompaction);
|
|
68
|
+
if (defaultRecord) entries.push({
|
|
69
|
+
path: "agents.defaults",
|
|
70
|
+
record: defaultRecord
|
|
71
|
+
});
|
|
72
|
+
const agentId = readAgentIdFromSessionKey(params.sessionKey ?? params.sandboxSessionKey);
|
|
73
|
+
if (!agentId) return entries;
|
|
74
|
+
const agentCompaction = readRecord((Array.isArray(params.config?.agents?.list) ? params.config.agents.list : []).find((agent) => {
|
|
75
|
+
return (typeof agent?.id === "string" ? agent.id.trim().toLowerCase() : "") === agentId;
|
|
76
|
+
}))?.compaction;
|
|
77
|
+
const agentRecord = readRecord(agentCompaction);
|
|
78
|
+
if (agentRecord) entries.push({
|
|
79
|
+
path: `agents.list.${agentId}`,
|
|
80
|
+
record: agentRecord,
|
|
81
|
+
inheritedRecord: defaultRecord,
|
|
82
|
+
inheritedPath: "agents.defaults"
|
|
83
|
+
});
|
|
84
|
+
return entries;
|
|
85
|
+
}
|
|
86
|
+
function readAgentIdFromSessionKey(sessionKey) {
|
|
87
|
+
const parts = sessionKey?.trim().toLowerCase().split(":").filter(Boolean) ?? [];
|
|
88
|
+
if (parts.length < 3 || parts[0] !== "agent") return;
|
|
89
|
+
return parts[1]?.trim() || void 0;
|
|
90
|
+
}
|
|
91
|
+
function readRecord(value) {
|
|
92
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
93
|
+
}
|
|
94
|
+
function readStringPath(value, path) {
|
|
95
|
+
let current = value;
|
|
96
|
+
for (const segment of path) current = readRecord(current)?.[segment];
|
|
97
|
+
return typeof current === "string" && current.trim() ? current.trim() : void 0;
|
|
64
98
|
}
|
|
65
99
|
async function compactCodexNativeThread(params, options = {}) {
|
|
66
100
|
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
|
|
@@ -111,7 +145,6 @@ async function compactCodexNativeThread(params, options = {}) {
|
|
|
111
145
|
tokensBefore: params.currentTokenCount ?? 0,
|
|
112
146
|
details: {
|
|
113
147
|
backend: "codex-app-server",
|
|
114
|
-
ownsCompaction: params.contextEngine?.info?.ownsCompaction === true,
|
|
115
148
|
threadId: binding.threadId,
|
|
116
149
|
signal: completion.signal,
|
|
117
150
|
turnId: completion.turnId,
|
|
@@ -120,60 +153,6 @@ async function compactCodexNativeThread(params, options = {}) {
|
|
|
120
153
|
}
|
|
121
154
|
};
|
|
122
155
|
}
|
|
123
|
-
function mergeCompactionDetails(primaryDetails, nativeResult, contextEngineCompaction) {
|
|
124
|
-
const codexNativeCompaction = nativeResult ? nativeResult.ok && nativeResult.compacted ? {
|
|
125
|
-
ok: true,
|
|
126
|
-
compacted: true,
|
|
127
|
-
details: nativeResult.result?.details
|
|
128
|
-
} : {
|
|
129
|
-
ok: false,
|
|
130
|
-
compacted: false,
|
|
131
|
-
reason: nativeResult.reason
|
|
132
|
-
} : void 0;
|
|
133
|
-
const extraDetails = {
|
|
134
|
-
...codexNativeCompaction ? { codexNativeCompaction } : {},
|
|
135
|
-
...contextEngineCompaction ? { contextEngineCompaction } : {}
|
|
136
|
-
};
|
|
137
|
-
if (primaryDetails && typeof primaryDetails === "object" && !Array.isArray(primaryDetails)) return {
|
|
138
|
-
...primaryDetails,
|
|
139
|
-
...extraDetails
|
|
140
|
-
};
|
|
141
|
-
return Object.keys(extraDetails).length > 0 ? extraDetails : primaryDetails;
|
|
142
|
-
}
|
|
143
|
-
function buildContextEnginePrimaryResult(primary, nativeResult, currentTokenCount) {
|
|
144
|
-
if (primary.result) return {
|
|
145
|
-
summary: primary.result.summary ?? "",
|
|
146
|
-
firstKeptEntryId: primary.result.firstKeptEntryId ?? "",
|
|
147
|
-
tokensBefore: primary.result.tokensBefore,
|
|
148
|
-
tokensAfter: primary.result.tokensAfter,
|
|
149
|
-
details: mergeCompactionDetails(primary.result.details, nativeResult)
|
|
150
|
-
};
|
|
151
|
-
const details = mergeCompactionDetails(void 0, nativeResult);
|
|
152
|
-
return details ? {
|
|
153
|
-
summary: "",
|
|
154
|
-
firstKeptEntryId: "",
|
|
155
|
-
tokensBefore: nativeResult?.result?.tokensBefore ?? currentTokenCount ?? 0,
|
|
156
|
-
details
|
|
157
|
-
} : void 0;
|
|
158
|
-
}
|
|
159
|
-
function buildContextEngineCompactionFailureResult(params) {
|
|
160
|
-
const reason = params.primaryError ? `context engine compaction failed: ${params.primaryError}` : "context engine compaction failed";
|
|
161
|
-
return {
|
|
162
|
-
ok: false,
|
|
163
|
-
compacted: params.nativeResult?.compacted ?? false,
|
|
164
|
-
reason,
|
|
165
|
-
result: {
|
|
166
|
-
summary: params.nativeResult?.result?.summary ?? "",
|
|
167
|
-
firstKeptEntryId: params.nativeResult?.result?.firstKeptEntryId ?? "",
|
|
168
|
-
tokensBefore: params.nativeResult?.result?.tokensBefore ?? params.currentTokenCount ?? 0,
|
|
169
|
-
tokensAfter: params.nativeResult?.result?.tokensAfter,
|
|
170
|
-
details: mergeCompactionDetails(params.nativeResult?.result?.details, params.nativeResult, {
|
|
171
|
-
ok: false,
|
|
172
|
-
reason
|
|
173
|
-
})
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
156
|
function createCodexNativeCompactionWaiter(client, threadId) {
|
|
178
157
|
let settled = false;
|
|
179
158
|
let removeHandler = () => {};
|
package/dist/harness.js
CHANGED
|
@@ -18,15 +18,15 @@ function createCodexAppServerAgentHarness(options) {
|
|
|
18
18
|
};
|
|
19
19
|
},
|
|
20
20
|
runAttempt: async (params) => {
|
|
21
|
-
const { runCodexAppServerAttempt } = await import("./run-attempt-
|
|
21
|
+
const { runCodexAppServerAttempt } = await import("./run-attempt-frGYsF9Y.js");
|
|
22
22
|
return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
|
|
23
23
|
},
|
|
24
24
|
runSideQuestion: async (params) => {
|
|
25
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-
|
|
25
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-CDcvaIKA.js");
|
|
26
26
|
return runCodexAppServerSideQuestion(params, { pluginConfig: options?.pluginConfig });
|
|
27
27
|
},
|
|
28
28
|
compact: async (params) => {
|
|
29
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
29
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-CKWfgifa.js");
|
|
30
30
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
|
|
31
31
|
},
|
|
32
32
|
reset: async (params) => {
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions, t
|
|
|
3
3
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
4
4
|
import { buildCodexProvider } from "./provider.js";
|
|
5
5
|
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-CKYiRqsN.js";
|
|
6
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
6
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BRW7_Nu7.js";
|
|
7
7
|
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, t as clearSharedCodexAppServerClientAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-BwUqd3lh.js";
|
|
8
|
-
import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-
|
|
8
|
+
import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-xstpFJmx.js";
|
|
9
9
|
import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-aQOmRQwA.js";
|
|
10
10
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
11
11
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
@@ -38,7 +38,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
async function loadDefaultCodexSubcommandHandler() {
|
|
41
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
41
|
+
const { handleCodexSubcommand } = await import("./command-handlers-CbJPJwK_.js");
|
|
42
42
|
return handleCodexSubcommand;
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as isCodexFastServiceTier, r as codexSandboxPolicyForTurn, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
2
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
3
3
|
import { r as CODEX_CONTROL_METHODS } from "./request-CKYiRqsN.js";
|
|
4
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
4
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BRW7_Nu7.js";
|
|
5
5
|
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-BwUqd3lh.js";
|
|
6
6
|
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
7
7
|
import os from "node:os";
|
|
@@ -3,18 +3,18 @@ import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCod
|
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
4
|
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-CoctX13d.js";
|
|
5
5
|
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-CKYiRqsN.js";
|
|
6
|
-
import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimitsForUsageLimitMessage, r as formatCodexDisplayText, u as formatCodexUsageLimitErrorMessage } from "./command-formatters-
|
|
6
|
+
import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimitsForUsageLimitMessage, r as formatCodexDisplayText, u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BRW7_Nu7.js";
|
|
7
7
|
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, l as resolveCodexAppServerAuthProfileId, n as clearSharedCodexAppServerClientIfCurrent, s as refreshCodexAppServerAuthTokens, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-BwUqd3lh.js";
|
|
8
8
|
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
9
9
|
import { a as defaultCodexAppInventoryCache } from "./plugin-activation-aQOmRQwA.js";
|
|
10
|
-
import { _ as resolveCodexContextEngineProjectionReserveTokens, b as normalizeCodexDynamicToolName, d as buildCodexPluginThreadConfig, f as buildCodexPluginThreadConfigInputFingerprint, g as resolveCodexContextEngineProjectionMaxChars, h as projectContextEngineAssemblyForCodex, m as shouldBuildCodexPluginThreadConfig, o as buildTurnStartParams, p as mergeCodexThreadConfigs, r as buildDeveloperInstructions, s as codexDynamicToolsFingerprint, t as areCodexDynamicToolFingerprintsCompatible, u as startOrResumeThread, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-
|
|
10
|
+
import { _ as resolveCodexContextEngineProjectionReserveTokens, b as normalizeCodexDynamicToolName, d as buildCodexPluginThreadConfig, f as buildCodexPluginThreadConfigInputFingerprint, g as resolveCodexContextEngineProjectionMaxChars, h as projectContextEngineAssemblyForCodex, m as shouldBuildCodexPluginThreadConfig, o as buildTurnStartParams, p as mergeCodexThreadConfigs, r as buildDeveloperInstructions, s as codexDynamicToolsFingerprint, t as areCodexDynamicToolFingerprintsCompatible, u as startOrResumeThread, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-BzY-GLGu.js";
|
|
11
11
|
import { t as defaultCodexAppServerClientFactory } from "./client-factory-Be6RD28K.js";
|
|
12
|
-
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-
|
|
12
|
+
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-CyhFwJIY.js";
|
|
13
13
|
import { t as ensureCodexComputerUse } from "./computer-use-DsJxRRtm.js";
|
|
14
14
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.js";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
import nodeFs from "node:fs";
|
|
17
|
-
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, bootstrapHarnessContextEngine, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, isActiveHarnessContextEngine, isSubagentSessionKey, loadCodexBundleMcpThreadConfig, normalizeAgentRuntimeTools, normalizeUsage, registerNativeHookRelay, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
17
|
+
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, bootstrapHarnessContextEngine, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, isActiveHarnessContextEngine, isSubagentSessionKey, loadCodexBundleMcpThreadConfig, normalizeAgentRuntimeTools, normalizeUsage, registerNativeHookRelay, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveContextEngineOwnerPluginId, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
18
18
|
import fs from "node:fs/promises";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { markAuthProfileBlockedUntil, resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -347,6 +347,41 @@ function inferCodexDynamicToolMeta(call, detailMode) {
|
|
|
347
347
|
//#endregion
|
|
348
348
|
//#region extensions/codex/src/app-server/transcript-mirror.ts
|
|
349
349
|
const MIRROR_IDENTITY_META_KEY = "mirrorIdentity";
|
|
350
|
+
function normalizeOptionalString(value) {
|
|
351
|
+
const normalized = value?.trim();
|
|
352
|
+
return normalized ? normalized : void 0;
|
|
353
|
+
}
|
|
354
|
+
function buildSenderLabel(params) {
|
|
355
|
+
const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
|
|
356
|
+
if (!label) return;
|
|
357
|
+
if (!params.senderId || label.includes(params.senderId)) return label;
|
|
358
|
+
return `${label} (${params.senderId})`;
|
|
359
|
+
}
|
|
360
|
+
function buildCodexUserPromptMessage(params) {
|
|
361
|
+
const senderId = normalizeOptionalString(params.senderId);
|
|
362
|
+
const senderName = normalizeOptionalString(params.senderName);
|
|
363
|
+
const senderUsername = normalizeOptionalString(params.senderUsername);
|
|
364
|
+
const senderE164 = normalizeOptionalString(params.senderE164);
|
|
365
|
+
const senderLabel = buildSenderLabel({
|
|
366
|
+
senderId,
|
|
367
|
+
senderName,
|
|
368
|
+
senderUsername,
|
|
369
|
+
senderE164
|
|
370
|
+
});
|
|
371
|
+
const sourceChannel = normalizeOptionalString(params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider);
|
|
372
|
+
return {
|
|
373
|
+
role: "user",
|
|
374
|
+
content: params.prompt,
|
|
375
|
+
timestamp: Date.now(),
|
|
376
|
+
...params.inputProvenance ? { provenance: params.inputProvenance } : {},
|
|
377
|
+
...sourceChannel ? { sourceChannel } : {},
|
|
378
|
+
...senderId ? { senderId } : {},
|
|
379
|
+
...senderName ? { senderName } : {},
|
|
380
|
+
...senderUsername ? { senderUsername } : {},
|
|
381
|
+
...senderE164 ? { senderE164 } : {},
|
|
382
|
+
...senderLabel ? { senderLabel } : {}
|
|
383
|
+
};
|
|
384
|
+
}
|
|
350
385
|
/**
|
|
351
386
|
* Tag a message with a stable logical identity for mirror dedupe. Callers
|
|
352
387
|
* should use a value that is invariant for the same logical message across
|
|
@@ -596,11 +631,7 @@ var CodexAppServerEventProjector = class {
|
|
|
596
631
|
const planText = collectTextValues(this.planTextByItem).join("\n\n");
|
|
597
632
|
const lastAssistant = assistantTexts.length > 0 ? this.createAssistantMessage(assistantTexts.join("\n\n")) : void 0;
|
|
598
633
|
const turnId = this.turnId;
|
|
599
|
-
const messagesSnapshot = [attachCodexMirrorIdentity({
|
|
600
|
-
role: "user",
|
|
601
|
-
content: this.params.prompt,
|
|
602
|
-
timestamp: Date.now()
|
|
603
|
-
}, `${turnId}:prompt`)];
|
|
634
|
+
const messagesSnapshot = [attachCodexMirrorIdentity(buildCodexUserPromptMessage(this.params), `${turnId}:prompt`)];
|
|
604
635
|
if (reasoningText) messagesSnapshot.push(attachCodexMirrorIdentity(this.createAssistantMirrorMessage("Codex reasoning", reasoningText), `${turnId}:reasoning`));
|
|
605
636
|
if (planText) messagesSnapshot.push(attachCodexMirrorIdentity(this.createAssistantMirrorMessage("Codex plan", planText), `${turnId}:plan`));
|
|
606
637
|
messagesSnapshot.push(...this.toolTranscriptMessages);
|
|
@@ -1703,7 +1734,7 @@ const CODEX_HOOK_EVENT_BY_NATIVE_EVENT = {
|
|
|
1703
1734
|
};
|
|
1704
1735
|
function buildCodexNativeHookRelayConfig(params) {
|
|
1705
1736
|
const events = params.events?.length ? params.events : CODEX_NATIVE_HOOK_RELAY_EVENTS;
|
|
1706
|
-
const config = { "features.
|
|
1737
|
+
const config = { "features.hooks": true };
|
|
1707
1738
|
for (const event of events) {
|
|
1708
1739
|
const codexEvent = CODEX_HOOK_EVENT_BY_NATIVE_EVENT[event];
|
|
1709
1740
|
config[`hooks.${codexEvent}`] = [{
|
|
@@ -1721,7 +1752,7 @@ function buildCodexNativeHookRelayConfig(params) {
|
|
|
1721
1752
|
}
|
|
1722
1753
|
function buildCodexNativeHookRelayDisabledConfig() {
|
|
1723
1754
|
return {
|
|
1724
|
-
"features.
|
|
1755
|
+
"features.hooks": false,
|
|
1725
1756
|
"hooks.PreToolUse": [],
|
|
1726
1757
|
"hooks.PostToolUse": [],
|
|
1727
1758
|
"hooks.PermissionRequest": [],
|
|
@@ -2394,6 +2425,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2394
2425
|
...hookContextWindowFields
|
|
2395
2426
|
};
|
|
2396
2427
|
if (activeContextEngine) {
|
|
2428
|
+
const activeContextEnginePluginId = resolveContextEngineOwnerPluginId(activeContextEngine);
|
|
2397
2429
|
await bootstrapHarnessContextEngine({
|
|
2398
2430
|
hadSessionFile,
|
|
2399
2431
|
contextEngine: activeContextEngine,
|
|
@@ -2404,6 +2436,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2404
2436
|
attempt: runtimeParams,
|
|
2405
2437
|
workspaceDir: effectiveWorkspace,
|
|
2406
2438
|
agentDir,
|
|
2439
|
+
activeAgentId: sessionAgentId,
|
|
2440
|
+
contextEnginePluginId: activeContextEnginePluginId,
|
|
2407
2441
|
tokenBudget: params.contextTokenBudget
|
|
2408
2442
|
}),
|
|
2409
2443
|
runMaintenance: runHarnessContextEngineMaintenance,
|
|
@@ -2557,6 +2591,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2557
2591
|
const threadLifecycleParams = {
|
|
2558
2592
|
client: startupClient,
|
|
2559
2593
|
params: runtimeParams,
|
|
2594
|
+
agentId: sessionAgentId,
|
|
2560
2595
|
cwd: effectiveWorkspace,
|
|
2561
2596
|
dynamicTools: toolBridge.specs,
|
|
2562
2597
|
appServer: pluginAppServer,
|
|
@@ -2916,6 +2951,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2916
2951
|
}
|
|
2917
2952
|
if (isCurrentTurnNotification) updateActiveTurnItemIds(notification, activeTurnItemIds);
|
|
2918
2953
|
const unblockedAssistantCompletionRelease = isCurrentTurnNotification && turnAssistantCompletionIdleWatchArmed && notification.method === "item/completed" && activeTurnItemIds.size === 0;
|
|
2954
|
+
const trackedDynamicToolCompletion = isTrackedOpenClawDynamicToolCompletionNotification(notification, activeOpenClawDynamicToolCallIds);
|
|
2955
|
+
const shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem = isCurrentTurnNotification && notification.method === "item/completed" && activeTurnItemIds.size === 0 && !trackedDynamicToolCompletion && !isCompletedAssistantNotification(notification);
|
|
2919
2956
|
if (isCurrentTurnNotification && notification.method === "error") {
|
|
2920
2957
|
if (isRetryableErrorNotification(notification.params)) disarmTurnCompletionIdleWatch();
|
|
2921
2958
|
else armTurnCompletionIdleWatch({ pinnedByTerminalError: true });
|
|
@@ -2923,8 +2960,9 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2923
2960
|
} else if (isTurnCompletion) disarmTurnAssistantCompletionIdleWatch();
|
|
2924
2961
|
else if (isCurrentTurnNotification && isCompletedAssistantNotification(notification)) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
|
|
2925
2962
|
else if (unblockedAssistantCompletionRelease) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
|
|
2963
|
+
else if (shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) armTurnCompletionIdleWatch();
|
|
2926
2964
|
else if (isCurrentTurnNotification && shouldDisarmAssistantCompletionIdleWatch(notification)) disarmTurnAssistantCompletionIdleWatch();
|
|
2927
|
-
if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification && !
|
|
2965
|
+
if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification && !trackedDynamicToolCompletion && !shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) disarmTurnCompletionIdleWatch();
|
|
2928
2966
|
const isTurnAbortMarker = isCurrentTurnNotification && isCodexTurnAbortMarkerNotification(notification, { currentPromptText: promptBuild.prompt });
|
|
2929
2967
|
const isTurnTerminal = isTurnCompletion || isTurnAbortMarker;
|
|
2930
2968
|
try {
|
|
@@ -3089,11 +3127,10 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3089
3127
|
historyMessages,
|
|
3090
3128
|
imagesCount: params.images?.length ?? 0
|
|
3091
3129
|
};
|
|
3092
|
-
const turnStartFailureMessages = [...historyMessages, {
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
}];
|
|
3130
|
+
const turnStartFailureMessages = [...historyMessages, buildCodexUserPromptMessage({
|
|
3131
|
+
...params,
|
|
3132
|
+
prompt: promptBuild.prompt
|
|
3133
|
+
})];
|
|
3097
3134
|
let turn;
|
|
3098
3135
|
const startCodexTurn = async () => assertCodexTurnStartResponse(await client.request("turn/start", buildTurnStartParams(params, {
|
|
3099
3136
|
threadId: thread.threadId,
|
|
@@ -3237,6 +3274,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3237
3274
|
projector = new CodexAppServerEventProjector(params, thread.threadId, activeTurnId, { nativePostToolUseRelayEnabled: nativeHookRelay?.allowedEvents.includes("post_tool_use") === true });
|
|
3238
3275
|
emitLifecycleStart();
|
|
3239
3276
|
const activeProjector = projector;
|
|
3277
|
+
turnTerminalIdleWatchArmed = true;
|
|
3278
|
+
touchTurnCompletionActivity("turn:start", { arm: true });
|
|
3240
3279
|
for (const notification of pendingNotifications.splice(0)) await enqueueNotification(notification);
|
|
3241
3280
|
if (!completed && isTerminalTurnStatus(turn.turn.status)) await enqueueNotification({
|
|
3242
3281
|
method: "turn/completed",
|
|
@@ -3263,8 +3302,6 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3263
3302
|
abort: () => runAbortController.abort("aborted")
|
|
3264
3303
|
};
|
|
3265
3304
|
setActiveEmbeddedRun(params.sessionId, handle, params.sessionKey);
|
|
3266
|
-
turnTerminalIdleWatchArmed = true;
|
|
3267
|
-
touchTurnCompletionActivity("turn:start");
|
|
3268
3305
|
const timeout = setTimeout(() => {
|
|
3269
3306
|
timedOut = true;
|
|
3270
3307
|
projector?.markTimedOut();
|
|
@@ -3342,6 +3379,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3342
3379
|
...finalAborted ? { aborted: true } : {}
|
|
3343
3380
|
});
|
|
3344
3381
|
if (activeContextEngine) {
|
|
3382
|
+
const activeContextEnginePluginId = resolveContextEngineOwnerPluginId(activeContextEngine);
|
|
3345
3383
|
const finalMessages = await readMirroredSessionHistoryMessages(params.sessionFile) ?? historyMessages.concat(result.messagesSnapshot);
|
|
3346
3384
|
await finalizeHarnessContextEngineTurn({
|
|
3347
3385
|
contextEngine: activeContextEngine,
|
|
@@ -3358,6 +3396,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3358
3396
|
attempt: runtimeParams,
|
|
3359
3397
|
workspaceDir: effectiveWorkspace,
|
|
3360
3398
|
agentDir,
|
|
3399
|
+
activeAgentId: sessionAgentId,
|
|
3400
|
+
contextEnginePluginId: activeContextEnginePluginId,
|
|
3361
3401
|
tokenBudget: params.contextTokenBudget,
|
|
3362
3402
|
lastCallUsage: result.attemptUsage,
|
|
3363
3403
|
promptCache: result.promptCache
|
|
@@ -3650,14 +3690,12 @@ function resolveOpenClawCodingToolsSessionKeys(params, sandboxSessionKey) {
|
|
|
3650
3690
|
runSessionKey: params.sessionKey && params.sessionKey !== sandboxSessionKey ? params.sessionKey : void 0
|
|
3651
3691
|
};
|
|
3652
3692
|
}
|
|
3653
|
-
|
|
3693
|
+
function buildOpenClawCodingToolsOptions(input) {
|
|
3654
3694
|
const { params } = input;
|
|
3655
|
-
if (params.disableTools || !supportsModelTools(params.model)) return [];
|
|
3656
3695
|
const modelHasVision = params.model.input?.includes("image") ?? false;
|
|
3657
3696
|
const agentDir = params.agentDir ?? resolveAgentDir$1(params.config ?? {}, input.sessionAgentId);
|
|
3658
|
-
const createOpenClawCodingTools = openClawCodingToolsFactoryForTests ?? (await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;
|
|
3659
3697
|
const sessionKeys = resolveOpenClawCodingToolsSessionKeys(params, input.sandboxSessionKey);
|
|
3660
|
-
|
|
3698
|
+
return {
|
|
3661
3699
|
agentId: input.sessionAgentId,
|
|
3662
3700
|
...buildEmbeddedAttemptToolRunContext(params),
|
|
3663
3701
|
exec: {
|
|
@@ -3721,8 +3759,15 @@ async function buildDynamicTools(input) {
|
|
|
3721
3759
|
});
|
|
3722
3760
|
input.runAbortController.abort("sessions_yield");
|
|
3723
3761
|
}
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3762
|
+
};
|
|
3763
|
+
}
|
|
3764
|
+
async function buildDynamicTools(input) {
|
|
3765
|
+
const { params } = input;
|
|
3766
|
+
if (params.disableTools || !supportsModelTools(params.model)) return [];
|
|
3767
|
+
const createOpenClawCodingTools = openClawCodingToolsFactoryForTests ?? (await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;
|
|
3768
|
+
const toolOptions = buildOpenClawCodingToolsOptions(input);
|
|
3769
|
+
const filteredTools = filterCodexDynamicToolsForAllowlist(filterToolsForVisionInputs(filterCodexDynamicTools(createOpenClawCodingTools(toolOptions), input.pluginConfig), {
|
|
3770
|
+
modelHasVision: toolOptions.modelHasVision ?? false,
|
|
3726
3771
|
hasInboundImages: (params.images?.length ?? 0) > 0
|
|
3727
3772
|
}), includeForcedMessageToolAllow(params.toolsAllow, params));
|
|
3728
3773
|
return normalizeAgentRuntimeTools({
|
|
@@ -2,11 +2,11 @@ import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions }
|
|
|
2
2
|
import { a as readCodexDynamicToolCallParams, i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, t as assertCodexThreadForkResponse } from "./protocol-validators-CSY0BFBo.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
4
|
import { r as isCodexAppServerApprovalRequest } from "./client-CoctX13d.js";
|
|
5
|
-
import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-
|
|
5
|
+
import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BRW7_Nu7.js";
|
|
6
6
|
import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-BwUqd3lh.js";
|
|
7
7
|
import { i as readCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
8
|
-
import { c as resolveCodexAppServerModelProvider, l as resolveReasoningEffort, n as buildCodexRuntimeThreadConfig, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-
|
|
9
|
-
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-
|
|
8
|
+
import { c as resolveCodexAppServerModelProvider, l as resolveReasoningEffort, n as buildCodexRuntimeThreadConfig, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-BzY-GLGu.js";
|
|
9
|
+
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-CyhFwJIY.js";
|
|
10
10
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.js";
|
|
11
11
|
import { embeddedAgentLog, formatErrorMessage, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
12
|
//#region extensions/codex/src/app-server/side-question.ts
|
package/dist/test-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
|
-
import { a as buildThreadStartParams, i as buildThreadResumeParams, o as buildTurnStartParams, r as buildDeveloperInstructions, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-
|
|
2
|
+
import { a as buildThreadStartParams, i as buildThreadResumeParams, o as buildTurnStartParams, r as buildDeveloperInstructions, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-BzY-GLGu.js";
|
|
3
3
|
//#region extensions/codex/test-api.ts
|
|
4
4
|
function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
|
|
5
5
|
return resolveCodexAppServerRuntimeOptions({
|
|
@@ -17,7 +17,11 @@ const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
|
|
|
17
17
|
"apply_patch",
|
|
18
18
|
"exec",
|
|
19
19
|
"process",
|
|
20
|
-
"update_plan"
|
|
20
|
+
"update_plan",
|
|
21
|
+
"tool_search_code",
|
|
22
|
+
"tool_search",
|
|
23
|
+
"tool_describe",
|
|
24
|
+
"tool_call"
|
|
21
25
|
];
|
|
22
26
|
const DYNAMIC_TOOL_NAME_ALIASES = {
|
|
23
27
|
bash: "exec",
|
|
@@ -705,7 +709,7 @@ const CODEX_LIGHTWEIGHT_CONTEXT_THREAD_CONFIG = { project_doc_max_bytes: 0 };
|
|
|
705
709
|
async function startOrResumeThread(params) {
|
|
706
710
|
const dynamicToolsFingerprint = fingerprintDynamicTools(params.dynamicTools);
|
|
707
711
|
const contextEngineBinding = buildContextEngineBinding(params.params);
|
|
708
|
-
const userMcpServersConfigPatch = buildCodexUserMcpServersThreadConfigPatch(params.params.config);
|
|
712
|
+
const userMcpServersConfigPatch = buildCodexUserMcpServersThreadConfigPatch(params.params.config, { agentId: params.agentId ?? params.params.agentId });
|
|
709
713
|
const userMcpServersFingerprint = fingerprintUserMcpServersConfigPatch(userMcpServersConfigPatch);
|
|
710
714
|
let binding = await readCodexAppServerBinding(params.params.sessionFile, {
|
|
711
715
|
authProfileStore: params.params.authProfileStore,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
2
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
2
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BRW7_Nu7.js";
|
|
3
3
|
import { callGatewayTool, embeddedAgentLog, formatApprovalDisplayPath } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
4
|
//#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
|
|
5
5
|
const DEFAULT_CODEX_APPROVAL_TIMEOUT_MS = 12e4;
|
package/openclaw.plugin.json
CHANGED
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
},
|
|
334
334
|
"appServer.turnCompletionIdleTimeoutMs": {
|
|
335
335
|
"label": "Turn Completion Idle Timeout",
|
|
336
|
-
"help": "Maximum quiet time after a turn-scoped
|
|
336
|
+
"help": "Maximum quiet time after Codex accepts a turn or after a turn-scoped app-server request before OpenClaw interrupts the turn while waiting for turn/completed.",
|
|
337
337
|
"advanced": true
|
|
338
338
|
},
|
|
339
339
|
"appServer.approvalPolicy": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.16-beta.1",
|
|
4
4
|
"description": "OpenClaw Codex harness and model provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.5.1-beta.1"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.5.
|
|
30
|
+
"pluginApi": ">=2026.5.16-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.
|
|
33
|
+
"openclawVersion": "2026.5.16-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"release": {
|
|
36
36
|
"publishToClawHub": true,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"openclaw.plugin.json"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"openclaw": ">=2026.5.
|
|
48
|
+
"openclaw": ">=2026.5.16-beta.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|