@openclaw/codex 2026.5.12-beta.6 → 2026.5.12-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-factory-Bw7M3rdW.js → client-factory-DfnbdQv7.js} +1 -1
- package/dist/{client-kySkmL1r.js → client-iRf11BEu.js} +17 -1
- package/dist/{command-handlers-PjNRHJvR.js → command-handlers-BYf_veEb.js} +5 -5
- package/dist/{compact-Hyo2qw1o.js → compact-Bl8jRPk4.js} +2 -2
- package/dist/{computer-use-CxZtHe2d.js → computer-use-Ct3ngNBt.js} +1 -1
- package/dist/{conversation-binding-C9cDz5yO.js → conversation-binding-CKofEetY.js} +3 -3
- package/dist/harness.js +5 -5
- package/dist/index.js +6 -6
- package/dist/media-understanding-provider.js +2 -2
- package/dist/{models-DqfYggBz.js → models-BmLfrDci.js} +1 -1
- package/dist/{plugin-app-cache-key-DjrZp49q.js → plugin-app-cache-key-B7eU8fNZ.js} +1 -1
- package/dist/provider.js +1 -1
- package/dist/{request-BbINGs00.js → request-ohCy5ASa.js} +2 -2
- package/dist/{run-attempt-Pt1oe-_9.js → run-attempt-4t06MuNr.js} +34 -12
- package/dist/{session-binding-BrQ-kLlK.js → session-binding-CMTXuyoz.js} +2 -0
- package/dist/{shared-client-DSSqFqHM.js → shared-client-Cr6W-a2G.js} +8 -9
- package/dist/{side-question-ByLC-uHj.js → side-question-DV7KYIB8.js} +4 -4
- package/dist/test-api.js +1 -1
- package/dist/{thread-lifecycle-DMn8qeke.js → thread-lifecycle-CJppEyYT.js} +46 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region extensions/codex/src/app-server/client-factory.ts
|
|
2
|
-
const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-
|
|
2
|
+
const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-Cr6W-a2G.js").then((n) => n.i).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
|
|
3
3
|
startOptions,
|
|
4
4
|
authProfileId,
|
|
5
5
|
agentDir,
|
|
@@ -203,12 +203,28 @@ const CODEX_DYNAMIC_TOOL_SERVER_REQUEST_TIMEOUT_MS = 6e5;
|
|
|
203
203
|
const CODEX_APP_SERVER_STDERR_TAIL_MAX = 2e3;
|
|
204
204
|
var CodexAppServerRpcError = class extends Error {
|
|
205
205
|
constructor(error, method) {
|
|
206
|
-
super(error
|
|
206
|
+
super(formatCodexAppServerRpcErrorMessage(error, method));
|
|
207
207
|
this.name = "CodexAppServerRpcError";
|
|
208
208
|
this.code = error.code;
|
|
209
209
|
this.data = error.data;
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
|
+
function formatCodexAppServerRpcErrorMessage(error, method) {
|
|
213
|
+
const message = error.message || `${method} failed`;
|
|
214
|
+
const detail = readCodexAppServerRpcReloginDetail(error.data);
|
|
215
|
+
return detail && !message.includes(detail) ? `${message}: ${detail}` : message;
|
|
216
|
+
}
|
|
217
|
+
function readCodexAppServerRpcReloginDetail(data) {
|
|
218
|
+
const record = isJsonObject(data) ? data : void 0;
|
|
219
|
+
const nested = isJsonObject(record?.error) ? record.error : record;
|
|
220
|
+
if (!nested) return;
|
|
221
|
+
const isRelogin = nested.action === "relogin" || nested.reason === "cloudRequirements" && nested.errorCode === "Auth";
|
|
222
|
+
const detail = typeof nested.detail === "string" ? nested.detail.trim() : "";
|
|
223
|
+
return isRelogin && detail ? detail : void 0;
|
|
224
|
+
}
|
|
225
|
+
function isJsonObject(value) {
|
|
226
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
227
|
+
}
|
|
212
228
|
function isCodexAppServerConnectionClosedError(error) {
|
|
213
229
|
if (!(error instanceof Error)) return false;
|
|
214
230
|
return error.message === "codex app-server client is closed" || error.message.startsWith("codex app-server exited:");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as isCodexFastServiceTier, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
2
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-BmLfrDci.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
|
-
import { n as CODEX_CONTROL_METHODS, r as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
4
|
+
import { n as CODEX_CONTROL_METHODS, r as describeControlFailure, t as requestCodexAppServerJson } from "./request-ohCy5ASa.js";
|
|
5
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-Ttwc_kgX.js";
|
|
6
|
-
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
7
|
-
import { a as parseCodexFastModeArg, c as setCodexConversationFastMode, d as steerCodexConversationTurn, f as stopCodexConversationTurn, i as formatPermissionsMode, l as setCodexConversationModel, m as resolveCodexDefaultWorkspaceDir, o as parseCodexPermissionsModeArg, p as readCodexConversationBindingData, r as startCodexConversationThread, s as readCodexConversationActiveTurn, u as setCodexConversationPermissions } from "./conversation-binding-
|
|
8
|
-
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-
|
|
6
|
+
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
7
|
+
import { a as parseCodexFastModeArg, c as setCodexConversationFastMode, d as steerCodexConversationTurn, f as stopCodexConversationTurn, i as formatPermissionsMode, l as setCodexConversationModel, m as resolveCodexDefaultWorkspaceDir, o as parseCodexPermissionsModeArg, p as readCodexConversationBindingData, r as startCodexConversationThread, s as readCodexConversationActiveTurn, u as setCodexConversationPermissions } from "./conversation-binding-CKofEetY.js";
|
|
8
|
+
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-Ct3ngNBt.js";
|
|
9
9
|
import { n as rememberCodexRateLimits } from "./rate-limit-cache-BFi-50LG.js";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
2
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
3
|
-
import { i as readCodexAppServerBinding } from "./session-binding-
|
|
4
|
-
import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-
|
|
3
|
+
import { i as readCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
4
|
+
import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-DfnbdQv7.js";
|
|
5
5
|
import { embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, 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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as resolveCodexComputerUseConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
|
-
import { r as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
2
|
+
import { r as describeControlFailure, t as requestCodexAppServerJson } from "./request-ohCy5ASa.js";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
5
5
|
var CodexComputerUseSetupError = class extends Error {
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
import { n as CODEX_CONTROL_METHODS } from "./request-
|
|
3
|
+
import { n as CODEX_CONTROL_METHODS } from "./request-ohCy5ASa.js";
|
|
4
4
|
import { r as formatCodexDisplayText } from "./command-formatters-Ttwc_kgX.js";
|
|
5
|
-
import { l as resolveCodexAppServerAuthProfileIdForAgent, r as getSharedCodexAppServerClient } from "./shared-client-
|
|
6
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-
|
|
5
|
+
import { l as resolveCodexAppServerAuthProfileIdForAgent, r as getSharedCodexAppServerClient } from "./shared-client-Cr6W-a2G.js";
|
|
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 { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
package/dist/harness.js
CHANGED
|
@@ -18,25 +18,25 @@ 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-4t06MuNr.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-DV7KYIB8.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-Bl8jRPk4.js");
|
|
30
30
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
|
|
31
31
|
},
|
|
32
32
|
reset: async (params) => {
|
|
33
33
|
if (params.sessionFile) {
|
|
34
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
34
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-CMTXuyoz.js").then((n) => n.a);
|
|
35
35
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
dispose: async () => {
|
|
39
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
39
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Cr6W-a2G.js").then((n) => n.i);
|
|
40
40
|
await clearSharedCodexAppServerClientAndWait();
|
|
41
41
|
}
|
|
42
42
|
};
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
|
2
2
|
import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-0rd3LnKg.js";
|
|
3
3
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
4
4
|
import { buildCodexProvider } from "./provider.js";
|
|
5
|
-
import { r as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
5
|
+
import { r as describeControlFailure, t as requestCodexAppServerJson } from "./request-ohCy5ASa.js";
|
|
6
6
|
import { r as formatCodexDisplayText } from "./command-formatters-Ttwc_kgX.js";
|
|
7
|
-
import { l as resolveCodexAppServerAuthProfileIdForAgent, s as resolveCodexAppServerAuthAccountCacheKey, u as resolveCodexAppServerEnvApiKeyCacheKey } from "./shared-client-
|
|
8
|
-
import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-
|
|
7
|
+
import { l as resolveCodexAppServerAuthProfileIdForAgent, s as resolveCodexAppServerAuthAccountCacheKey, u as resolveCodexAppServerEnvApiKeyCacheKey } from "./shared-client-Cr6W-a2G.js";
|
|
8
|
+
import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-CKofEetY.js";
|
|
9
9
|
import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-PXGqUjwY.js";
|
|
10
|
-
import { t as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
10
|
+
import { t as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-B7eU8fNZ.js";
|
|
11
11
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
12
12
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
13
13
|
import os from "node:os";
|
|
@@ -39,7 +39,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
async function loadDefaultCodexSubcommandHandler() {
|
|
42
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
42
|
+
const { handleCodexSubcommand } = await import("./command-handlers-BYf_veEb.js");
|
|
43
43
|
return handleCodexSubcommand;
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
@@ -165,7 +165,7 @@ function sourceCodexAppServerStartOptions(codexHome) {
|
|
|
165
165
|
return {
|
|
166
166
|
transport: "stdio",
|
|
167
167
|
command: "codex",
|
|
168
|
-
commandSource: "
|
|
168
|
+
commandSource: "managed",
|
|
169
169
|
args: [
|
|
170
170
|
"app-server",
|
|
171
171
|
"--listen",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
2
|
import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
3
3
|
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-CSY0BFBo.js";
|
|
4
|
-
import { i as readModelListResult } from "./models-
|
|
4
|
+
import { i as readModelListResult } from "./models-BmLfrDci.js";
|
|
5
5
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
6
6
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
7
7
|
//#region extensions/codex/media-understanding-provider.ts
|
|
@@ -62,7 +62,7 @@ async function runBoundedCodexVisionTurn(params) {
|
|
|
62
62
|
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
|
|
63
63
|
const timeoutMs = Math.max(100, params.timeoutMs);
|
|
64
64
|
const ownsClient = !params.options.clientFactory;
|
|
65
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-
|
|
65
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-Cr6W-a2G.js").then((n) => n.i).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
66
66
|
startOptions: appServer.start,
|
|
67
67
|
timeoutMs,
|
|
68
68
|
authProfileId: params.profile
|
|
@@ -39,7 +39,7 @@ async function listAllCodexAppServerModels(options = {}) {
|
|
|
39
39
|
async function withCodexAppServerModelClient(options, run) {
|
|
40
40
|
const timeoutMs = options.timeoutMs ?? 2500;
|
|
41
41
|
const useSharedClient = options.sharedClient !== false;
|
|
42
|
-
const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-
|
|
42
|
+
const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-Cr6W-a2G.js").then((n) => n.i);
|
|
43
43
|
const client = useSharedClient ? await getSharedCodexAppServerClient({
|
|
44
44
|
startOptions: options.startOptions,
|
|
45
45
|
timeoutMs,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as resolveCodexAppServerHomeDir } from "./shared-client-
|
|
1
|
+
import { d as resolveCodexAppServerHomeDir } from "./shared-client-Cr6W-a2G.js";
|
|
2
2
|
import { i as buildCodexAppInventoryCacheKey } from "./plugin-activation-PXGqUjwY.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region extensions/codex/src/app-server/plugin-app-cache-key.ts
|
package/dist/provider.js
CHANGED
|
@@ -123,7 +123,7 @@ async function listModelsBestEffort(params) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
async function listCodexAppServerModelsLazy(options) {
|
|
126
|
-
const { listCodexAppServerModels } = await import("./models-
|
|
126
|
+
const { listCodexAppServerModels } = await import("./models-BmLfrDci.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
2
|
-
import { a as withTimeout, n as createIsolatedCodexAppServerClient, r as getSharedCodexAppServerClient } from "./shared-client-
|
|
1
|
+
import { n as CodexAppServerRpcError } from "./client-iRf11BEu.js";
|
|
2
|
+
import { a as withTimeout, n as createIsolatedCodexAppServerClient, r as getSharedCodexAppServerClient } from "./shared-client-Cr6W-a2G.js";
|
|
3
3
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
4
4
|
const CODEX_CONTROL_METHODS = {
|
|
5
5
|
account: "account/read",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { l as resolveCodexPluginsPolicy, o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions, u as withMcpElicitationsApprovalPolicy } from "./config-0rd3LnKg.js";
|
|
2
2
|
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-CSY0BFBo.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
|
-
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-
|
|
5
|
-
import { n as CODEX_CONTROL_METHODS } from "./request-
|
|
4
|
+
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-iRf11BEu.js";
|
|
5
|
+
import { n as CODEX_CONTROL_METHODS } from "./request-ohCy5ASa.js";
|
|
6
6
|
import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimitsForUsageLimitMessage, r as formatCodexDisplayText, u as formatCodexUsageLimitErrorMessage } from "./command-formatters-Ttwc_kgX.js";
|
|
7
|
-
import { c as resolveCodexAppServerAuthProfileId, l as resolveCodexAppServerAuthProfileIdForAgent, o as refreshCodexAppServerAuthTokens, s as resolveCodexAppServerAuthAccountCacheKey, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerEnvApiKeyCacheKey } from "./shared-client-
|
|
8
|
-
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
7
|
+
import { c as resolveCodexAppServerAuthProfileId, l as resolveCodexAppServerAuthProfileIdForAgent, o as refreshCodexAppServerAuthTokens, s as resolveCodexAppServerAuthAccountCacheKey, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerEnvApiKeyCacheKey } from "./shared-client-Cr6W-a2G.js";
|
|
8
|
+
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
9
9
|
import { a as defaultCodexAppInventoryCache } from "./plugin-activation-PXGqUjwY.js";
|
|
10
|
-
import { t as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
11
|
-
import { _ as
|
|
12
|
-
import { n as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
10
|
+
import { t as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-B7eU8fNZ.js";
|
|
11
|
+
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-CJppEyYT.js";
|
|
12
|
+
import { n as defaultCodexAppServerClientFactory } from "./client-factory-DfnbdQv7.js";
|
|
13
13
|
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-DHyuabWn.js";
|
|
14
|
-
import { t as ensureCodexComputerUse } from "./computer-use-
|
|
14
|
+
import { t as ensureCodexComputerUse } from "./computer-use-Ct3ngNBt.js";
|
|
15
15
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-BFi-50LG.js";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
17
17
|
import nodeFs from "node:fs";
|
|
18
|
-
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, 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";
|
|
18
|
+
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";
|
|
19
19
|
import fs from "node:fs/promises";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { markAuthProfileBlockedUntil, resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -636,6 +636,7 @@ var CodexAppServerEventProjector = class {
|
|
|
636
636
|
messagingToolSentTexts: toolTelemetry.messagingToolSentTexts,
|
|
637
637
|
messagingToolSentMediaUrls: toolTelemetry.messagingToolSentMediaUrls,
|
|
638
638
|
messagingToolSentTargets: toolTelemetry.messagingToolSentTargets,
|
|
639
|
+
messagingToolSourceReplyPayloads: toolTelemetry.messagingToolSourceReplyPayloads ?? [],
|
|
639
640
|
heartbeatToolResponse: toolTelemetry.heartbeatToolResponse,
|
|
640
641
|
toolMediaUrls: this.buildToolMediaUrls(toolTelemetry),
|
|
641
642
|
toolAudioAsVoice: toolTelemetry.toolAudioAsVoice,
|
|
@@ -2297,6 +2298,14 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2297
2298
|
config: params.config
|
|
2298
2299
|
});
|
|
2299
2300
|
const startupEnvApiKeyCacheKey = startupAuthProfileId ? void 0 : resolveCodexAppServerEnvApiKeyCacheKey({ startOptions: appServer.start });
|
|
2301
|
+
const bundleMcpThreadConfig = await loadCodexBundleMcpThreadConfig({
|
|
2302
|
+
workspaceDir: effectiveWorkspace,
|
|
2303
|
+
cfg: params.config,
|
|
2304
|
+
toolsEnabled: supportsModelTools(params.model),
|
|
2305
|
+
disableTools: params.disableTools,
|
|
2306
|
+
toolsAllow: params.toolsAllow
|
|
2307
|
+
});
|
|
2308
|
+
for (const diagnostic of bundleMcpThreadConfig.diagnostics) embeddedAgentLog.warn(`bundle-mcp: ${diagnostic.pluginId}: ${diagnostic.message}`);
|
|
2300
2309
|
const activeContextEngine = isActiveHarnessContextEngine(params.contextEngine) ? params.contextEngine : void 0;
|
|
2301
2310
|
let yieldDetected = false;
|
|
2302
2311
|
const toolBridge = createCodexDynamicToolBridge({
|
|
@@ -2459,11 +2468,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2459
2468
|
turnStartTimeoutMs: params.timeoutMs,
|
|
2460
2469
|
signal: runAbortController.signal
|
|
2461
2470
|
});
|
|
2462
|
-
const threadConfig = nativeHookRelay ? buildCodexNativeHookRelayConfig({
|
|
2471
|
+
const threadConfig = mergeCodexThreadConfigs(nativeHookRelay ? buildCodexNativeHookRelayConfig({
|
|
2463
2472
|
relay: nativeHookRelay,
|
|
2464
2473
|
events: nativeHookRelayEvents,
|
|
2465
2474
|
hookTimeoutSec: options.nativeHookRelay?.hookTimeoutSec
|
|
2466
|
-
}) : options.nativeHookRelay?.enabled === false ? buildCodexNativeHookRelayDisabledConfig() : void 0;
|
|
2475
|
+
}) : options.nativeHookRelay?.enabled === false ? buildCodexNativeHookRelayDisabledConfig() : void 0, bundleMcpThreadConfig?.configPatch);
|
|
2467
2476
|
const pluginThreadConfigEnabled = shouldBuildCodexPluginThreadConfig(pluginConfig);
|
|
2468
2477
|
const pluginAppCacheKey = buildCodexPluginAppCacheKey({
|
|
2469
2478
|
appServer,
|
|
@@ -2505,6 +2514,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2505
2514
|
appServer: pluginAppServer,
|
|
2506
2515
|
developerInstructions: promptBuild.developerInstructions,
|
|
2507
2516
|
config: threadConfig,
|
|
2517
|
+
mcpServersFingerprint: bundleMcpThreadConfig.fingerprint,
|
|
2518
|
+
mcpServersFingerprintEvaluated: bundleMcpThreadConfig.evaluated,
|
|
2508
2519
|
pluginThreadConfig: pluginThreadConfigEnabled ? {
|
|
2509
2520
|
enabled: true,
|
|
2510
2521
|
inputFingerprint: pluginThreadConfigInputFingerprint,
|
|
@@ -2614,6 +2625,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2614
2625
|
let turnCompletionLastActivityReason = "startup";
|
|
2615
2626
|
let turnCompletionLastActivityDetails;
|
|
2616
2627
|
let activeAppServerTurnRequests = 0;
|
|
2628
|
+
const activeOpenClawDynamicToolCallIds = /* @__PURE__ */ new Set();
|
|
2617
2629
|
const activeTurnItemIds = /* @__PURE__ */ new Set();
|
|
2618
2630
|
const clearTurnCompletionIdleTimer = () => {
|
|
2619
2631
|
if (turnCompletionIdleTimer) {
|
|
@@ -2864,7 +2876,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2864
2876
|
else if (isCurrentTurnNotification && isCompletedAssistantNotification(notification)) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
|
|
2865
2877
|
else if (unblockedAssistantCompletionRelease) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
|
|
2866
2878
|
else if (isCurrentTurnNotification && shouldDisarmAssistantCompletionIdleWatch(notification)) disarmTurnAssistantCompletionIdleWatch();
|
|
2867
|
-
if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification) disarmTurnCompletionIdleWatch();
|
|
2879
|
+
if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification && !isTrackedOpenClawDynamicToolCompletionNotification(notification, activeOpenClawDynamicToolCallIds)) disarmTurnCompletionIdleWatch();
|
|
2868
2880
|
const isTurnAbortMarker = isCurrentTurnNotification && isCodexTurnAbortMarkerNotification(notification, { currentPromptText: promptBuild.prompt });
|
|
2869
2881
|
const isTurnTerminal = isTurnCompletion || isTurnAbortMarker;
|
|
2870
2882
|
try {
|
|
@@ -2939,6 +2951,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2939
2951
|
const call = readDynamicToolCallParams(request.params);
|
|
2940
2952
|
if (!call || call.threadId !== thread.threadId || call.turnId !== turnId) return;
|
|
2941
2953
|
armCompletionWatchOnResponse = true;
|
|
2954
|
+
activeOpenClawDynamicToolCallIds.add(call.callId);
|
|
2942
2955
|
trajectoryRecorder?.recordEvent("tool.call", {
|
|
2943
2956
|
threadId: call.threadId,
|
|
2944
2957
|
turnId: call.turnId,
|
|
@@ -3413,6 +3426,7 @@ function buildCodexTurnStartFailureResult(params) {
|
|
|
3413
3426
|
messagingToolSentTexts: [],
|
|
3414
3427
|
messagingToolSentMediaUrls: [],
|
|
3415
3428
|
messagingToolSentTargets: [],
|
|
3429
|
+
messagingToolSourceReplyPayloads: [],
|
|
3416
3430
|
cloudCodeAssistFormatError: false,
|
|
3417
3431
|
replayMetadata: {
|
|
3418
3432
|
hadPotentialSideEffects: false,
|
|
@@ -3881,6 +3895,14 @@ function readNotificationItemId(notification) {
|
|
|
3881
3895
|
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
3882
3896
|
return (item ? readString(item, "id") : void 0) ?? readString(notification.params, "itemId") ?? readString(notification.params, "id");
|
|
3883
3897
|
}
|
|
3898
|
+
function isTrackedOpenClawDynamicToolCompletionNotification(notification, activeOpenClawDynamicToolCallIds) {
|
|
3899
|
+
if (notification.method !== "item/completed" || !isJsonObject(notification.params)) return false;
|
|
3900
|
+
const itemId = readNotificationItemId(notification);
|
|
3901
|
+
if (!itemId || !activeOpenClawDynamicToolCallIds.has(itemId)) return false;
|
|
3902
|
+
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
3903
|
+
const itemType = item ? readString(item, "type") : void 0;
|
|
3904
|
+
return itemType === void 0 || itemType === "dynamicToolCall";
|
|
3905
|
+
}
|
|
3884
3906
|
function readRawAssistantTextPreview(item) {
|
|
3885
3907
|
if (readString(item, "role") !== "assistant" || !Array.isArray(item.content)) return;
|
|
3886
3908
|
const text = item.content.flatMap((content) => {
|
|
@@ -51,6 +51,7 @@ async function readCodexAppServerBinding(sessionFile, lookup = {}) {
|
|
|
51
51
|
serviceTier: readServiceTier(parsed.serviceTier),
|
|
52
52
|
dynamicToolsFingerprint: typeof parsed.dynamicToolsFingerprint === "string" ? parsed.dynamicToolsFingerprint : void 0,
|
|
53
53
|
userMcpServersFingerprint: typeof parsed.userMcpServersFingerprint === "string" ? parsed.userMcpServersFingerprint : void 0,
|
|
54
|
+
mcpServersFingerprint: typeof parsed.mcpServersFingerprint === "string" ? parsed.mcpServersFingerprint : void 0,
|
|
54
55
|
pluginAppsFingerprint: typeof parsed.pluginAppsFingerprint === "string" ? parsed.pluginAppsFingerprint : void 0,
|
|
55
56
|
pluginAppsInputFingerprint: typeof parsed.pluginAppsInputFingerprint === "string" ? parsed.pluginAppsInputFingerprint : void 0,
|
|
56
57
|
pluginAppPolicyContext: readPluginAppPolicyContext(parsed.pluginAppPolicyContext),
|
|
@@ -85,6 +86,7 @@ async function writeCodexAppServerBinding(sessionFile, binding, lookup = {}) {
|
|
|
85
86
|
serviceTier: binding.serviceTier,
|
|
86
87
|
dynamicToolsFingerprint: binding.dynamicToolsFingerprint,
|
|
87
88
|
userMcpServersFingerprint: binding.userMcpServersFingerprint,
|
|
89
|
+
mcpServersFingerprint: binding.mcpServersFingerprint,
|
|
88
90
|
pluginAppsFingerprint: binding.pluginAppsFingerprint,
|
|
89
91
|
pluginAppsInputFingerprint: binding.pluginAppsInputFingerprint,
|
|
90
92
|
pluginAppPolicyContext: binding.pluginAppPolicyContext,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
|
|
2
2
|
import { n as codexAppServerStartOptionsKey, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
3
|
-
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-
|
|
3
|
+
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-iRf11BEu.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { constants, readFileSync } from "node:fs";
|
|
@@ -16,9 +16,8 @@ const OPENAI_CODEX_DEFAULT_PROFILE_ID = "openai-codex:default";
|
|
|
16
16
|
const CODEX_HOME_ENV_VAR = "CODEX_HOME";
|
|
17
17
|
const HOME_ENV_VAR = "HOME";
|
|
18
18
|
const CODEX_APP_SERVER_HOME_DIRNAME = "codex-home";
|
|
19
|
-
const CODEX_APP_SERVER_NATIVE_HOME_DIRNAME = "home";
|
|
20
19
|
const CODEX_APP_SERVER_API_KEY_ENV_VARS = ["CODEX_API_KEY", "OPENAI_API_KEY"];
|
|
21
|
-
const
|
|
20
|
+
const CODEX_APP_SERVER_HOME_ENV_VARS = [CODEX_HOME_ENV_VAR, HOME_ENV_VAR];
|
|
22
21
|
async function bridgeCodexAppServerStartOptions(params) {
|
|
23
22
|
if (params.startOptions.transport !== "stdio") return params.startOptions;
|
|
24
23
|
const isolatedStartOptions = await withAgentCodexHomeEnvironment(params.startOptions, params.agentDir);
|
|
@@ -152,25 +151,25 @@ function resolveCodexAppServerHomeDir(agentDir) {
|
|
|
152
151
|
}
|
|
153
152
|
async function withAgentCodexHomeEnvironment(startOptions, agentDir) {
|
|
154
153
|
const codexHome = startOptions.env?.[CODEX_HOME_ENV_VAR]?.trim() ? startOptions.env[CODEX_HOME_ENV_VAR] : resolveCodexAppServerHomeDir(agentDir);
|
|
155
|
-
const nativeHome = startOptions.env?.[HOME_ENV_VAR]?.trim() ? startOptions.env[HOME_ENV_VAR] :
|
|
154
|
+
const nativeHome = startOptions.env?.[HOME_ENV_VAR]?.trim() ? startOptions.env[HOME_ENV_VAR] : void 0;
|
|
156
155
|
await fs.mkdir(codexHome, { recursive: true });
|
|
157
|
-
await fs.mkdir(nativeHome, { recursive: true });
|
|
156
|
+
if (nativeHome) await fs.mkdir(nativeHome, { recursive: true });
|
|
158
157
|
const nextStartOptions = {
|
|
159
158
|
...startOptions,
|
|
160
159
|
env: {
|
|
161
160
|
...startOptions.env,
|
|
162
161
|
[CODEX_HOME_ENV_VAR]: codexHome,
|
|
163
|
-
[HOME_ENV_VAR]: nativeHome
|
|
162
|
+
...nativeHome ? { [HOME_ENV_VAR]: nativeHome } : {}
|
|
164
163
|
}
|
|
165
164
|
};
|
|
166
|
-
const clearEnv =
|
|
165
|
+
const clearEnv = withoutClearedCodexHomeEnv(startOptions.clearEnv);
|
|
167
166
|
if (clearEnv) nextStartOptions.clearEnv = clearEnv;
|
|
168
167
|
else delete nextStartOptions.clearEnv;
|
|
169
168
|
return nextStartOptions;
|
|
170
169
|
}
|
|
171
|
-
function
|
|
170
|
+
function withoutClearedCodexHomeEnv(clearEnv) {
|
|
172
171
|
if (!clearEnv) return;
|
|
173
|
-
const reserved = new Set(
|
|
172
|
+
const reserved = new Set(CODEX_APP_SERVER_HOME_ENV_VARS);
|
|
174
173
|
const filtered = clearEnv.filter((envVar) => !reserved.has(envVar.trim().toUpperCase()));
|
|
175
174
|
return filtered.length === clearEnv.length ? clearEnv : filtered;
|
|
176
175
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
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
|
-
import { r as isCodexAppServerApprovalRequest } from "./client-
|
|
4
|
+
import { r as isCodexAppServerApprovalRequest } from "./client-iRf11BEu.js";
|
|
5
5
|
import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-Ttwc_kgX.js";
|
|
6
|
-
import { o as refreshCodexAppServerAuthTokens, r as getSharedCodexAppServerClient } from "./shared-client-
|
|
7
|
-
import { i as readCodexAppServerBinding } from "./session-binding-
|
|
8
|
-
import {
|
|
6
|
+
import { o as refreshCodexAppServerAuthTokens, r as getSharedCodexAppServerClient } from "./shared-client-Cr6W-a2G.js";
|
|
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-CJppEyYT.js";
|
|
9
9
|
import { n as handleCodexAppServerElicitationRequest, r as handleCodexAppServerApprovalRequest, t as filterToolsForVisionInputs } from "./vision-tools-DHyuabWn.js";
|
|
10
10
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-BFi-50LG.js";
|
|
11
11
|
import { embeddedAgentLog, formatErrorMessage, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
package/dist/test-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as resolveCodexAppServerRuntimeOptions } from "./config-0rd3LnKg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as buildThreadStartParams, i as buildThreadResumeParams, o as buildTurnStartParams, r as buildDeveloperInstructions, v as createCodexDynamicToolBridge, y as filterCodexDynamicTools } from "./thread-lifecycle-CJppEyYT.js";
|
|
3
3
|
//#region extensions/codex/test-api.ts
|
|
4
4
|
function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
|
|
5
5
|
return resolveCodexAppServerRuntimeOptions({
|
|
@@ -3,8 +3,8 @@ import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartRespon
|
|
|
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-
|
|
7
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
6
|
+
import { i as isCodexAppServerConnectionClosedError } from "./client-iRf11BEu.js";
|
|
7
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CMTXuyoz.js";
|
|
8
8
|
import { a as defaultCodexAppInventoryCache, r as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-PXGqUjwY.js";
|
|
9
9
|
import crypto from "node:crypto";
|
|
10
10
|
import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractToolResultMediaArtifact, filterToolResultMediaUrls, isActiveHarnessContextEngine, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -49,6 +49,7 @@ function createCodexDynamicToolBridge(params) {
|
|
|
49
49
|
messagingToolSentTexts: [],
|
|
50
50
|
messagingToolSentMediaUrls: [],
|
|
51
51
|
messagingToolSentTargets: [],
|
|
52
|
+
messagingToolSourceReplyPayloads: [],
|
|
52
53
|
toolMediaUrls: [],
|
|
53
54
|
toolAudioAsVoice: false
|
|
54
55
|
};
|
|
@@ -201,6 +202,11 @@ function collectToolTelemetry(params) {
|
|
|
201
202
|
}
|
|
202
203
|
if (!isMessagingTool(params.toolName) || !isMessagingToolSendAction(params.toolName, params.args)) return;
|
|
203
204
|
params.telemetry.didSendViaMessagingTool = true;
|
|
205
|
+
const sourceReplyPayload = extractInternalSourceReplyPayload(params.result?.details);
|
|
206
|
+
if (sourceReplyPayload) {
|
|
207
|
+
params.telemetry.messagingToolSourceReplyPayloads.push(sourceReplyPayload);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
204
210
|
const text = readFirstString(params.args, [
|
|
205
211
|
"text",
|
|
206
212
|
"message",
|
|
@@ -228,6 +234,25 @@ function collectToolTelemetry(params) {
|
|
|
228
234
|
...mediaUrls.length > 0 ? { mediaUrls } : {}
|
|
229
235
|
});
|
|
230
236
|
}
|
|
237
|
+
function extractInternalSourceReplyPayload(details) {
|
|
238
|
+
if (!isRecord(details) || details.sourceReplySink !== "internal-ui") return;
|
|
239
|
+
const rawPayload = details.sourceReply;
|
|
240
|
+
if (!isRecord(rawPayload)) return;
|
|
241
|
+
const text = readFirstString(rawPayload, ["text", "message"]);
|
|
242
|
+
const mediaUrls = collectMediaUrls(rawPayload);
|
|
243
|
+
const mediaUrl = typeof rawPayload.mediaUrl === "string" && rawPayload.mediaUrl.trim() ? rawPayload.mediaUrl.trim() : mediaUrls[0];
|
|
244
|
+
const payload = {
|
|
245
|
+
...text ? { text } : {},
|
|
246
|
+
...mediaUrl ? { mediaUrl } : {},
|
|
247
|
+
...mediaUrls.length > 0 ? { mediaUrls } : {},
|
|
248
|
+
...rawPayload.audioAsVoice === true ? { audioAsVoice: true } : {},
|
|
249
|
+
...isRecord(rawPayload.presentation) ? { presentation: rawPayload.presentation } : {},
|
|
250
|
+
...isRecord(rawPayload.interactive) ? { interactive: rawPayload.interactive } : {},
|
|
251
|
+
...isRecord(rawPayload.channelData) ? { channelData: rawPayload.channelData } : {},
|
|
252
|
+
...typeof details.idempotencyKey === "string" && details.idempotencyKey.trim() ? { idempotencyKey: details.idempotencyKey.trim() } : {}
|
|
253
|
+
};
|
|
254
|
+
return text || mediaUrls.length > 0 || payload.presentation || payload.interactive ? payload : void 0;
|
|
255
|
+
}
|
|
231
256
|
function isRecord(value) {
|
|
232
257
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
233
258
|
}
|
|
@@ -685,6 +710,11 @@ async function startOrResumeThread(params) {
|
|
|
685
710
|
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
686
711
|
binding = void 0;
|
|
687
712
|
}
|
|
713
|
+
if (binding?.threadId && params.mcpServersFingerprintEvaluated === true && binding.mcpServersFingerprint !== params.mcpServersFingerprint) {
|
|
714
|
+
embeddedAgentLog.debug("codex app-server MCP config changed; starting a new thread", { threadId: binding.threadId });
|
|
715
|
+
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
716
|
+
binding = void 0;
|
|
717
|
+
}
|
|
688
718
|
if (binding?.threadId) {
|
|
689
719
|
let pluginBindingStale = isCodexPluginThreadBindingStale({
|
|
690
720
|
codexPluginsEnabled: params.pluginThreadConfig?.enabled ?? false,
|
|
@@ -711,6 +741,11 @@ async function startOrResumeThread(params) {
|
|
|
711
741
|
binding = void 0;
|
|
712
742
|
}
|
|
713
743
|
}
|
|
744
|
+
if (binding?.threadId && params.mcpServersFingerprintEvaluated === true && binding.mcpServersFingerprint !== params.mcpServersFingerprint) {
|
|
745
|
+
embeddedAgentLog.debug("codex app-server MCP config changed; starting a new thread", { threadId: binding.threadId });
|
|
746
|
+
await clearCodexAppServerBinding(params.params.sessionFile);
|
|
747
|
+
binding = void 0;
|
|
748
|
+
}
|
|
714
749
|
if (binding?.threadId) if (binding.dynamicToolsFingerprint && !areDynamicToolFingerprintsCompatible(binding.dynamicToolsFingerprint, dynamicToolsFingerprint)) {
|
|
715
750
|
preserveExistingBinding = shouldStartTransientNoToolThread({
|
|
716
751
|
previous: binding.dynamicToolsFingerprint,
|
|
@@ -723,12 +758,13 @@ async function startOrResumeThread(params) {
|
|
|
723
758
|
}
|
|
724
759
|
} else try {
|
|
725
760
|
const authProfileId = params.params.authProfileId ?? binding.authProfileId;
|
|
761
|
+
const resumeConfig = mergeCodexThreadConfigs(params.config, userMcpServersConfigPatch);
|
|
726
762
|
const response = assertCodexThreadResumeResponse(await params.client.request("thread/resume", buildThreadResumeParams(params.params, {
|
|
727
763
|
threadId: binding.threadId,
|
|
728
764
|
authProfileId,
|
|
729
765
|
appServer: params.appServer,
|
|
730
766
|
developerInstructions: params.developerInstructions,
|
|
731
|
-
config:
|
|
767
|
+
config: resumeConfig
|
|
732
768
|
})));
|
|
733
769
|
const boundAuthProfileId = authProfileId;
|
|
734
770
|
const fallbackModelProvider = resolveCodexAppServerModelProvider({
|
|
@@ -738,6 +774,7 @@ async function startOrResumeThread(params) {
|
|
|
738
774
|
agentDir: params.params.agentDir,
|
|
739
775
|
config: params.params.config
|
|
740
776
|
});
|
|
777
|
+
const nextMcpServersFingerprint = params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : binding.mcpServersFingerprint;
|
|
741
778
|
await writeCodexAppServerBinding(params.params.sessionFile, {
|
|
742
779
|
threadId: response.thread.id,
|
|
743
780
|
cwd: params.cwd,
|
|
@@ -746,6 +783,7 @@ async function startOrResumeThread(params) {
|
|
|
746
783
|
modelProvider: response.modelProvider ?? fallbackModelProvider,
|
|
747
784
|
dynamicToolsFingerprint,
|
|
748
785
|
userMcpServersFingerprint,
|
|
786
|
+
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
749
787
|
pluginAppsFingerprint: binding.pluginAppsFingerprint,
|
|
750
788
|
pluginAppsInputFingerprint: binding.pluginAppsInputFingerprint,
|
|
751
789
|
pluginAppPolicyContext: binding.pluginAppPolicyContext,
|
|
@@ -765,6 +803,7 @@ async function startOrResumeThread(params) {
|
|
|
765
803
|
modelProvider: response.modelProvider ?? fallbackModelProvider,
|
|
766
804
|
dynamicToolsFingerprint,
|
|
767
805
|
userMcpServersFingerprint,
|
|
806
|
+
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
768
807
|
pluginAppsFingerprint: binding.pluginAppsFingerprint,
|
|
769
808
|
pluginAppsInputFingerprint: binding.pluginAppsInputFingerprint,
|
|
770
809
|
pluginAppPolicyContext: binding.pluginAppPolicyContext,
|
|
@@ -793,6 +832,7 @@ async function startOrResumeThread(params) {
|
|
|
793
832
|
config: params.params.config
|
|
794
833
|
});
|
|
795
834
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
835
|
+
const nextMcpServersFingerprint = params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : void 0;
|
|
796
836
|
if (!preserveExistingBinding) await writeCodexAppServerBinding(params.params.sessionFile, {
|
|
797
837
|
threadId: response.thread.id,
|
|
798
838
|
cwd: params.cwd,
|
|
@@ -801,6 +841,7 @@ async function startOrResumeThread(params) {
|
|
|
801
841
|
modelProvider: response.modelProvider ?? modelProvider,
|
|
802
842
|
dynamicToolsFingerprint,
|
|
803
843
|
userMcpServersFingerprint,
|
|
844
|
+
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
804
845
|
pluginAppsFingerprint: pluginThreadConfig?.fingerprint,
|
|
805
846
|
pluginAppsInputFingerprint: pluginThreadConfig?.inputFingerprint,
|
|
806
847
|
pluginAppPolicyContext: pluginThreadConfig?.policyContext,
|
|
@@ -821,6 +862,7 @@ async function startOrResumeThread(params) {
|
|
|
821
862
|
modelProvider: response.modelProvider ?? modelProvider,
|
|
822
863
|
dynamicToolsFingerprint,
|
|
823
864
|
userMcpServersFingerprint,
|
|
865
|
+
mcpServersFingerprint: nextMcpServersFingerprint,
|
|
824
866
|
pluginAppsFingerprint: pluginThreadConfig?.fingerprint,
|
|
825
867
|
pluginAppsInputFingerprint: pluginThreadConfig?.inputFingerprint,
|
|
826
868
|
pluginAppPolicyContext: pluginThreadConfig?.policyContext,
|
|
@@ -1050,4 +1092,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
|
|
|
1050
1092
|
return null;
|
|
1051
1093
|
}
|
|
1052
1094
|
//#endregion
|
|
1053
|
-
export {
|
|
1095
|
+
export { resolveCodexContextEngineProjectionReserveTokens as _, buildThreadStartParams as a, normalizeCodexDynamicToolName as b, resolveCodexAppServerModelProvider as c, buildCodexPluginThreadConfig as d, buildCodexPluginThreadConfigInputFingerprint as f, resolveCodexContextEngineProjectionMaxChars as g, projectContextEngineAssemblyForCodex as h, buildThreadResumeParams as i, resolveReasoningEffort as l, shouldBuildCodexPluginThreadConfig as m, buildCodexRuntimeThreadConfig as n, buildTurnStartParams as o, mergeCodexThreadConfigs as p, buildDeveloperInstructions as r, codexDynamicToolsFingerprint as s, areCodexDynamicToolFingerprintsCompatible as t, startOrResumeThread as u, createCodexDynamicToolBridge as v, filterCodexDynamicTools as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.12-beta.
|
|
3
|
+
"version": "2026.5.12-beta.7",
|
|
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.12-beta.
|
|
30
|
+
"pluginApi": ">=2026.5.12-beta.7"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.12-beta.
|
|
33
|
+
"openclawVersion": "2026.5.12-beta.7"
|
|
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.12-beta.
|
|
48
|
+
"openclaw": ">=2026.5.12-beta.7"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|