@openclaw/codex 2026.5.3 → 2026.5.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-chGfNrq5.js → client-BGbqC7jk.js} +2 -2
- package/dist/{client-factory-MaOMEltT.js → client-factory--cll1Fba.js} +3 -2
- package/dist/command-formatters-PiJcdUbu.js +337 -0
- package/dist/{command-handlers-CeaXhO5y.js → command-handlers-Bbr7RAUs.js} +170 -177
- package/dist/{compact-C0_rGlHZ.js → compact-DcR5aTxd.js} +4 -4
- package/dist/{config-CkkoMeqF.js → config-ByrA30No.js} +0 -2
- package/dist/{conversation-binding-DjptpT9W.js → conversation-binding-IhbXJcXQ.js} +86 -48
- package/dist/doctor-contract-api.js +19 -0
- package/dist/harness.js +3 -3
- package/dist/index.js +8 -3
- package/dist/media-understanding-provider.js +4 -4
- package/dist/{models-Ds7g6191.js → models-CkowdYbm.js} +6 -4
- package/dist/{protocol-validators-Cpopom3_.js → protocol-validators-Dky2yV4W.js} +2354 -2258
- package/dist/provider.js +2 -2
- package/dist/{computer-use-amNk2zrB.js → rate-limit-cache-t6ebYmfS.js} +29 -5
- package/dist/{run-attempt-BNbVe-IG.js → run-attempt-CFL1BFBl.js} +360 -129
- package/dist/{shared-client-0El8eRIE.js → shared-client-Dfk3Enm-.js} +43 -23
- package/dist/test-api.js +2 -2
- package/dist/{thread-lifecycle-OAlp5Pku.js → thread-lifecycle-CzllX4PU.js} +61 -23
- package/package.json +6 -6
- package/dist/capabilities-BmhO5h8O.js +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
|
|
2
|
-
import { i as resolveCodexAppServerRuntimeOptions, t as codexAppServerStartOptionsKey } from "./config-
|
|
3
|
-
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-
|
|
2
|
+
import { i as resolveCodexAppServerRuntimeOptions, t as codexAppServerStartOptionsKey } from "./config-ByrA30No.js";
|
|
3
|
+
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-BGbqC7jk.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import fs, { access } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
@@ -25,8 +25,10 @@ async function bridgeCodexAppServerStartOptions(params) {
|
|
|
25
25
|
store,
|
|
26
26
|
authProfileId: resolveCodexAppServerAuthProfileId({
|
|
27
27
|
authProfileId: params.authProfileId,
|
|
28
|
-
store
|
|
29
|
-
|
|
28
|
+
store,
|
|
29
|
+
config: params.config
|
|
30
|
+
}),
|
|
31
|
+
config: params.config
|
|
30
32
|
}) ? withClearedEnvironmentVariables(isolatedStartOptions, CODEX_APP_SERVER_API_KEY_ENV_VARS) : isolatedStartOptions;
|
|
31
33
|
}
|
|
32
34
|
function resolveCodexAppServerAuthProfileId(params) {
|
|
@@ -76,7 +78,8 @@ function withoutClearedCodexIsolationEnv(clearEnv) {
|
|
|
76
78
|
async function applyCodexAppServerAuthProfile(params) {
|
|
77
79
|
const loginParams = await resolveCodexAppServerAuthProfileLoginParams({
|
|
78
80
|
agentDir: params.agentDir,
|
|
79
|
-
authProfileId: params.authProfileId
|
|
81
|
+
authProfileId: params.authProfileId,
|
|
82
|
+
config: params.config
|
|
80
83
|
});
|
|
81
84
|
if (!loginParams) {
|
|
82
85
|
if (params.startOptions?.transport !== "stdio") return;
|
|
@@ -109,15 +112,17 @@ async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
|
|
|
109
112
|
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
110
113
|
const profileId = resolveCodexAppServerAuthProfileId({
|
|
111
114
|
authProfileId: params.authProfileId,
|
|
112
|
-
store
|
|
115
|
+
store,
|
|
116
|
+
config: params.config
|
|
113
117
|
});
|
|
114
118
|
if (!profileId) return;
|
|
115
119
|
const credential = store.profiles[profileId];
|
|
116
120
|
if (!credential) throw new Error(`Codex app-server auth profile "${profileId}" was not found.`);
|
|
117
|
-
if (!isCodexAppServerAuthProvider(credential.provider)) throw new Error(`Codex app-server auth profile "${profileId}" must belong to provider "openai-codex" or a supported alias.`);
|
|
121
|
+
if (!isCodexAppServerAuthProvider(credential.provider, params.config)) throw new Error(`Codex app-server auth profile "${profileId}" must belong to provider "openai-codex" or a supported alias.`);
|
|
118
122
|
const loginParams = await resolveLoginParamsForCredential(profileId, credential, {
|
|
119
123
|
agentDir: params.agentDir,
|
|
120
|
-
forceOAuthRefresh: params.forceOAuthRefresh === true
|
|
124
|
+
forceOAuthRefresh: params.forceOAuthRefresh === true,
|
|
125
|
+
config: params.config
|
|
121
126
|
});
|
|
122
127
|
if (!loginParams) throw new Error(`Codex app-server auth profile "${profileId}" does not contain usable credentials.`);
|
|
123
128
|
return loginParams;
|
|
@@ -154,7 +159,8 @@ async function resolveLoginParamsForCredential(profileId, credential, params) {
|
|
|
154
159
|
}
|
|
155
160
|
const resolvedCredential = await resolveOAuthCredentialForCodexAppServer(profileId, credential, {
|
|
156
161
|
agentDir: params.agentDir,
|
|
157
|
-
forceRefresh: params.forceOAuthRefresh
|
|
162
|
+
forceRefresh: params.forceOAuthRefresh,
|
|
163
|
+
config: params.config
|
|
158
164
|
});
|
|
159
165
|
const accessToken = resolvedCredential.access?.trim();
|
|
160
166
|
return accessToken ? buildChatgptAuthTokensParams(profileId, resolvedCredential, accessToken) : void 0;
|
|
@@ -166,7 +172,7 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
|
|
|
166
172
|
});
|
|
167
173
|
const store = ensureAuthProfileStore(ownerAgentDir, { allowKeychainPrompt: false });
|
|
168
174
|
const ownerCredential = store.profiles[profileId];
|
|
169
|
-
const credentialForOwner = ownerCredential?.type === "oauth" && isCodexAppServerAuthProvider(ownerCredential.provider) ? ownerCredential : credential;
|
|
175
|
+
const credentialForOwner = ownerCredential?.type === "oauth" && isCodexAppServerAuthProvider(ownerCredential.provider, params.config) ? ownerCredential : credential;
|
|
170
176
|
if (params.forceRefresh) {
|
|
171
177
|
store.profiles[profileId] = {
|
|
172
178
|
...credentialForOwner,
|
|
@@ -181,21 +187,21 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
|
|
|
181
187
|
});
|
|
182
188
|
const refreshed = loadAuthProfileStoreForSecretsRuntime(ownerAgentDir).profiles[profileId];
|
|
183
189
|
const storedCredential = store.profiles[profileId];
|
|
184
|
-
const candidate = refreshed?.type === "oauth" && isCodexAppServerAuthProvider(refreshed.provider) ? refreshed : storedCredential?.type === "oauth" && isCodexAppServerAuthProvider(storedCredential.provider) ? storedCredential : credential;
|
|
190
|
+
const candidate = refreshed?.type === "oauth" && isCodexAppServerAuthProvider(refreshed.provider, params.config) ? refreshed : storedCredential?.type === "oauth" && isCodexAppServerAuthProvider(storedCredential.provider, params.config) ? storedCredential : credential;
|
|
185
191
|
return resolved?.apiKey ? {
|
|
186
192
|
...candidate,
|
|
187
193
|
access: resolved.apiKey
|
|
188
194
|
} : candidate;
|
|
189
195
|
}
|
|
190
|
-
function isCodexAppServerAuthProvider(provider) {
|
|
191
|
-
return resolveProviderIdForAuth(provider) === CODEX_APP_SERVER_AUTH_PROVIDER;
|
|
196
|
+
function isCodexAppServerAuthProvider(provider, config) {
|
|
197
|
+
return resolveProviderIdForAuth(provider, { config }) === CODEX_APP_SERVER_AUTH_PROVIDER;
|
|
192
198
|
}
|
|
193
199
|
function shouldClearOpenAiApiKeyForCodexAuthProfile(params) {
|
|
194
200
|
const profileId = params.authProfileId?.trim();
|
|
195
|
-
return isCodexSubscriptionCredential(profileId ? params.store.profiles[profileId] : params.store.profiles[OPENAI_CODEX_DEFAULT_PROFILE_ID]);
|
|
201
|
+
return isCodexSubscriptionCredential(profileId ? params.store.profiles[profileId] : params.store.profiles[OPENAI_CODEX_DEFAULT_PROFILE_ID], params.config);
|
|
196
202
|
}
|
|
197
|
-
function isCodexSubscriptionCredential(credential) {
|
|
198
|
-
if (!credential || !isCodexAppServerAuthProvider(credential.provider)) return false;
|
|
203
|
+
function isCodexSubscriptionCredential(credential, config) {
|
|
204
|
+
if (!credential || !isCodexAppServerAuthProvider(credential.provider, config)) return false;
|
|
199
205
|
return credential.type === "oauth" || credential.type === "token";
|
|
200
206
|
}
|
|
201
207
|
function withClearedEnvironmentVariables(startOptions, envVars) {
|
|
@@ -362,13 +368,19 @@ function getSharedCodexAppServerClientState() {
|
|
|
362
368
|
async function getSharedCodexAppServerClient(options) {
|
|
363
369
|
const state = getSharedCodexAppServerClientState();
|
|
364
370
|
const agentDir = options?.agentDir ?? resolveOpenClawAgentDir$1();
|
|
371
|
+
const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
|
|
372
|
+
authProfileId: options?.authProfileId,
|
|
373
|
+
agentDir,
|
|
374
|
+
config: options?.config
|
|
375
|
+
});
|
|
365
376
|
const startOptions = await bridgeCodexAppServerStartOptions({
|
|
366
377
|
startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
|
|
367
378
|
agentDir,
|
|
368
|
-
authProfileId
|
|
379
|
+
authProfileId,
|
|
380
|
+
config: options?.config
|
|
369
381
|
});
|
|
370
382
|
const key = codexAppServerStartOptionsKey(startOptions, {
|
|
371
|
-
authProfileId
|
|
383
|
+
authProfileId,
|
|
372
384
|
agentDir
|
|
373
385
|
});
|
|
374
386
|
if (state.key && state.key !== key) clearSharedCodexAppServerClient();
|
|
@@ -382,8 +394,9 @@ async function getSharedCodexAppServerClient(options) {
|
|
|
382
394
|
await applyCodexAppServerAuthProfile({
|
|
383
395
|
client,
|
|
384
396
|
agentDir,
|
|
385
|
-
authProfileId
|
|
386
|
-
startOptions
|
|
397
|
+
authProfileId,
|
|
398
|
+
startOptions,
|
|
399
|
+
config: options?.config
|
|
387
400
|
});
|
|
388
401
|
return client;
|
|
389
402
|
} catch (error) {
|
|
@@ -400,10 +413,16 @@ async function getSharedCodexAppServerClient(options) {
|
|
|
400
413
|
}
|
|
401
414
|
async function createIsolatedCodexAppServerClient(options) {
|
|
402
415
|
const agentDir = options?.agentDir ?? resolveOpenClawAgentDir$1();
|
|
416
|
+
const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
|
|
417
|
+
authProfileId: options?.authProfileId,
|
|
418
|
+
agentDir,
|
|
419
|
+
config: options?.config
|
|
420
|
+
});
|
|
403
421
|
const startOptions = await bridgeCodexAppServerStartOptions({
|
|
404
422
|
startOptions: await resolveManagedCodexAppServerStartOptions(options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start),
|
|
405
423
|
agentDir,
|
|
406
|
-
authProfileId
|
|
424
|
+
authProfileId,
|
|
425
|
+
config: options?.config
|
|
407
426
|
});
|
|
408
427
|
const client = CodexAppServerClient.start(startOptions);
|
|
409
428
|
const initialize = client.initialize();
|
|
@@ -412,8 +431,9 @@ async function createIsolatedCodexAppServerClient(options) {
|
|
|
412
431
|
await applyCodexAppServerAuthProfile({
|
|
413
432
|
client,
|
|
414
433
|
agentDir,
|
|
415
|
-
authProfileId
|
|
416
|
-
startOptions
|
|
434
|
+
authProfileId,
|
|
435
|
+
startOptions,
|
|
436
|
+
config: options?.config
|
|
417
437
|
});
|
|
418
438
|
return client;
|
|
419
439
|
} catch (error) {
|
package/dist/test-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import {
|
|
1
|
+
import { i as resolveCodexAppServerRuntimeOptions } from "./config-ByrA30No.js";
|
|
2
|
+
import { a as buildTurnStartParams, c as createCodexDynamicToolBridge, i as buildThreadStartParams, l as applyCodexDynamicToolProfile, n as buildDeveloperInstructions, r as buildThreadResumeParams } from "./thread-lifecycle-CzllX4PU.js";
|
|
3
3
|
//#region extensions/codex/test-api.ts
|
|
4
4
|
function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
|
|
5
5
|
return resolveCodexAppServerRuntimeOptions({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as codexSandboxPolicyForTurn } from "./config-
|
|
2
|
-
import { n as assertCodexThreadStartResponse, t as assertCodexThreadResumeResponse } from "./protocol-validators-
|
|
1
|
+
import { n as codexSandboxPolicyForTurn } from "./config-ByrA30No.js";
|
|
2
|
+
import { n as assertCodexThreadStartResponse, t as assertCodexThreadResumeResponse } from "./protocol-validators-Dky2yV4W.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
4
|
import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, renderCodexPromptOverlay } from "./prompt-overlay.js";
|
|
5
5
|
import { isModernCodexModel } from "./provider.js";
|
|
6
|
-
import { i as isCodexAppServerConnectionClosedError } from "./client-
|
|
6
|
+
import { i as isCodexAppServerConnectionClosedError } from "./client-BGbqC7jk.js";
|
|
7
7
|
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DuJYTJQy.js";
|
|
8
8
|
import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractToolResultMediaArtifact, filterToolResultMediaUrls, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
9
|
//#region extensions/codex/src/app-server/dynamic-tool-profile.ts
|
|
@@ -28,6 +28,7 @@ function applyCodexDynamicToolProfile(tools, config) {
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region extensions/codex/src/app-server/dynamic-tools.ts
|
|
30
30
|
function createCodexDynamicToolBridge(params) {
|
|
31
|
+
const toolResultHookContext = toToolResultHookContext(params.hookContext);
|
|
31
32
|
const tools = params.tools.map((tool) => isToolWrappedWithBeforeToolCallHook(tool) ? tool : wrapToolWithBeforeToolCallHook(tool, params.hookContext));
|
|
32
33
|
const toolMap = new Map(tools.map((tool) => [tool.name, tool]));
|
|
33
34
|
const telemetry = {
|
|
@@ -40,9 +41,9 @@ function createCodexDynamicToolBridge(params) {
|
|
|
40
41
|
};
|
|
41
42
|
const middlewareRunner = createAgentToolResultMiddlewareRunner({
|
|
42
43
|
runtime: "codex",
|
|
43
|
-
...
|
|
44
|
+
...toolResultHookContext
|
|
44
45
|
});
|
|
45
|
-
const legacyExtensionRunner = createCodexAppServerToolResultExtensionRunner(
|
|
46
|
+
const legacyExtensionRunner = createCodexAppServerToolResultExtensionRunner(toolResultHookContext);
|
|
46
47
|
return {
|
|
47
48
|
specs: tools.map((tool) => ({
|
|
48
49
|
name: tool.name,
|
|
@@ -83,28 +84,29 @@ function createCodexDynamicToolBridge(params) {
|
|
|
83
84
|
args,
|
|
84
85
|
result: middlewareResult
|
|
85
86
|
});
|
|
87
|
+
const resultIsError = rawIsError || isToolResultError(result);
|
|
86
88
|
collectToolTelemetry({
|
|
87
89
|
toolName: tool.name,
|
|
88
90
|
args,
|
|
89
91
|
result,
|
|
90
92
|
mediaTrustResult: rawResult,
|
|
91
93
|
telemetry,
|
|
92
|
-
isError:
|
|
94
|
+
isError: resultIsError
|
|
93
95
|
});
|
|
94
96
|
runAgentHarnessAfterToolCallHook({
|
|
95
97
|
toolName: tool.name,
|
|
96
98
|
toolCallId: call.callId,
|
|
97
|
-
runId:
|
|
98
|
-
agentId:
|
|
99
|
-
sessionId:
|
|
100
|
-
sessionKey:
|
|
99
|
+
runId: toolResultHookContext.runId,
|
|
100
|
+
agentId: toolResultHookContext.agentId,
|
|
101
|
+
sessionId: toolResultHookContext.sessionId,
|
|
102
|
+
sessionKey: toolResultHookContext.sessionKey,
|
|
101
103
|
startArgs: args,
|
|
102
104
|
result,
|
|
103
105
|
startedAt
|
|
104
106
|
});
|
|
105
107
|
return {
|
|
106
108
|
contentItems: result.content.flatMap(convertToolContent),
|
|
107
|
-
success:
|
|
109
|
+
success: !resultIsError
|
|
108
110
|
};
|
|
109
111
|
} catch (error) {
|
|
110
112
|
collectToolTelemetry({
|
|
@@ -117,10 +119,10 @@ function createCodexDynamicToolBridge(params) {
|
|
|
117
119
|
runAgentHarnessAfterToolCallHook({
|
|
118
120
|
toolName: tool.name,
|
|
119
121
|
toolCallId: call.callId,
|
|
120
|
-
runId:
|
|
121
|
-
agentId:
|
|
122
|
-
sessionId:
|
|
123
|
-
sessionKey:
|
|
122
|
+
runId: toolResultHookContext.runId,
|
|
123
|
+
agentId: toolResultHookContext.agentId,
|
|
124
|
+
sessionId: toolResultHookContext.sessionId,
|
|
125
|
+
sessionKey: toolResultHookContext.sessionKey,
|
|
124
126
|
startArgs: args,
|
|
125
127
|
error: error instanceof Error ? error.message : String(error),
|
|
126
128
|
startedAt
|
|
@@ -136,6 +138,15 @@ function createCodexDynamicToolBridge(params) {
|
|
|
136
138
|
}
|
|
137
139
|
};
|
|
138
140
|
}
|
|
141
|
+
function toToolResultHookContext(ctx) {
|
|
142
|
+
const { agentId, sessionId, sessionKey, runId } = ctx ?? {};
|
|
143
|
+
return {
|
|
144
|
+
...agentId && { agentId },
|
|
145
|
+
...sessionId && { sessionId },
|
|
146
|
+
...sessionKey && { sessionKey },
|
|
147
|
+
...runId && { runId }
|
|
148
|
+
};
|
|
149
|
+
}
|
|
139
150
|
function composeAbortSignals(...signals) {
|
|
140
151
|
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
141
152
|
if (activeSignals.length === 0) return new AbortController().signal;
|
|
@@ -170,7 +181,8 @@ function collectToolTelemetry(params) {
|
|
|
170
181
|
"content"
|
|
171
182
|
]);
|
|
172
183
|
if (text) params.telemetry.messagingToolSentTexts.push(text);
|
|
173
|
-
|
|
184
|
+
const mediaUrls = collectMediaUrls(params.args);
|
|
185
|
+
params.telemetry.messagingToolSentMediaUrls.push(...mediaUrls);
|
|
174
186
|
params.telemetry.messagingToolSentTargets.push({
|
|
175
187
|
tool: params.toolName,
|
|
176
188
|
provider: readFirstString(params.args, ["provider", "channel"]) ?? params.toolName,
|
|
@@ -184,7 +196,9 @@ function collectToolTelemetry(params) {
|
|
|
184
196
|
"threadId",
|
|
185
197
|
"thread_id",
|
|
186
198
|
"messageThreadId"
|
|
187
|
-
])
|
|
199
|
+
]),
|
|
200
|
+
...text ? { text } : {},
|
|
201
|
+
...mediaUrls.length > 0 ? { mediaUrls } : {}
|
|
188
202
|
});
|
|
189
203
|
}
|
|
190
204
|
function isRecord(value) {
|
|
@@ -265,9 +279,17 @@ async function startOrResumeThread(params) {
|
|
|
265
279
|
agentDir: params.params.agentDir,
|
|
266
280
|
config: params.params.config
|
|
267
281
|
});
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
282
|
+
let preserveExistingBinding = false;
|
|
283
|
+
if (binding?.threadId) if (binding.dynamicToolsFingerprint && !areDynamicToolFingerprintsCompatible(binding.dynamicToolsFingerprint, dynamicToolsFingerprint)) {
|
|
284
|
+
preserveExistingBinding = shouldStartTransientNoToolThread({
|
|
285
|
+
previous: binding.dynamicToolsFingerprint,
|
|
286
|
+
next: dynamicToolsFingerprint
|
|
287
|
+
});
|
|
288
|
+
if (preserveExistingBinding) embeddedAgentLog.debug("codex app-server dynamic tools unavailable for turn; starting transient thread", { threadId: binding.threadId });
|
|
289
|
+
else {
|
|
290
|
+
embeddedAgentLog.debug("codex app-server dynamic tool catalog changed; starting a new thread", { threadId: binding.threadId });
|
|
291
|
+
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
292
|
+
}
|
|
271
293
|
} else try {
|
|
272
294
|
const authProfileId = params.params.authProfileId ?? binding.authProfileId;
|
|
273
295
|
const response = assertCodexThreadResumeResponse(await params.client.request("thread/resume", buildThreadResumeParams(params.params, {
|
|
@@ -327,7 +349,7 @@ async function startOrResumeThread(params) {
|
|
|
327
349
|
config: params.params.config
|
|
328
350
|
});
|
|
329
351
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
330
|
-
await writeCodexAppServerBinding(params.params.sessionFile, {
|
|
352
|
+
if (!preserveExistingBinding) await writeCodexAppServerBinding(params.params.sessionFile, {
|
|
331
353
|
threadId: response.thread.id,
|
|
332
354
|
cwd: params.cwd,
|
|
333
355
|
authProfileId: params.params.authProfileId,
|
|
@@ -425,8 +447,14 @@ function buildTurnCollaborationMode(params) {
|
|
|
425
447
|
function buildHeartbeatCollaborationInstructions() {
|
|
426
448
|
return ["This is an OpenClaw heartbeat turn. Apply these instructions only to this heartbeat wake; ordinary chat turns should stay in Codex Default mode.", CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY].join("\n\n");
|
|
427
449
|
}
|
|
450
|
+
function codexDynamicToolsFingerprint(dynamicTools) {
|
|
451
|
+
return fingerprintDynamicTools(dynamicTools);
|
|
452
|
+
}
|
|
453
|
+
function areCodexDynamicToolFingerprintsCompatible(params) {
|
|
454
|
+
return areDynamicToolFingerprintsCompatible(params.previous, params.next);
|
|
455
|
+
}
|
|
428
456
|
function fingerprintDynamicTools(dynamicTools) {
|
|
429
|
-
return JSON.stringify(dynamicTools.map(fingerprintDynamicToolSpec));
|
|
457
|
+
return JSON.stringify(dynamicTools.map(fingerprintDynamicToolSpec).toSorted(compareJsonFingerprint));
|
|
430
458
|
}
|
|
431
459
|
function fingerprintDynamicToolSpec(tool) {
|
|
432
460
|
if (!isJsonObject(tool)) return stabilizeJsonValue(tool);
|
|
@@ -444,6 +472,16 @@ function stabilizeJsonValue(value) {
|
|
|
444
472
|
for (const [key, child] of Object.entries(value).toSorted(([left], [right]) => left.localeCompare(right))) stable[key] = stabilizeJsonValue(child);
|
|
445
473
|
return stable;
|
|
446
474
|
}
|
|
475
|
+
const EMPTY_DYNAMIC_TOOLS_FINGERPRINT = JSON.stringify([]);
|
|
476
|
+
function areDynamicToolFingerprintsCompatible(previous, next) {
|
|
477
|
+
return !previous || previous === next;
|
|
478
|
+
}
|
|
479
|
+
function shouldStartTransientNoToolThread(params) {
|
|
480
|
+
return Boolean(params.previous && params.previous !== EMPTY_DYNAMIC_TOOLS_FINGERPRINT && params.next === EMPTY_DYNAMIC_TOOLS_FINGERPRINT);
|
|
481
|
+
}
|
|
482
|
+
function compareJsonFingerprint(left, right) {
|
|
483
|
+
return JSON.stringify(left).localeCompare(JSON.stringify(right));
|
|
484
|
+
}
|
|
447
485
|
function buildDeveloperInstructions(params) {
|
|
448
486
|
return [
|
|
449
487
|
"You are running inside OpenClaw. Use OpenClaw dynamic tools for OpenClaw-specific integrations such as messaging, cron, sessions, media, gateway, and nodes when available.",
|
|
@@ -497,4 +535,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
|
|
|
497
535
|
return null;
|
|
498
536
|
}
|
|
499
537
|
//#endregion
|
|
500
|
-
export {
|
|
538
|
+
export { buildTurnStartParams as a, createCodexDynamicToolBridge as c, buildThreadStartParams as i, applyCodexDynamicToolProfile as l, buildDeveloperInstructions as n, codexDynamicToolsFingerprint as o, buildThreadResumeParams as r, startOrResumeThread as s, areCodexDynamicToolFingerprintsCompatible as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.4-beta.2",
|
|
4
4
|
"description": "OpenClaw Codex harness and model provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@mariozechner/pi-coding-agent": "0.
|
|
11
|
+
"@mariozechner/pi-coding-agent": "0.73.0",
|
|
12
12
|
"@openai/codex": "0.128.0",
|
|
13
13
|
"ajv": "^8.20.0",
|
|
14
14
|
"ws": "^8.20.0",
|
|
15
|
-
"zod": "^4.4.
|
|
15
|
+
"zod": "^4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@openclaw/plugin-sdk": "workspace:*"
|
|
@@ -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.4-beta.2"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.
|
|
33
|
+
"openclawVersion": "2026.5.4-beta.2"
|
|
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.4-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { n as CodexAppServerRpcError } from "./client-chGfNrq5.js";
|
|
2
|
-
//#region extensions/codex/src/app-server/capabilities.ts
|
|
3
|
-
const CODEX_CONTROL_METHODS = {
|
|
4
|
-
account: "account/read",
|
|
5
|
-
compact: "thread/compact/start",
|
|
6
|
-
feedback: "feedback/upload",
|
|
7
|
-
listMcpServers: "mcpServerStatus/list",
|
|
8
|
-
listSkills: "skills/list",
|
|
9
|
-
listThreads: "thread/list",
|
|
10
|
-
rateLimits: "account/rateLimits/read",
|
|
11
|
-
resumeThread: "thread/resume",
|
|
12
|
-
review: "review/start"
|
|
13
|
-
};
|
|
14
|
-
function describeControlFailure(error) {
|
|
15
|
-
if (isUnsupportedControlError(error)) return "unsupported by this Codex app-server";
|
|
16
|
-
return error instanceof Error ? error.message : String(error);
|
|
17
|
-
}
|
|
18
|
-
function isUnsupportedControlError(error) {
|
|
19
|
-
return error instanceof CodexAppServerRpcError && error.code === -32601;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { describeControlFailure as n, CODEX_CONTROL_METHODS as t };
|