@openclaw/codex 2026.5.9-beta.1 → 2026.5.10-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-DYkCXAze.js → client-CTzy3Y6M.js} +2 -2
- package/dist/{client-factory-D3-EhEwN.js → client-factory-BJL_efz4.js} +1 -1
- package/dist/{command-handlers-De-V2-4K.js → command-handlers-BLZCm3fD.js} +6 -6
- package/dist/{compact-BaeaEEoQ.js → compact-4FVe6NwI.js} +3 -3
- package/dist/{config-BZiM7rhH.js → config-CT01BBDc.js} +0 -2
- package/dist/{conversation-binding-BjanzgDh.js → conversation-binding-FqeYliIk.js} +4 -4
- package/dist/doctor-contract-api.js +35 -1
- package/dist/harness.js +4 -4
- package/dist/index.js +5 -5
- package/dist/media-understanding-provider.js +4 -4
- package/dist/{models-nfvRggjT.js → models-H-PTi3W0.js} +2 -2
- package/dist/{plugin-activation-D0uXssSN.js → plugin-activation-CweAZa7r.js} +1 -1
- package/dist/{protocol-validators-CbqWfY5M.js → protocol-validators-CeCyJaWj.js} +24 -2
- package/dist/provider.js +2 -2
- package/dist/{rate-limit-cache-BZWGqXPP.js → rate-limit-cache-DbZvmrAD.js} +2 -2
- package/dist/{request-CaW8DCAa.js → request-DC1Dz3iZ.js} +2 -2
- package/dist/{run-attempt-DCCThMaw.js → run-attempt-CefRS5_d.js} +165 -15
- package/dist/{session-binding-C_HDlZx8.js → session-binding-B44KIZM2.js} +1 -1
- package/dist/{shared-client-pLCOzMaZ.js → shared-client-p-TvEiNL.js} +2 -2
- package/dist/test-api.js +3 -3
- package/dist/{thread-lifecycle-unEEsXe-.js → thread-lifecycle-CGc-O_5d.js} +9 -9
- package/openclaw.plugin.json +0 -10
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
1
|
+
import { s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
2
2
|
import { n as isRpcResponse } from "./protocol-C9UWI98H.js";
|
|
3
3
|
import { createInterface } from "node:readline";
|
|
4
4
|
import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -199,7 +199,7 @@ const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
|
|
|
199
199
|
const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
|
|
200
200
|
const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 1e6;
|
|
201
201
|
const CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES = 1e3;
|
|
202
|
-
const CODEX_DYNAMIC_TOOL_SERVER_REQUEST_TIMEOUT_MS =
|
|
202
|
+
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) {
|
|
@@ -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-p-TvEiNL.js").then((n) => n.r).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
|
|
3
3
|
startOptions,
|
|
4
4
|
authProfileId,
|
|
5
5
|
agentDir,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as isCodexFastServiceTier, s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
1
|
+
import { i as isCodexFastServiceTier, s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
2
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-H-PTi3W0.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
|
-
import { a as formatCodexStatus, c as formatModels, f as CODEX_CONTROL_METHODS, i as formatCodexDisplayText, l as formatThreads, n as buildHelp, o as formatComputerUseStatus, p as describeControlFailure, r as formatAccount, s as formatList, t as requestCodexAppServerJson, u as readString } from "./request-
|
|
5
|
-
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
6
|
-
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-
|
|
7
|
-
import { a as readCodexComputerUseStatus, i as installCodexComputerUse, n as rememberCodexRateLimits } from "./rate-limit-cache-
|
|
4
|
+
import { a as formatCodexStatus, c as formatModels, f as CODEX_CONTROL_METHODS, i as formatCodexDisplayText, l as formatThreads, n as buildHelp, o as formatComputerUseStatus, p as describeControlFailure, r as formatAccount, s as formatList, t as requestCodexAppServerJson, u as readString } from "./request-DC1Dz3iZ.js";
|
|
5
|
+
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-B44KIZM2.js";
|
|
6
|
+
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-FqeYliIk.js";
|
|
7
|
+
import { a as readCodexComputerUseStatus, i as installCodexComputerUse, n as rememberCodexRateLimits } from "./rate-limit-cache-DbZvmrAD.js";
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
9
|
//#region extensions/codex/src/command-rpc.ts
|
|
10
10
|
function requestOptions(pluginConfig, limit, config) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
1
|
+
import { s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.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-B44KIZM2.js";
|
|
4
|
+
import { n as defaultCodexAppServerClientFactory, t as createCodexAppServerClientFactoryTestHooks } from "./client-factory-BJL_efz4.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;
|
|
@@ -28,7 +28,6 @@ const codexAppServerApprovalsReviewerSchema = z.enum([
|
|
|
28
28
|
"auto_review",
|
|
29
29
|
"guardian_subagent"
|
|
30
30
|
]);
|
|
31
|
-
const codexDynamicToolsProfileSchema = z.enum(["native-first", "openclaw-compat"]);
|
|
32
31
|
const codexDynamicToolsLoadingSchema = z.enum(["searchable", "direct"]);
|
|
33
32
|
const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ? null : normalizeCodexServiceTier(value), z.string().trim().min(1).nullable().optional()).optional();
|
|
34
33
|
const codexPluginEntryConfigSchema = z.object({
|
|
@@ -43,7 +42,6 @@ const codexPluginsConfigSchema = z.object({
|
|
|
43
42
|
plugins: z.record(z.string(), codexPluginEntryConfigSchema).optional()
|
|
44
43
|
}).strict();
|
|
45
44
|
const codexPluginConfigSchema = z.object({
|
|
46
|
-
codexDynamicToolsProfile: codexDynamicToolsProfileSchema.optional(),
|
|
47
45
|
codexDynamicToolsLoading: codexDynamicToolsLoadingSchema.optional(),
|
|
48
46
|
codexDynamicToolsExclude: z.array(z.string()).optional(),
|
|
49
47
|
discovery: z.object({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as isCodexFastServiceTier, r as codexSandboxPolicyForTurn, s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
1
|
+
import { i as isCodexFastServiceTier, r as codexSandboxPolicyForTurn, s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
2
2
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
3
|
-
import { f as CODEX_CONTROL_METHODS, i as formatCodexDisplayText } from "./request-
|
|
4
|
-
import { c as resolveCodexAppServerAuthProfileIdForAgent, n as getSharedCodexAppServerClient } from "./shared-client-
|
|
5
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-
|
|
3
|
+
import { f as CODEX_CONTROL_METHODS, i as formatCodexDisplayText } from "./request-DC1Dz3iZ.js";
|
|
4
|
+
import { c as resolveCodexAppServerAuthProfileIdForAgent, n as getSharedCodexAppServerClient } from "./shared-client-p-TvEiNL.js";
|
|
5
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-B44KIZM2.js";
|
|
6
6
|
import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
//#region extensions/codex/doctor-contract-api.ts
|
|
2
|
+
function asRecord(value) {
|
|
3
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4
|
+
}
|
|
5
|
+
function hasRetiredDynamicToolsProfile(value) {
|
|
6
|
+
return Object.prototype.hasOwnProperty.call(asRecord(value) ?? {}, "codexDynamicToolsProfile");
|
|
7
|
+
}
|
|
8
|
+
const legacyConfigRules = [{
|
|
9
|
+
path: [
|
|
10
|
+
"plugins",
|
|
11
|
+
"entries",
|
|
12
|
+
"codex",
|
|
13
|
+
"config"
|
|
14
|
+
],
|
|
15
|
+
message: "plugins.entries.codex.config.codexDynamicToolsProfile is retired; Codex app-server always keeps Codex-native workspace tools native. Run \"openclaw doctor --fix\".",
|
|
16
|
+
match: hasRetiredDynamicToolsProfile
|
|
17
|
+
}];
|
|
18
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
19
|
+
const rawPluginConfig = asRecord(asRecord(cfg.plugins?.entries?.codex)?.config);
|
|
20
|
+
if (!rawPluginConfig || !hasRetiredDynamicToolsProfile(rawPluginConfig)) return {
|
|
21
|
+
config: cfg,
|
|
22
|
+
changes: []
|
|
23
|
+
};
|
|
24
|
+
const nextConfig = structuredClone(cfg);
|
|
25
|
+
const nextPluginConfig = asRecord(asRecord(asRecord(asRecord(nextConfig.plugins)?.entries)?.codex)?.config);
|
|
26
|
+
if (!nextPluginConfig) return {
|
|
27
|
+
config: cfg,
|
|
28
|
+
changes: []
|
|
29
|
+
};
|
|
30
|
+
delete nextPluginConfig.codexDynamicToolsProfile;
|
|
31
|
+
return {
|
|
32
|
+
config: nextConfig,
|
|
33
|
+
changes: ["Removed retired plugins.entries.codex.config.codexDynamicToolsProfile; Codex app-server always keeps Codex-native workspace tools native."]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
2
36
|
const sessionRouteStateOwners = [{
|
|
3
37
|
id: "codex",
|
|
4
38
|
label: "Codex",
|
|
@@ -16,4 +50,4 @@ const sessionRouteStateOwners = [{
|
|
|
16
50
|
]
|
|
17
51
|
}];
|
|
18
52
|
//#endregion
|
|
19
|
-
export { sessionRouteStateOwners };
|
|
53
|
+
export { legacyConfigRules, normalizeCompatibilityConfig, sessionRouteStateOwners };
|
package/dist/harness.js
CHANGED
|
@@ -18,21 +18,21 @@ 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-CefRS5_d.js");
|
|
22
22
|
return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
|
|
23
23
|
},
|
|
24
24
|
compact: async (params) => {
|
|
25
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
25
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-4FVe6NwI.js");
|
|
26
26
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
|
|
27
27
|
},
|
|
28
28
|
reset: async (params) => {
|
|
29
29
|
if (params.sessionFile) {
|
|
30
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
30
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-B44KIZM2.js").then((n) => n.a);
|
|
31
31
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
dispose: async () => {
|
|
35
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
35
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-p-TvEiNL.js").then((n) => n.r);
|
|
36
36
|
await clearSharedCodexAppServerClientAndWait();
|
|
37
37
|
}
|
|
38
38
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
|
-
import { t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-
|
|
2
|
+
import { t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-CT01BBDc.js";
|
|
3
3
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
4
4
|
import { buildCodexProvider } from "./provider.js";
|
|
5
|
-
import { i as formatCodexDisplayText, p as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
6
|
-
import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-
|
|
7
|
-
import { i as defaultCodexAppInventoryCache, t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
5
|
+
import { i as formatCodexDisplayText, p as describeControlFailure, t as requestCodexAppServerJson } from "./request-DC1Dz3iZ.js";
|
|
6
|
+
import { n as handleCodexConversationInboundClaim, t as handleCodexConversationBindingResolved } from "./conversation-binding-FqeYliIk.js";
|
|
7
|
+
import { i as defaultCodexAppInventoryCache, t as ensureCodexPluginActivation } from "./plugin-activation-CweAZa7r.js";
|
|
8
8
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
9
9
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
10
10
|
import os from "node:os";
|
|
@@ -28,7 +28,7 @@ function createCodexCommand(options) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async function handleCodexCommand(ctx, options = {}) {
|
|
31
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
31
|
+
const { handleCodexSubcommand } = await import("./command-handlers-BLZCm3fD.js");
|
|
32
32
|
try {
|
|
33
33
|
return await handleCodexSubcommand(ctx, options);
|
|
34
34
|
} catch (error) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
|
-
import { s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
3
|
-
import { a as readCodexErrorNotification, c as readCodexTurnCompletedNotification, n as assertCodexThreadStartResponse, r as assertCodexTurnStartResponse } from "./protocol-validators-
|
|
4
|
-
import { i as readModelListResult } from "./models-
|
|
2
|
+
import { s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
3
|
+
import { a as readCodexErrorNotification, c as readCodexTurnCompletedNotification, n as assertCodexThreadStartResponse, r as assertCodexTurnStartResponse } from "./protocol-validators-CeCyJaWj.js";
|
|
4
|
+
import { i as readModelListResult } from "./models-H-PTi3W0.js";
|
|
5
5
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
6
6
|
//#region extensions/codex/media-understanding-provider.ts
|
|
7
7
|
const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
|
|
@@ -37,7 +37,7 @@ async function describeCodexImages(req, options) {
|
|
|
37
37
|
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
|
|
38
38
|
const timeoutMs = Math.max(100, req.timeoutMs);
|
|
39
39
|
const ownsClient = !options.clientFactory;
|
|
40
|
-
const client = options.clientFactory ? await options.clientFactory(appServer.start, req.profile) : await import("./shared-client-
|
|
40
|
+
const client = options.clientFactory ? await options.clientFactory(appServer.start, req.profile) : await import("./shared-client-p-TvEiNL.js").then((n) => n.r).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
41
41
|
startOptions: appServer.start,
|
|
42
42
|
timeoutMs,
|
|
43
43
|
authProfileId: req.profile
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
|
|
2
|
-
import { o as readCodexModelListResponse } from "./protocol-validators-
|
|
2
|
+
import { o as readCodexModelListResponse } from "./protocol-validators-CeCyJaWj.js";
|
|
3
3
|
//#region extensions/codex/src/app-server/models.ts
|
|
4
4
|
var models_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
listAllCodexAppServerModels: () => listAllCodexAppServerModels,
|
|
@@ -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-p-TvEiNL.js").then((n) => n.r);
|
|
43
43
|
const client = useSharedClient ? await getSharedCodexAppServerClient({
|
|
44
44
|
startOptions: options.startOptions,
|
|
45
45
|
timeoutMs,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-
|
|
1
|
+
import { l as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-CT01BBDc.js";
|
|
2
2
|
import "node:fs/promises";
|
|
3
3
|
import "node:path";
|
|
4
4
|
var CodexAppInventoryCache = class {
|
|
@@ -5898,10 +5898,10 @@ const validateThreadStartResponse = ajv.compile(ThreadStartResponse_default);
|
|
|
5898
5898
|
const validateTurnCompletedNotification = ajv.compile(TurnCompletedNotification_default);
|
|
5899
5899
|
const validateTurnStartResponse = ajv.compile(TurnStartResponse_default);
|
|
5900
5900
|
function assertCodexThreadStartResponse(value) {
|
|
5901
|
-
return assertCodexShape(validateThreadStartResponse, value, "thread/start response");
|
|
5901
|
+
return assertCodexShape(validateThreadStartResponse, normalizeThreadResponse(value), "thread/start response");
|
|
5902
5902
|
}
|
|
5903
5903
|
function assertCodexThreadResumeResponse(value) {
|
|
5904
|
-
return assertCodexShape(validateThreadResumeResponse, value, "thread/resume response");
|
|
5904
|
+
return assertCodexShape(validateThreadResumeResponse, normalizeThreadResponse(value), "thread/resume response");
|
|
5905
5905
|
}
|
|
5906
5906
|
function assertCodexTurnStartResponse(value) {
|
|
5907
5907
|
return assertCodexShape(validateTurnStartResponse, normalizeTurnStartResponse(value), "turn/start response");
|
|
@@ -5968,6 +5968,28 @@ function normalizeThreadItem(value) {
|
|
|
5968
5968
|
default: return value;
|
|
5969
5969
|
}
|
|
5970
5970
|
}
|
|
5971
|
+
function normalizeThreadResponse(value) {
|
|
5972
|
+
if (!value || typeof value !== "object" || Array.isArray(value) || !("thread" in value)) return value;
|
|
5973
|
+
const thread = value.thread;
|
|
5974
|
+
if (thread && typeof thread === "object" && !Array.isArray(thread)) {
|
|
5975
|
+
const t = thread;
|
|
5976
|
+
if (typeof t.id === "string" && typeof t.sessionId !== "string") return {
|
|
5977
|
+
...value,
|
|
5978
|
+
thread: {
|
|
5979
|
+
...thread,
|
|
5980
|
+
sessionId: t.id
|
|
5981
|
+
}
|
|
5982
|
+
};
|
|
5983
|
+
if (typeof t.sessionId === "string" && typeof t.id !== "string") return {
|
|
5984
|
+
...value,
|
|
5985
|
+
thread: {
|
|
5986
|
+
...thread,
|
|
5987
|
+
id: t.sessionId
|
|
5988
|
+
}
|
|
5989
|
+
};
|
|
5990
|
+
}
|
|
5991
|
+
return value;
|
|
5992
|
+
}
|
|
5971
5993
|
function normalizeTurnStartResponse(value) {
|
|
5972
5994
|
if (!value || typeof value !== "object" || Array.isArray(value) || !("turn" in value)) return value;
|
|
5973
5995
|
return {
|
package/dist/provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig } from "./provider-catalog.js";
|
|
2
|
-
import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
+
import { o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
3
3
|
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
|
|
4
4
|
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
5
5
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/core";
|
|
@@ -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-H-PTi3W0.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolveCodexComputerUseConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { p as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
1
|
+
import { c as resolveCodexComputerUseConfig, s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
2
|
+
import { p as describeControlFailure, t as requestCodexAppServerJson } from "./request-DC1Dz3iZ.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,6 +1,6 @@
|
|
|
1
1
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
2
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
3
|
-
import { i as withTimeout, n as getSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
+
import { n as CodexAppServerRpcError } from "./client-CTzy3Y6M.js";
|
|
3
|
+
import { i as withTimeout, n as getSharedCodexAppServerClient } from "./shared-client-p-TvEiNL.js";
|
|
4
4
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
5
5
|
const CODEX_CONTROL_METHODS = {
|
|
6
6
|
account: "account/read",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { l as resolveCodexPluginsPolicy, o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions, u as withMcpElicitationsApprovalPolicy } from "./config-
|
|
2
|
-
import { i as readCodexDynamicToolCallParams, r as assertCodexTurnStartResponse, s as readCodexTurn } from "./protocol-validators-
|
|
1
|
+
import { l as resolveCodexPluginsPolicy, o as readCodexPluginConfig, s as resolveCodexAppServerRuntimeOptions, u as withMcpElicitationsApprovalPolicy } from "./config-CT01BBDc.js";
|
|
2
|
+
import { i as readCodexDynamicToolCallParams, r as assertCodexTurnStartResponse, s as readCodexTurn } from "./protocol-validators-CeCyJaWj.js";
|
|
3
3
|
import { t as isJsonObject } from "./protocol-C9UWI98H.js";
|
|
4
|
-
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-
|
|
5
|
-
import { d as formatCodexUsageLimitErrorMessage, i as formatCodexDisplayText } from "./request-
|
|
6
|
-
import { a as refreshCodexAppServerAuthTokens, c as resolveCodexAppServerAuthProfileIdForAgent, l as resolveCodexAppServerEnvApiKeyCacheKey, o as resolveCodexAppServerAuthAccountCacheKey, s as resolveCodexAppServerAuthProfileId, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerHomeDir } from "./shared-client-
|
|
7
|
-
import { i as readCodexAppServerBinding } from "./session-binding-
|
|
8
|
-
import { i as defaultCodexAppInventoryCache, r as buildCodexAppInventoryCacheKey } from "./plugin-activation-
|
|
9
|
-
import { a as buildTurnStartParams, c as buildCodexPluginThreadConfig, d as createCodexDynamicToolBridge, f as
|
|
10
|
-
import { n as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
11
|
-
import { n as rememberCodexRateLimits, r as ensureCodexComputerUse, t as readRecentCodexRateLimits } from "./rate-limit-cache-
|
|
4
|
+
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-CTzy3Y6M.js";
|
|
5
|
+
import { d as formatCodexUsageLimitErrorMessage, i as formatCodexDisplayText } from "./request-DC1Dz3iZ.js";
|
|
6
|
+
import { a as refreshCodexAppServerAuthTokens, c as resolveCodexAppServerAuthProfileIdForAgent, l as resolveCodexAppServerEnvApiKeyCacheKey, o as resolveCodexAppServerAuthAccountCacheKey, s as resolveCodexAppServerAuthProfileId, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerHomeDir } from "./shared-client-p-TvEiNL.js";
|
|
7
|
+
import { i as readCodexAppServerBinding } from "./session-binding-B44KIZM2.js";
|
|
8
|
+
import { i as defaultCodexAppInventoryCache, r as buildCodexAppInventoryCacheKey } from "./plugin-activation-CweAZa7r.js";
|
|
9
|
+
import { a as buildTurnStartParams, c as buildCodexPluginThreadConfig, d as createCodexDynamicToolBridge, f as filterCodexDynamicTools, l as buildCodexPluginThreadConfigInputFingerprint, n as buildDeveloperInstructions, o as codexDynamicToolsFingerprint, p as normalizeCodexDynamicToolName, s as startOrResumeThread, t as areCodexDynamicToolFingerprintsCompatible, u as shouldBuildCodexPluginThreadConfig } from "./thread-lifecycle-CGc-O_5d.js";
|
|
10
|
+
import { n as defaultCodexAppServerClientFactory } from "./client-factory-BJL_efz4.js";
|
|
11
|
+
import { n as rememberCodexRateLimits, r as ensureCodexComputerUse, t as readRecentCodexRateLimits } from "./rate-limit-cache-DbZvmrAD.js";
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import nodeFs from "node:fs";
|
|
14
14
|
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, bootstrapHarnessContextEngine, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, callGatewayTool, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatApprovalDisplayPath, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, isActiveHarnessContextEngine, isSubagentSessionKey, normalizeAgentRuntimeTools, normalizeUsage, registerNativeHookRelay, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveUserPath, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1188,7 +1188,7 @@ function buildMirrorDedupeIdentity(message) {
|
|
|
1188
1188
|
return `${message.role}:${fingerprintMirrorMessageContent(message)}`;
|
|
1189
1189
|
}
|
|
1190
1190
|
async function mirrorCodexAppServerTranscript(params) {
|
|
1191
|
-
const messages = params.messages.filter((message) => message.role === "user" || message.role === "assistant");
|
|
1191
|
+
const messages = params.messages.filter((message) => message.role === "user" || message.role === "assistant" || message.role === "toolResult");
|
|
1192
1192
|
if (messages.length === 0) return;
|
|
1193
1193
|
const lock = await acquireSessionWriteLock({
|
|
1194
1194
|
sessionFile: params.sessionFile,
|
|
@@ -1280,6 +1280,7 @@ const CODEX_PROMPT_TOTAL_INPUT_KEYS = [
|
|
|
1280
1280
|
"prompt_tokens"
|
|
1281
1281
|
];
|
|
1282
1282
|
const MAX_TOOL_OUTPUT_DELTA_MESSAGES_PER_ITEM = 20;
|
|
1283
|
+
const TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 12e3;
|
|
1283
1284
|
var CodexAppServerEventProjector = class {
|
|
1284
1285
|
constructor(params, threadId, turnId) {
|
|
1285
1286
|
this.params = params;
|
|
@@ -1297,6 +1298,9 @@ var CodexAppServerEventProjector = class {
|
|
|
1297
1298
|
this.toolResultOutputStreamedItemIds = /* @__PURE__ */ new Set();
|
|
1298
1299
|
this.toolResultOutputDeltaState = /* @__PURE__ */ new Map();
|
|
1299
1300
|
this.toolMetas = /* @__PURE__ */ new Map();
|
|
1301
|
+
this.toolTranscriptMessages = [];
|
|
1302
|
+
this.toolTranscriptCallIds = /* @__PURE__ */ new Set();
|
|
1303
|
+
this.toolTranscriptResultIds = /* @__PURE__ */ new Set();
|
|
1300
1304
|
this.assistantStarted = false;
|
|
1301
1305
|
this.reasoningStarted = false;
|
|
1302
1306
|
this.reasoningEnded = false;
|
|
@@ -1380,6 +1384,7 @@ var CodexAppServerEventProjector = class {
|
|
|
1380
1384
|
}, `${turnId}:prompt`)];
|
|
1381
1385
|
if (reasoningText) messagesSnapshot.push(attachCodexMirrorIdentity(this.createAssistantMirrorMessage("Codex reasoning", reasoningText), `${turnId}:reasoning`));
|
|
1382
1386
|
if (planText) messagesSnapshot.push(attachCodexMirrorIdentity(this.createAssistantMirrorMessage("Codex plan", planText), `${turnId}:plan`));
|
|
1387
|
+
messagesSnapshot.push(...this.toolTranscriptMessages);
|
|
1383
1388
|
if (lastAssistant) messagesSnapshot.push(attachCodexMirrorIdentity(lastAssistant, `${turnId}:assistant`));
|
|
1384
1389
|
const turnFailed = this.completedTurn?.status === "failed";
|
|
1385
1390
|
const turnInterrupted = this.completedTurn?.status === "interrupted";
|
|
@@ -1432,6 +1437,21 @@ var CodexAppServerEventProjector = class {
|
|
|
1432
1437
|
didSendDeterministicApprovalPrompt: this.guardianReviewCount > 0 ? false : void 0
|
|
1433
1438
|
};
|
|
1434
1439
|
}
|
|
1440
|
+
recordDynamicToolCall(params) {
|
|
1441
|
+
this.recordToolTranscriptCall({
|
|
1442
|
+
id: params.callId,
|
|
1443
|
+
name: params.tool,
|
|
1444
|
+
arguments: sanitizeCodexToolArguments(params.arguments)
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
recordDynamicToolResult(params) {
|
|
1448
|
+
this.recordToolTranscriptResult({
|
|
1449
|
+
id: params.callId,
|
|
1450
|
+
name: params.tool,
|
|
1451
|
+
text: collectDynamicToolContentText(params.contentItems),
|
|
1452
|
+
isError: !params.success
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1435
1455
|
markTimedOut() {
|
|
1436
1456
|
this.aborted = true;
|
|
1437
1457
|
this.promptError = "codex app-server attempt timed out";
|
|
@@ -1523,6 +1543,7 @@ var CodexAppServerEventProjector = class {
|
|
|
1523
1543
|
phase: "start",
|
|
1524
1544
|
item
|
|
1525
1545
|
});
|
|
1546
|
+
this.recordNativeToolTranscriptCall(item);
|
|
1526
1547
|
this.emitToolResultSummary(item);
|
|
1527
1548
|
this.emitAgentEvent({
|
|
1528
1549
|
stream: "codex_app_server.item",
|
|
@@ -1589,6 +1610,8 @@ var CodexAppServerEventProjector = class {
|
|
|
1589
1610
|
phase: "result",
|
|
1590
1611
|
item
|
|
1591
1612
|
});
|
|
1613
|
+
this.recordNativeToolTranscriptCall(item);
|
|
1614
|
+
this.recordNativeToolTranscriptResult(item);
|
|
1592
1615
|
this.emitToolResultSummary(item);
|
|
1593
1616
|
this.emitToolResultOutput(item);
|
|
1594
1617
|
this.emitAgentEvent({
|
|
@@ -1679,6 +1702,8 @@ var CodexAppServerEventProjector = class {
|
|
|
1679
1702
|
});
|
|
1680
1703
|
}
|
|
1681
1704
|
this.recordToolMeta(item);
|
|
1705
|
+
this.recordNativeToolTranscriptCall(item);
|
|
1706
|
+
this.recordNativeToolTranscriptResult(item);
|
|
1682
1707
|
this.emitToolResultSummary(item);
|
|
1683
1708
|
this.emitToolResultOutput(item);
|
|
1684
1709
|
}
|
|
@@ -1843,6 +1868,37 @@ var CodexAppServerEventProjector = class {
|
|
|
1843
1868
|
...meta ? { meta } : {}
|
|
1844
1869
|
});
|
|
1845
1870
|
}
|
|
1871
|
+
recordNativeToolTranscriptCall(item) {
|
|
1872
|
+
if (!item || !shouldSynthesizeToolProgressForItem(item)) return;
|
|
1873
|
+
const name = itemName(item);
|
|
1874
|
+
if (!name) return;
|
|
1875
|
+
this.recordToolTranscriptCall({
|
|
1876
|
+
id: item.id,
|
|
1877
|
+
name,
|
|
1878
|
+
arguments: itemToolArgs(item)
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
recordNativeToolTranscriptResult(item) {
|
|
1882
|
+
if (!item || !shouldSynthesizeToolProgressForItem(item)) return;
|
|
1883
|
+
const name = itemName(item);
|
|
1884
|
+
if (!name) return;
|
|
1885
|
+
this.recordToolTranscriptResult({
|
|
1886
|
+
id: item.id,
|
|
1887
|
+
name,
|
|
1888
|
+
text: itemTranscriptResultText(item),
|
|
1889
|
+
isError: isNonSuccessItemStatus(itemStatus(item))
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
recordToolTranscriptCall(params) {
|
|
1893
|
+
if (!params.id || !params.name || this.toolTranscriptCallIds.has(params.id)) return;
|
|
1894
|
+
this.toolTranscriptCallIds.add(params.id);
|
|
1895
|
+
this.toolTranscriptMessages.push(attachCodexMirrorIdentity(this.createToolCallMessage(params), `${this.turnId}:tool:${params.id}:call`));
|
|
1896
|
+
}
|
|
1897
|
+
recordToolTranscriptResult(params) {
|
|
1898
|
+
if (!params.id || !params.name || this.toolTranscriptResultIds.has(params.id)) return;
|
|
1899
|
+
this.toolTranscriptResultIds.add(params.id);
|
|
1900
|
+
this.toolTranscriptMessages.push(attachCodexMirrorIdentity(this.createToolResultMessage(params), `${this.turnId}:tool:${params.id}:result`));
|
|
1901
|
+
}
|
|
1846
1902
|
formatCodexErrorMessage(params) {
|
|
1847
1903
|
const error = isJsonObject(params.error) ? params.error : void 0;
|
|
1848
1904
|
return formatCodexUsageLimitErrorMessage({
|
|
@@ -1929,6 +1985,41 @@ var CodexAppServerEventProjector = class {
|
|
|
1929
1985
|
timestamp: Date.now()
|
|
1930
1986
|
};
|
|
1931
1987
|
}
|
|
1988
|
+
createToolCallMessage(params) {
|
|
1989
|
+
return {
|
|
1990
|
+
role: "assistant",
|
|
1991
|
+
content: [{
|
|
1992
|
+
type: "toolCall",
|
|
1993
|
+
id: params.id,
|
|
1994
|
+
name: params.name,
|
|
1995
|
+
arguments: normalizeToolTranscriptArguments(params.arguments)
|
|
1996
|
+
}],
|
|
1997
|
+
api: this.params.model.api ?? "openai-codex-responses",
|
|
1998
|
+
provider: this.params.provider,
|
|
1999
|
+
model: this.params.modelId,
|
|
2000
|
+
usage: ZERO_USAGE,
|
|
2001
|
+
stopReason: "toolUse",
|
|
2002
|
+
timestamp: Date.now()
|
|
2003
|
+
};
|
|
2004
|
+
}
|
|
2005
|
+
createToolResultMessage(params) {
|
|
2006
|
+
const text = truncateToolTranscriptText(params.text?.trim() || toolResultStatusText(params));
|
|
2007
|
+
return {
|
|
2008
|
+
role: "toolResult",
|
|
2009
|
+
toolCallId: params.id,
|
|
2010
|
+
toolName: params.name,
|
|
2011
|
+
isError: params.isError,
|
|
2012
|
+
content: [{
|
|
2013
|
+
type: "toolResult",
|
|
2014
|
+
toolCallId: params.id,
|
|
2015
|
+
toolUseId: params.id,
|
|
2016
|
+
tool_use_id: params.id,
|
|
2017
|
+
content: text,
|
|
2018
|
+
text
|
|
2019
|
+
}],
|
|
2020
|
+
timestamp: Date.now()
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
1932
2023
|
isNotificationForTurn(params) {
|
|
1933
2024
|
const threadId = readString$2(params, "threadId");
|
|
1934
2025
|
const turnId = readNotificationTurnId$1(params);
|
|
@@ -2153,6 +2244,16 @@ function itemOutputText(item) {
|
|
|
2153
2244
|
return item.result ? stringifyJsonValue(item.result) : void 0;
|
|
2154
2245
|
}
|
|
2155
2246
|
}
|
|
2247
|
+
function itemTranscriptResultText(item) {
|
|
2248
|
+
const output = itemOutputText(item);
|
|
2249
|
+
if (output) return output;
|
|
2250
|
+
const result = itemToolResult(item).result;
|
|
2251
|
+
return result ? stringifyJsonValue(result) : itemStatus(item);
|
|
2252
|
+
}
|
|
2253
|
+
function normalizeToolTranscriptArguments(value) {
|
|
2254
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
2255
|
+
return value;
|
|
2256
|
+
}
|
|
2156
2257
|
function collectDynamicToolContentText(contentItems) {
|
|
2157
2258
|
if (!Array.isArray(contentItems)) return "";
|
|
2158
2259
|
return contentItems.flatMap((entry) => {
|
|
@@ -2161,6 +2262,13 @@ function collectDynamicToolContentText(contentItems) {
|
|
|
2161
2262
|
return text ? [text] : [];
|
|
2162
2263
|
}).join("\n");
|
|
2163
2264
|
}
|
|
2265
|
+
function truncateToolTranscriptText(text) {
|
|
2266
|
+
if (text.length <= TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS) return text;
|
|
2267
|
+
return `${text.slice(0, TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS)}\n...(truncated)...`;
|
|
2268
|
+
}
|
|
2269
|
+
function toolResultStatusText(params) {
|
|
2270
|
+
return params.isError ? `${params.name} failed` : `${params.name} completed`;
|
|
2271
|
+
}
|
|
2164
2272
|
function stringifyJsonValue(value) {
|
|
2165
2273
|
try {
|
|
2166
2274
|
return JSON.stringify(value, null, 2);
|
|
@@ -2633,6 +2741,8 @@ function filterToolsForVisionInputs(tools, params) {
|
|
|
2633
2741
|
//#endregion
|
|
2634
2742
|
//#region extensions/codex/src/app-server/run-attempt.ts
|
|
2635
2743
|
const CODEX_DYNAMIC_TOOL_TIMEOUT_MS = 3e4;
|
|
2744
|
+
const CODEX_DYNAMIC_TOOL_MAX_TIMEOUT_MS = 6e5;
|
|
2745
|
+
const CODEX_DYNAMIC_IMAGE_TOOL_TIMEOUT_MS = 6e4;
|
|
2636
2746
|
const CODEX_APP_SERVER_STARTUP_CONNECTION_CLOSE_MAX_ATTEMPTS = 3;
|
|
2637
2747
|
const CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS = 100;
|
|
2638
2748
|
const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 6e4;
|
|
@@ -3397,6 +3507,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3397
3507
|
name: call.tool,
|
|
3398
3508
|
arguments: call.arguments
|
|
3399
3509
|
});
|
|
3510
|
+
projector?.recordDynamicToolCall({
|
|
3511
|
+
callId: call.callId,
|
|
3512
|
+
tool: call.tool,
|
|
3513
|
+
arguments: call.arguments
|
|
3514
|
+
});
|
|
3400
3515
|
const toolMeta = inferCodexDynamicToolMeta(call, resolveCodexToolProgressDetailMode(params.toolProgressDetail));
|
|
3401
3516
|
const toolArgs = sanitizeCodexToolArguments(call.arguments);
|
|
3402
3517
|
emitCodexAppServerEvent(params, {
|
|
@@ -3409,18 +3524,22 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3409
3524
|
...toolArgs ? { args: toolArgs } : {}
|
|
3410
3525
|
}
|
|
3411
3526
|
});
|
|
3527
|
+
const dynamicToolTimeoutMs = resolveDynamicToolCallTimeoutMs({
|
|
3528
|
+
call,
|
|
3529
|
+
config: params.config
|
|
3530
|
+
});
|
|
3412
3531
|
const response = await handleDynamicToolCallWithTimeout({
|
|
3413
3532
|
call,
|
|
3414
3533
|
toolBridge,
|
|
3415
3534
|
signal: runAbortController.signal,
|
|
3416
|
-
timeoutMs:
|
|
3535
|
+
timeoutMs: dynamicToolTimeoutMs,
|
|
3417
3536
|
onTimeout: () => {
|
|
3418
3537
|
trajectoryRecorder?.recordEvent("tool.timeout", {
|
|
3419
3538
|
threadId: call.threadId,
|
|
3420
3539
|
turnId: call.turnId,
|
|
3421
3540
|
toolCallId: call.callId,
|
|
3422
3541
|
name: call.tool,
|
|
3423
|
-
timeoutMs:
|
|
3542
|
+
timeoutMs: dynamicToolTimeoutMs
|
|
3424
3543
|
});
|
|
3425
3544
|
}
|
|
3426
3545
|
});
|
|
@@ -3432,6 +3551,12 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3432
3551
|
success: response.success,
|
|
3433
3552
|
contentItems: response.contentItems
|
|
3434
3553
|
});
|
|
3554
|
+
projector?.recordDynamicToolResult({
|
|
3555
|
+
callId: call.callId,
|
|
3556
|
+
tool: call.tool,
|
|
3557
|
+
success: response.success,
|
|
3558
|
+
contentItems: response.contentItems
|
|
3559
|
+
});
|
|
3435
3560
|
emitCodexAppServerEvent(params, {
|
|
3436
3561
|
stream: "tool",
|
|
3437
3562
|
data: {
|
|
@@ -3752,7 +3877,7 @@ async function handleDynamicToolCallWithTimeout(params) {
|
|
|
3752
3877
|
resolveAbort = resolve;
|
|
3753
3878
|
});
|
|
3754
3879
|
const timeoutPromise = new Promise((resolve) => {
|
|
3755
|
-
const timeoutMs =
|
|
3880
|
+
const timeoutMs = clampDynamicToolTimeoutMs(params.timeoutMs);
|
|
3756
3881
|
timeout = setTimeout(() => {
|
|
3757
3882
|
timedOut = true;
|
|
3758
3883
|
const timeoutDetails = formatDynamicToolTimeoutDetails({
|
|
@@ -3795,6 +3920,31 @@ function failedDynamicToolResponse(message) {
|
|
|
3795
3920
|
}]
|
|
3796
3921
|
};
|
|
3797
3922
|
}
|
|
3923
|
+
function resolveDynamicToolCallTimeoutMs(params) {
|
|
3924
|
+
return clampDynamicToolTimeoutMs(readDynamicToolCallTimeoutMs(params.call.arguments) ?? readConfiguredDynamicToolTimeoutMs(params.call.tool, params.config) ?? CODEX_DYNAMIC_TOOL_TIMEOUT_MS);
|
|
3925
|
+
}
|
|
3926
|
+
function readDynamicToolCallTimeoutMs(value) {
|
|
3927
|
+
if (!isJsonObject(value)) return;
|
|
3928
|
+
return readPositiveFiniteTimeoutMs(value.timeoutMs);
|
|
3929
|
+
}
|
|
3930
|
+
function readConfiguredDynamicToolTimeoutMs(toolName, config) {
|
|
3931
|
+
if (toolName === "image_generate") {
|
|
3932
|
+
const imageGenerationModel = config?.agents?.defaults?.imageGenerationModel;
|
|
3933
|
+
if (!imageGenerationModel || typeof imageGenerationModel !== "object") return;
|
|
3934
|
+
return readPositiveFiniteTimeoutMs(imageGenerationModel.timeoutMs);
|
|
3935
|
+
}
|
|
3936
|
+
if (toolName === "image") return readTimeoutSecondsAsMs(config?.tools?.media?.image?.timeoutSeconds) ?? CODEX_DYNAMIC_IMAGE_TOOL_TIMEOUT_MS;
|
|
3937
|
+
}
|
|
3938
|
+
function readTimeoutSecondsAsMs(value) {
|
|
3939
|
+
const seconds = readPositiveFiniteTimeoutMs(value);
|
|
3940
|
+
return seconds === void 0 ? void 0 : seconds * 1e3;
|
|
3941
|
+
}
|
|
3942
|
+
function readPositiveFiniteTimeoutMs(value) {
|
|
3943
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : void 0;
|
|
3944
|
+
}
|
|
3945
|
+
function clampDynamicToolTimeoutMs(timeoutMs) {
|
|
3946
|
+
return Math.max(1, Math.min(CODEX_DYNAMIC_TOOL_MAX_TIMEOUT_MS, Math.floor(timeoutMs)));
|
|
3947
|
+
}
|
|
3798
3948
|
function createCodexNativeHookRelay(params) {
|
|
3799
3949
|
if (params.options?.enabled === false) return;
|
|
3800
3950
|
return registerNativeHookRelay({
|
|
@@ -3856,7 +4006,7 @@ async function buildDynamicTools(input) {
|
|
|
3856
4006
|
const agentDir = params.agentDir ?? resolveAgentDir(params.config ?? {}, input.sessionAgentId);
|
|
3857
4007
|
const createOpenClawCodingTools = openClawCodingToolsFactoryForTests ?? (await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;
|
|
3858
4008
|
const sessionKeys = resolveOpenClawCodingToolsSessionKeys(params, input.sandboxSessionKey);
|
|
3859
|
-
const filteredTools = filterCodexDynamicToolsForAllowlist(filterToolsForVisionInputs(
|
|
4009
|
+
const filteredTools = filterCodexDynamicToolsForAllowlist(filterToolsForVisionInputs(filterCodexDynamicTools(createOpenClawCodingTools({
|
|
3860
4010
|
agentId: input.sessionAgentId,
|
|
3861
4011
|
...buildEmbeddedAttemptToolRunContext(params),
|
|
3862
4012
|
exec: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
|
|
2
|
-
import { a as normalizeCodexServiceTier } from "./config-
|
|
2
|
+
import { a as normalizeCodexServiceTier } from "./config-CT01BBDc.js";
|
|
3
3
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
|
|
2
|
-
import { n as codexAppServerStartOptionsKey, s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
3
|
-
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-
|
|
2
|
+
import { n as codexAppServerStartOptionsKey, s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
3
|
+
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-CTzy3Y6M.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { constants, readFileSync } from "node:fs";
|
package/dist/test-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { a as buildTurnStartParams, d as createCodexDynamicToolBridge, f as
|
|
1
|
+
import { s as resolveCodexAppServerRuntimeOptions } from "./config-CT01BBDc.js";
|
|
2
|
+
import { a as buildTurnStartParams, d as createCodexDynamicToolBridge, f as filterCodexDynamicTools, i as buildThreadStartParams, n as buildDeveloperInstructions, r as buildThreadResumeParams } from "./thread-lifecycle-CGc-O_5d.js";
|
|
3
3
|
//#region extensions/codex/test-api.ts
|
|
4
4
|
function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
|
|
5
5
|
return resolveCodexAppServerRuntimeOptions({
|
|
@@ -35,7 +35,7 @@ function buildCodexHarnessPromptSnapshot(params) {
|
|
|
35
35
|
}
|
|
36
36
|
function createCodexDynamicToolSpecsForPromptSnapshot(params) {
|
|
37
37
|
return createCodexDynamicToolBridge({
|
|
38
|
-
tools:
|
|
38
|
+
tools: filterCodexDynamicTools(params.tools, params.pluginConfig ?? {}),
|
|
39
39
|
signal: new AbortController().signal,
|
|
40
40
|
loading: params.pluginConfig?.codexDynamicToolsLoading ?? "searchable",
|
|
41
41
|
directToolNames: params.directToolNames
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { l as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn } from "./config-
|
|
2
|
-
import { n as assertCodexThreadStartResponse, t as assertCodexThreadResumeResponse } from "./protocol-validators-
|
|
1
|
+
import { l as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn } from "./config-CT01BBDc.js";
|
|
2
|
+
import { n as assertCodexThreadStartResponse, t as assertCodexThreadResumeResponse } from "./protocol-validators-CeCyJaWj.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-
|
|
7
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
8
|
-
import { i as defaultCodexAppInventoryCache, n as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
6
|
+
import { i as isCodexAppServerConnectionClosedError } from "./client-CTzy3Y6M.js";
|
|
7
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-B44KIZM2.js";
|
|
8
|
+
import { i as defaultCodexAppInventoryCache, n as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-CweAZa7r.js";
|
|
9
9
|
import crypto from "node:crypto";
|
|
10
10
|
import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractToolResultMediaArtifact, filterToolResultMediaUrls, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
11
11
|
//#region extensions/codex/src/app-server/dynamic-tool-profile.ts
|
|
12
|
-
const
|
|
12
|
+
const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
|
|
13
13
|
"read",
|
|
14
14
|
"write",
|
|
15
15
|
"edit",
|
|
@@ -26,9 +26,9 @@ function normalizeCodexDynamicToolName(name) {
|
|
|
26
26
|
const normalized = name.trim().toLowerCase();
|
|
27
27
|
return DYNAMIC_TOOL_NAME_ALIASES[normalized] ?? normalized;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function filterCodexDynamicTools(tools, config) {
|
|
30
30
|
const excludes = /* @__PURE__ */ new Set();
|
|
31
|
-
|
|
31
|
+
for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) excludes.add(name);
|
|
32
32
|
for (const name of config.codexDynamicToolsExclude ?? []) {
|
|
33
33
|
const trimmed = normalizeCodexDynamicToolName(name);
|
|
34
34
|
if (trimmed) excludes.add(trimmed);
|
|
@@ -846,4 +846,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
|
|
|
846
846
|
return null;
|
|
847
847
|
}
|
|
848
848
|
//#endregion
|
|
849
|
-
export { buildTurnStartParams as a, buildCodexPluginThreadConfig as c, createCodexDynamicToolBridge as d,
|
|
849
|
+
export { buildTurnStartParams as a, buildCodexPluginThreadConfig as c, createCodexDynamicToolBridge as d, filterCodexDynamicTools as f, buildThreadStartParams as i, buildCodexPluginThreadConfigInputFingerprint as l, buildDeveloperInstructions as n, codexDynamicToolsFingerprint as o, normalizeCodexDynamicToolName as p, buildThreadResumeParams as r, startOrResumeThread as s, areCodexDynamicToolFingerprintsCompatible as t, shouldBuildCodexPluginThreadConfig as u };
|
package/openclaw.plugin.json
CHANGED
|
@@ -33,11 +33,6 @@
|
|
|
33
33
|
"type": "object",
|
|
34
34
|
"additionalProperties": false,
|
|
35
35
|
"properties": {
|
|
36
|
-
"codexDynamicToolsProfile": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"enum": ["native-first", "openclaw-compat"],
|
|
39
|
-
"default": "native-first"
|
|
40
|
-
},
|
|
41
36
|
"codexDynamicToolsLoading": {
|
|
42
37
|
"type": "string",
|
|
43
38
|
"enum": ["searchable", "direct"],
|
|
@@ -197,11 +192,6 @@
|
|
|
197
192
|
}
|
|
198
193
|
},
|
|
199
194
|
"uiHints": {
|
|
200
|
-
"codexDynamicToolsProfile": {
|
|
201
|
-
"label": "Dynamic Tools Profile",
|
|
202
|
-
"help": "Select which OpenClaw dynamic tools are exposed to Codex app-server. native-first omits tools Codex already owns.",
|
|
203
|
-
"advanced": true
|
|
204
|
-
},
|
|
205
195
|
"codexDynamicToolsLoading": {
|
|
206
196
|
"label": "Dynamic Tools Loading",
|
|
207
197
|
"help": "Use searchable to defer OpenClaw dynamic tools behind Codex tool search, or direct to expose them in the initial context.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.10-beta.2",
|
|
4
4
|
"description": "OpenClaw Codex harness and model provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"minHostVersion": ">=2026.5.1-beta.1"
|
|
27
27
|
},
|
|
28
28
|
"compat": {
|
|
29
|
-
"pluginApi": ">=2026.5.
|
|
29
|
+
"pluginApi": ">=2026.5.10-beta.2"
|
|
30
30
|
},
|
|
31
31
|
"build": {
|
|
32
|
-
"openclawVersion": "2026.5.
|
|
32
|
+
"openclawVersion": "2026.5.10-beta.2"
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
35
35
|
"publishToClawHub": true,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"openclaw.plugin.json"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"openclaw": ">=2026.5.
|
|
47
|
+
"openclaw": ">=2026.5.10-beta.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"openclaw": {
|