@openclaw/codex 2026.5.19-beta.2 → 2026.5.20-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-BCJaLwdZ.js → client-Ab4Fw77C.js} +2 -2
- package/dist/{client-factory-By1f68U_.js → client-factory-BbesECdh.js} +1 -1
- package/dist/{command-formatters-BpPOTePl.js → command-formatters-BVBnEgyA.js} +1 -1
- package/dist/{command-handlers-CFFYwpt4.js → command-handlers-Gceg_rBZ.js} +40 -16
- package/dist/{compact-BPnB6ZWJ.js → compact-BaSDurdH.js} +4 -4
- package/dist/{computer-use-BD8UmXB-.js → computer-use-B4iTog6z.js} +2 -2
- package/dist/harness.js +5 -5
- package/dist/index.js +7 -7
- package/dist/media-understanding-provider.js +5 -5
- package/dist/{models-6ViLQ-HQ.js → models-C8MdOXGD.js} +3 -3
- package/dist/{node-cli-sessions-douLgfcf.js → node-cli-sessions-T1olB1SH.js} +6 -6
- package/dist/{plugin-activation-Dtcfb3sk.js → plugin-activation-BkQkPLOY.js} +1 -1
- package/dist/provider.js +2 -2
- package/dist/{request-BLCZjckr.js → request-BePR77QD.js} +3 -3
- package/dist/{run-attempt-BqRPAaHk.js → run-attempt-8r4wCbNk.js} +29 -21
- package/dist/{session-binding-D9ejASYj.js → session-binding-DEiYHgJ_.js} +2 -2
- package/dist/{shared-client-DWgKldR5.js → shared-client-DCxJx5QU.js} +3 -3
- package/dist/{side-question-DjyRnjPQ.js → side-question-Ufu1Z7Ne.js} +10 -10
- package/dist/test-api.js +2 -2
- package/dist/{thread-lifecycle-C07GnPSH.js → thread-lifecycle-CeH-cRV4.js} +7 -12
- package/dist/{vision-tools-CDoJ4rDN.js → vision-tools-B2wt6ecs.js} +25 -5
- package/package.json +6 -6
- /package/dist/{config-B5rU0vP3.js → config-DqIp6oTk.js} +0 -0
- /package/dist/{protocol-C9UWI98H.js → protocol-oeJQu4rs.js} +0 -0
- /package/dist/{protocol-validators-BGBspNmF.js → protocol-validators-_gKDcd0x.js} +0 -0
- /package/dist/{rate-limit-cache-dvhq-4pi.js → rate-limit-cache-N66I-Rd7.js} +0 -0
- /package/dist/{rolldown-runtime-DUslC3ob.js → rolldown-runtime-8H4AJuhK.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { n as isRpcResponse } from "./protocol-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { n as isRpcResponse } from "./protocol-oeJQu4rs.js";
|
|
3
3
|
import { createInterface } from "node:readline";
|
|
4
4
|
import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
@@ -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-DCxJx5QU.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
|
|
3
3
|
startOptions,
|
|
4
4
|
authProfileId,
|
|
5
5
|
agentDir,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-
|
|
3
|
-
import { t as isJsonObject } from "./protocol-
|
|
4
|
-
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-
|
|
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-
|
|
6
|
-
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
7
|
-
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-
|
|
8
|
-
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-
|
|
9
|
-
import { n as rememberCodexRateLimits } from "./rate-limit-cache-
|
|
1
|
+
import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-C8MdOXGD.js";
|
|
3
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
4
|
+
import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-BePR77QD.js";
|
|
5
|
+
import { a as formatComputerUseStatus, c as formatThreads, i as formatCodexStatus, l as readString$1, n as formatAccount, o as formatList, p as summarizeCodexAccountUsage, r as formatCodexDisplayText, s as formatModels, t as buildHelp } from "./command-formatters-BVBnEgyA.js";
|
|
6
|
+
import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
7
|
+
import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-T1olB1SH.js";
|
|
8
|
+
import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-B4iTog6z.js";
|
|
9
|
+
import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAgentDir, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
|
|
12
12
|
//#region extensions/codex/src/command-account.ts
|
|
@@ -18,7 +18,7 @@ async function readCodexAccountAuthOverview(params) {
|
|
|
18
18
|
allowKeychainPrompt: false,
|
|
19
19
|
config
|
|
20
20
|
});
|
|
21
|
-
const order = resolveDisplayAuthOrder({
|
|
21
|
+
const { order, explicit: explicitOrder } = resolveDisplayAuthOrder({
|
|
22
22
|
config,
|
|
23
23
|
store
|
|
24
24
|
});
|
|
@@ -27,6 +27,7 @@ async function readCodexAccountAuthOverview(params) {
|
|
|
27
27
|
const activeProfileId = resolveActiveProfileId({
|
|
28
28
|
store,
|
|
29
29
|
order,
|
|
30
|
+
explicitOrder,
|
|
30
31
|
config,
|
|
31
32
|
account: params.account,
|
|
32
33
|
limits: params.limits,
|
|
@@ -71,12 +72,28 @@ async function readCodexAccountAuthOverview(params) {
|
|
|
71
72
|
}
|
|
72
73
|
function resolveDisplayAuthOrder(params) {
|
|
73
74
|
const codexOrder = resolveOrder(params.store.order, OPENAI_CODEX_PROVIDER_ID) ?? resolveOrder(params.config?.auth?.order, OPENAI_CODEX_PROVIDER_ID);
|
|
74
|
-
if (codexOrder && codexOrder.length > 0) return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
if (codexOrder && codexOrder.length > 0) return {
|
|
76
|
+
order: dedupe(codexOrder),
|
|
77
|
+
explicit: true
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
order: resolveAuthProfileOrder({
|
|
81
|
+
cfg: params.config,
|
|
82
|
+
store: params.store,
|
|
83
|
+
provider: OPENAI_CODEX_PROVIDER_ID
|
|
84
|
+
}),
|
|
85
|
+
explicit: hasExplicitOpenAiAuthOrder(params)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function hasExplicitOpenAiAuthOrder(params) {
|
|
89
|
+
const sources = [params.store.order, params.config?.auth?.order];
|
|
90
|
+
for (const source of sources) {
|
|
91
|
+
const codex = resolveOrder(source, OPENAI_CODEX_PROVIDER_ID);
|
|
92
|
+
if (codex && codex.length > 0) return true;
|
|
93
|
+
const openai = resolveOrder(source, OPENAI_PROVIDER_ID);
|
|
94
|
+
if (openai && openai.length > 0) return true;
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
80
97
|
}
|
|
81
98
|
function resolveOrder(order, provider) {
|
|
82
99
|
return findNormalizedProviderValue(order, provider);
|
|
@@ -88,6 +105,13 @@ function resolveActiveProfileId(params) {
|
|
|
88
105
|
order: params.order
|
|
89
106
|
});
|
|
90
107
|
if (liveProfileId) return liveProfileId;
|
|
108
|
+
if (params.explicitOrder) return params.order.find((profileId) => isActiveProfileCandidate(params, profileId) && resolveAuthProfileEligibility({
|
|
109
|
+
cfg: params.config,
|
|
110
|
+
store: params.store,
|
|
111
|
+
provider: OPENAI_CODEX_PROVIDER_ID,
|
|
112
|
+
profileId,
|
|
113
|
+
now: params.now
|
|
114
|
+
}).eligible);
|
|
91
115
|
const lastGood = [params.store.lastGood?.[OPENAI_PROVIDER_ID], params.store.lastGood?.[OPENAI_CODEX_PROVIDER_ID]].find((profileId) => !!profileId && params.order.includes(profileId) && isActiveProfileCandidate(params, profileId));
|
|
92
116
|
if (lastGood) return lastGood;
|
|
93
117
|
const mostRecent = params.order.map((profileId) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { t as isJsonObject } from "./protocol-
|
|
3
|
-
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
4
|
-
import { t as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
3
|
+
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
4
|
+
import { t as defaultCodexAppServerClientFactory } from "./client-factory-BbesECdh.js";
|
|
5
5
|
import { compactContextEngineWithSafetyTimeout, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/compact.ts
|
|
7
7
|
const DEFAULT_CODEX_COMPACTION_WAIT_TIMEOUT_MS = 300 * 1e3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions, l as resolveCodexComputerUseConfig } from "./config-
|
|
2
|
-
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions, l as resolveCodexComputerUseConfig } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-BePR77QD.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 {
|
package/dist/harness.js
CHANGED
|
@@ -18,31 +18,31 @@ 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-8r4wCbNk.js");
|
|
22
22
|
return runCodexAppServerAttempt(params, {
|
|
23
23
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
24
24
|
nativeHookRelay: { enabled: true }
|
|
25
25
|
});
|
|
26
26
|
},
|
|
27
27
|
runSideQuestion: async (params) => {
|
|
28
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-
|
|
28
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-Ufu1Z7Ne.js");
|
|
29
29
|
return runCodexAppServerSideQuestion(params, {
|
|
30
30
|
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
31
31
|
nativeHookRelay: { enabled: true }
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
34
|
compact: async (params) => {
|
|
35
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-
|
|
35
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-BaSDurdH.js");
|
|
36
36
|
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
37
37
|
},
|
|
38
38
|
reset: async (params) => {
|
|
39
39
|
if (params.sessionFile) {
|
|
40
|
-
const { clearCodexAppServerBinding } = await import("./session-binding-
|
|
40
|
+
const { clearCodexAppServerBinding } = await import("./session-binding-DEiYHgJ_.js").then((n) => n.a);
|
|
41
41
|
await clearCodexAppServerBinding(params.sessionFile);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
dispose: async () => {
|
|
45
|
-
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-
|
|
45
|
+
const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-DCxJx5QU.js").then((n) => n.a);
|
|
46
46
|
await clearSharedCodexAppServerClientAndWait();
|
|
47
47
|
}
|
|
48
48
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createCodexAppServerAgentHarness } from "./harness.js";
|
|
2
|
-
import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-
|
|
2
|
+
import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-DqIp6oTk.js";
|
|
3
3
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
4
4
|
import { buildCodexProvider } from "./provider.js";
|
|
5
|
-
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-
|
|
6
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
7
|
-
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-
|
|
8
|
-
import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-
|
|
9
|
-
import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
5
|
+
import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-BePR77QD.js";
|
|
6
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BVBnEgyA.js";
|
|
7
|
+
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-DCxJx5QU.js";
|
|
8
|
+
import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-T1olB1SH.js";
|
|
9
|
+
import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-BkQkPLOY.js";
|
|
10
10
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
11
11
|
import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
12
12
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
@@ -45,7 +45,7 @@ async function handleCodexCommand(ctx, options = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
async function loadDefaultCodexSubcommandHandler() {
|
|
48
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
48
|
+
const { handleCodexSubcommand } = await import("./command-handlers-Gceg_rBZ.js");
|
|
49
49
|
return handleCodexSubcommand;
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
|
|
2
|
-
import { c as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
3
|
-
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-
|
|
4
|
-
import { i as readModelListResult } from "./models-
|
|
5
|
-
import { t as isJsonObject } from "./protocol-
|
|
2
|
+
import { c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
|
|
3
|
+
import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-_gKDcd0x.js";
|
|
4
|
+
import { i as readModelListResult } from "./models-C8MdOXGD.js";
|
|
5
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
6
6
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
7
7
|
//#region extensions/codex/media-understanding-provider.ts
|
|
8
8
|
const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
|
|
@@ -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-DCxJx5QU.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
66
66
|
startOptions: appServer.start,
|
|
67
67
|
timeoutMs,
|
|
68
68
|
authProfileId: params.profile
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as readCodexModelListResponse } from "./protocol-validators-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { s as readCodexModelListResponse } from "./protocol-validators-_gKDcd0x.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-DCxJx5QU.js").then((n) => n.a);
|
|
43
43
|
const client = useSharedClient ? await getSharedCodexAppServerClient({
|
|
44
44
|
startOptions: options.startOptions,
|
|
45
45
|
timeoutMs,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-
|
|
2
|
-
import { t as isJsonObject } from "./protocol-
|
|
3
|
-
import { r as CODEX_CONTROL_METHODS } from "./request-
|
|
4
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
5
|
-
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-
|
|
6
|
-
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-
|
|
1
|
+
import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
3
|
+
import { r as CODEX_CONTROL_METHODS } from "./request-BePR77QD.js";
|
|
4
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BVBnEgyA.js";
|
|
5
|
+
import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-DCxJx5QU.js";
|
|
6
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
7
7
|
import os from "node:os";
|
|
8
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CODEX_PLUGINS_MARKETPLACE_NAME, u as resolveCodexPluginsPolicy } from "./config-
|
|
1
|
+
import { t as CODEX_PLUGINS_MARKETPLACE_NAME, u as resolveCodexPluginsPolicy } from "./config-DqIp6oTk.js";
|
|
2
2
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
3
3
|
import "node:fs/promises";
|
|
4
4
|
import "node:path";
|
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 { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig } from "./config-
|
|
2
|
+
import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig } from "./config-DqIp6oTk.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-C8MdOXGD.js").then((n) => n.r);
|
|
127
127
|
return listCodexAppServerModels(options);
|
|
128
128
|
}
|
|
129
129
|
function normalizeTimeoutMs(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as CodexAppServerRpcError } from "./client-
|
|
2
|
-
import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-
|
|
3
|
-
import { i as buildCodexAppInventoryCacheKey } from "./plugin-activation-
|
|
1
|
+
import { n as CodexAppServerRpcError } from "./client-Ab4Fw77C.js";
|
|
2
|
+
import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-DCxJx5QU.js";
|
|
3
|
+
import { i as buildCodexAppInventoryCacheKey } from "./plugin-activation-BkQkPLOY.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
6
6
|
const CODEX_CONTROL_METHODS = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions, d as withMcpElicitationsApprovalPolicy, i as isCodexAppServerApprovalPolicyAllowedByRequirements, s as readCodexPluginConfig, u as resolveCodexPluginsPolicy } from "./config-
|
|
2
|
-
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-
|
|
3
|
-
import { t as isJsonObject } from "./protocol-
|
|
4
|
-
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-
|
|
5
|
-
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-
|
|
6
|
-
import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimitsForUsageLimitMessage, r as formatCodexDisplayText, u as formatCodexUsageLimitErrorMessage } from "./command-formatters-
|
|
7
|
-
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, f as resolveCodexAppServerHomeDir, l as resolveCodexAppServerAuthProfileId, s as refreshCodexAppServerAuthTokens, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-
|
|
8
|
-
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-
|
|
9
|
-
import { a as defaultCodexAppInventoryCache } from "./plugin-activation-
|
|
10
|
-
import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, _ as projectContextEngineAssemblyForCodex, b as createCodexDynamicToolBridge, c as codexDynamicToolsFingerprint, f as startOrResumeThread, g as shouldBuildCodexPluginThreadConfig, h as mergeCodexThreadConfigs, i as buildDeveloperInstructions, l as isContextEngineBindingCompatible, m as buildCodexPluginThreadConfigInputFingerprint, p as buildCodexPluginThreadConfig, r as buildContextEngineBinding, s as buildTurnStartParams, t as areCodexDynamicToolFingerprintsCompatible, v as resolveCodexContextEngineProjectionMaxChars, w as normalizeCodexDynamicToolName, x as sanitizeCodexHistoryImagePayloads, y as resolveCodexContextEngineProjectionReserveTokens } from "./thread-lifecycle-
|
|
11
|
-
import { t as defaultCodexAppServerClientFactory } from "./client-factory-
|
|
12
|
-
import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-
|
|
13
|
-
import { t as ensureCodexComputerUse } from "./computer-use-
|
|
14
|
-
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions, d as withMcpElicitationsApprovalPolicy, i as isCodexAppServerApprovalPolicyAllowedByRequirements, l as resolveCodexComputerUseConfig, s as readCodexPluginConfig, u as resolveCodexPluginsPolicy } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-_gKDcd0x.js";
|
|
3
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
4
|
+
import { i as isCodexAppServerConnectionClosedError, r as isCodexAppServerApprovalRequest } from "./client-Ab4Fw77C.js";
|
|
5
|
+
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-BePR77QD.js";
|
|
6
|
+
import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimitsForUsageLimitMessage, r as formatCodexDisplayText, u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BVBnEgyA.js";
|
|
7
|
+
import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, f as resolveCodexAppServerHomeDir, l as resolveCodexAppServerAuthProfileId, s as refreshCodexAppServerAuthTokens, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-DCxJx5QU.js";
|
|
8
|
+
import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
9
|
+
import { a as defaultCodexAppInventoryCache } from "./plugin-activation-BkQkPLOY.js";
|
|
10
|
+
import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, _ as projectContextEngineAssemblyForCodex, b as createCodexDynamicToolBridge, c as codexDynamicToolsFingerprint, f as startOrResumeThread, g as shouldBuildCodexPluginThreadConfig, h as mergeCodexThreadConfigs, i as buildDeveloperInstructions, l as isContextEngineBindingCompatible, m as buildCodexPluginThreadConfigInputFingerprint, p as buildCodexPluginThreadConfig, r as buildContextEngineBinding, s as buildTurnStartParams, t as areCodexDynamicToolFingerprintsCompatible, v as resolveCodexContextEngineProjectionMaxChars, w as normalizeCodexDynamicToolName, x as sanitizeCodexHistoryImagePayloads, y as resolveCodexContextEngineProjectionReserveTokens } from "./thread-lifecycle-CeH-cRV4.js";
|
|
11
|
+
import { t as defaultCodexAppServerClientFactory } from "./client-factory-BbesECdh.js";
|
|
12
|
+
import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-B2wt6ecs.js";
|
|
13
|
+
import { t as ensureCodexComputerUse } from "./computer-use-B4iTog6z.js";
|
|
14
|
+
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
import nodeFs from "node:fs";
|
|
17
17
|
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, bootstrapHarnessContextEngine, buildAgentHookContextChannelFields, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, classifyAgentHarnessTerminalOutcome, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, finalizeHarnessContextEngineTurn, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, hasBeforeToolCallPolicy, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, isActiveHarnessContextEngine, isSubagentSessionKey, loadCodexBundleMcpThreadConfig, normalizeAgentRuntimeTools, normalizeUsage, registerNativeHookRelay, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockOptions, resolveUserPath, resolveWritableSandboxBindHostRoots, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runHarnessContextEngineMaintenance, setActiveEmbeddedRun, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1407,7 +1407,8 @@ var CodexAppServerEventProjector = class {
|
|
|
1407
1407
|
this.emitToolResultMessage({
|
|
1408
1408
|
itemId,
|
|
1409
1409
|
text: formatToolOutput(toolName, itemMeta(item, this.toolProgressDetailMode()), output),
|
|
1410
|
-
finalOutput: true
|
|
1410
|
+
finalOutput: true,
|
|
1411
|
+
isError: isNonSuccessItemStatus(itemStatus(item))
|
|
1411
1412
|
});
|
|
1412
1413
|
}
|
|
1413
1414
|
emitToolResultMessage(params) {
|
|
@@ -1416,7 +1417,10 @@ var CodexAppServerEventProjector = class {
|
|
|
1416
1417
|
this.toolProgressTexts.add(text);
|
|
1417
1418
|
if (params.finalOutput) this.toolResultOutputItemIds.add(params.itemId);
|
|
1418
1419
|
try {
|
|
1419
|
-
Promise.resolve(this.params.onToolResult?.({
|
|
1420
|
+
Promise.resolve(this.params.onToolResult?.({
|
|
1421
|
+
text,
|
|
1422
|
+
...params.isError === true ? { isError: true } : {}
|
|
1423
|
+
})).catch(() => {});
|
|
1420
1424
|
} catch {}
|
|
1421
1425
|
}
|
|
1422
1426
|
shouldEmitToolResult() {
|
|
@@ -1499,7 +1503,8 @@ var CodexAppServerEventProjector = class {
|
|
|
1499
1503
|
this.emitToolResultMessage({
|
|
1500
1504
|
itemId: params.id,
|
|
1501
1505
|
text: formatToolOutput(params.name, void 0, text),
|
|
1502
|
-
finalOutput: true
|
|
1506
|
+
finalOutput: true,
|
|
1507
|
+
isError: params.isError
|
|
1503
1508
|
});
|
|
1504
1509
|
}
|
|
1505
1510
|
formatCodexErrorMessage(params) {
|
|
@@ -2394,7 +2399,6 @@ const CODEX_BOOTSTRAP_CONTEXT_ORDER = new Map([
|
|
|
2394
2399
|
["memory.md", 60],
|
|
2395
2400
|
["heartbeat.md", 70]
|
|
2396
2401
|
]);
|
|
2397
|
-
let openClawCodingToolsFactoryForTests;
|
|
2398
2402
|
function emitCodexAppServerEvent(params, event) {
|
|
2399
2403
|
try {
|
|
2400
2404
|
emitAgentEvent({
|
|
@@ -2741,6 +2745,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
2741
2745
|
const attemptStartedAt = Date.now();
|
|
2742
2746
|
const attemptClientFactory = options.clientFactory ?? defaultCodexAppServerClientFactory;
|
|
2743
2747
|
const pluginConfig = readCodexPluginConfig(options.pluginConfig);
|
|
2748
|
+
const computerUseConfig = resolveCodexComputerUseConfig({ pluginConfig });
|
|
2744
2749
|
const configuredAppServer = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
2745
2750
|
const resolvedWorkspace = resolveUserPath(params.workspaceDir);
|
|
2746
2751
|
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
@@ -3073,6 +3078,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3073
3078
|
appCacheKey: pluginAppCacheKey
|
|
3074
3079
|
}) : void 0;
|
|
3075
3080
|
const resolvedPluginPolicy = pluginThreadConfigRequired ? resolveCodexPluginsPolicy(pluginThreadConfigPluginConfig) : void 0;
|
|
3081
|
+
const computerUseMcpElicitationDelegationRequired = computerUseConfig.enabled;
|
|
3082
|
+
const mcpElicitationDelegationRequired = resolvedPluginPolicy?.enabled === true || computerUseMcpElicitationDelegationRequired;
|
|
3076
3083
|
const enabledPluginConfigKeys = resolvedPluginPolicy ? resolvedPluginPolicy.pluginPolicies.filter((plugin) => plugin.enabled).map((plugin) => plugin.configKey).toSorted() : void 0;
|
|
3077
3084
|
embeddedAgentLog.info("codex plugin thread config eligibility", buildCodexPluginThreadConfigEligibilityLogData({
|
|
3078
3085
|
sessionId: params.sessionId,
|
|
@@ -3084,7 +3091,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3084
3091
|
startupAuthProfileId,
|
|
3085
3092
|
appServer
|
|
3086
3093
|
}));
|
|
3087
|
-
pluginAppServer =
|
|
3094
|
+
pluginAppServer = mcpElicitationDelegationRequired ? {
|
|
3088
3095
|
...appServer,
|
|
3089
3096
|
approvalPolicy: withMcpElicitationsApprovalPolicy(appServer.approvalPolicy)
|
|
3090
3097
|
} : appServer;
|
|
@@ -3099,7 +3106,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3099
3106
|
startupClientForCleanup = startupClient;
|
|
3100
3107
|
await ensureCodexComputerUse({
|
|
3101
3108
|
client: startupClient,
|
|
3102
|
-
pluginConfig
|
|
3109
|
+
pluginConfig,
|
|
3103
3110
|
timeoutMs: appServer.requestTimeoutMs,
|
|
3104
3111
|
signal: runAbortController.signal
|
|
3105
3112
|
});
|
|
@@ -3651,6 +3658,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3651
3658
|
threadId: thread.threadId,
|
|
3652
3659
|
turnId,
|
|
3653
3660
|
pluginAppPolicyContext: thread.pluginAppPolicyContext,
|
|
3661
|
+
...computerUseConfig.enabled ? { computerUseMcpServerName: computerUseConfig.mcpServerName } : {},
|
|
3654
3662
|
signal: runAbortController.signal
|
|
3655
3663
|
});
|
|
3656
3664
|
}
|
|
@@ -4579,7 +4587,7 @@ async function buildDynamicTools(input) {
|
|
|
4579
4587
|
if (params.disableTools || !supportsModelTools(params.model)) return [];
|
|
4580
4588
|
const modelHasVision = params.model.input?.includes("image") ?? false;
|
|
4581
4589
|
const agentDir = params.agentDir ?? resolveAgentDir$1(params.config ?? {}, input.sessionAgentId);
|
|
4582
|
-
const createOpenClawCodingTools =
|
|
4590
|
+
const createOpenClawCodingTools = (await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;
|
|
4583
4591
|
const sessionKeys = resolveOpenClawCodingToolsSessionKeys(params, input.sandboxSessionKey);
|
|
4584
4592
|
const allTools = createOpenClawCodingTools({
|
|
4585
4593
|
agentId: input.sessionAgentId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { o as normalizeCodexServiceTier } from "./config-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { o as normalizeCodexServiceTier } from "./config-DqIp6oTk.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
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { c as resolveCodexAppServerRuntimeOptions, n as codexAppServerStartOptionsKey } from "./config-
|
|
3
|
-
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { c as resolveCodexAppServerRuntimeOptions, n as codexAppServerStartOptionsKey } from "./config-DqIp6oTk.js";
|
|
3
|
+
import { a as MANAGED_CODEX_APP_SERVER_PACKAGE, o as resolveCodexAppServerSpawnEnv, t as CodexAppServerClient } from "./client-Ab4Fw77C.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { constants, readFileSync } from "node:fs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig } from "./config-
|
|
2
|
-
import { a as readCodexDynamicToolCallParams, i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, t as assertCodexThreadForkResponse } from "./protocol-validators-
|
|
3
|
-
import { t as isJsonObject } from "./protocol-
|
|
4
|
-
import { r as isCodexAppServerApprovalRequest } from "./client-
|
|
5
|
-
import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-
|
|
6
|
-
import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-
|
|
7
|
-
import { i as readCodexAppServerBinding } from "./session-binding-
|
|
8
|
-
import { S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, b as createCodexDynamicToolBridge, d as resolveReasoningEffort, h as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-
|
|
9
|
-
import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-
|
|
10
|
-
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { a as readCodexDynamicToolCallParams, i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, t as assertCodexThreadForkResponse } from "./protocol-validators-_gKDcd0x.js";
|
|
3
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
4
|
+
import { r as isCodexAppServerApprovalRequest } from "./client-Ab4Fw77C.js";
|
|
5
|
+
import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BVBnEgyA.js";
|
|
6
|
+
import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-DCxJx5QU.js";
|
|
7
|
+
import { i as readCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
8
|
+
import { S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, b as createCodexDynamicToolBridge, d as resolveReasoningEffort, h as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-CeH-cRV4.js";
|
|
9
|
+
import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-B2wt6ecs.js";
|
|
10
|
+
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
|
|
11
11
|
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
12
|
//#region extensions/codex/src/app-server/side-question.ts
|
|
13
13
|
const CODEX_SIDE_DYNAMIC_TOOL_TIMEOUT_MS = 3e4;
|
package/dist/test-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-
|
|
1
|
+
import { c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-CeH-cRV4.js";
|
|
3
3
|
//#region extensions/codex/test-api.ts
|
|
4
4
|
function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
|
|
5
5
|
return resolveCodexAppServerRuntimeOptions({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as codexSandboxPolicyForTurn, u as resolveCodexPluginsPolicy } from "./config-
|
|
2
|
-
import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-
|
|
3
|
-
import { t as isJsonObject } from "./protocol-
|
|
1
|
+
import { r as codexSandboxPolicyForTurn, u as resolveCodexPluginsPolicy } from "./config-DqIp6oTk.js";
|
|
2
|
+
import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-_gKDcd0x.js";
|
|
3
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
4
4
|
import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } 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 { a as defaultCodexAppInventoryCache, o as serializeCodexAppInventoryError, r as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
6
|
+
import { i as isCodexAppServerConnectionClosedError } from "./client-Ab4Fw77C.js";
|
|
7
|
+
import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
|
|
8
|
+
import { a as defaultCodexAppInventoryCache, o as serializeCodexAppInventoryError, r as readCodexPluginInventory, t as ensureCodexPluginActivation } from "./plugin-activation-BkQkPLOY.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, setBeforeToolCallDiagnosticsEnabled, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
11
11
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
@@ -1528,12 +1528,7 @@ function buildDeferredDynamicToolManifest(dynamicTools) {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
function buildVisibleReplyInstruction(params, dynamicTools) {
|
|
1530
1530
|
const messageToolAvailable = dynamicTools ? dynamicTools.some((tool) => tool.name.trim() === "message") : params.disableMessageTool !== true;
|
|
1531
|
-
if (params.sourceReplyDeliveryMode === "message_tool_only" && messageToolAvailable) return
|
|
1532
|
-
"Preserve channel/session context.",
|
|
1533
|
-
"If this turn needs visible output in the current channel, call `message` with `action=\"send\"` before ending the turn.",
|
|
1534
|
-
"Do not rely on normal final assistant text for visible delivery; final text is private to OpenClaw/Codex in this mode.",
|
|
1535
|
-
"If no visible channel response is needed, do not call `message(action=\"send\")`."
|
|
1536
|
-
].join(" ");
|
|
1531
|
+
if (params.sourceReplyDeliveryMode === "message_tool_only" && messageToolAvailable) return "To send a visible message, use the `message` tool.";
|
|
1537
1532
|
return "To send a visible reply, use the active Codex delivery path.";
|
|
1538
1533
|
}
|
|
1539
1534
|
function buildUserInput(params, promptText = params.prompt) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as isJsonObject } from "./protocol-
|
|
2
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
1
|
+
import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
|
|
2
|
+
import { r as formatCodexDisplayText } from "./command-formatters-BVBnEgyA.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { buildAgentHookContextChannelFields, callGatewayTool, embeddedAgentLog, formatApprovalDisplayPath, hasNativeHookRelayInvocation, invokeNativeHookRelay, runBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
@@ -9,7 +9,7 @@ const MAX_PLUGIN_APPROVAL_TITLE_LENGTH = 80;
|
|
|
9
9
|
const MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH = 256;
|
|
10
10
|
async function requestPluginApproval(params) {
|
|
11
11
|
const timeoutMs = DEFAULT_CODEX_APPROVAL_TIMEOUT_MS;
|
|
12
|
-
return callGatewayTool("plugin.approval.request", { timeoutMs:
|
|
12
|
+
return callGatewayTool("plugin.approval.request", { timeoutMs: 13e4 }, {
|
|
13
13
|
pluginId: "openclaw-codex-app-server",
|
|
14
14
|
title: truncateForGateway(params.title, MAX_PLUGIN_APPROVAL_TITLE_LENGTH),
|
|
15
15
|
description: truncateForGateway(params.description, MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH),
|
|
@@ -37,7 +37,7 @@ function approvalRequestExplicitlyUnavailable(result) {
|
|
|
37
37
|
return descriptor !== void 0 && "value" in descriptor && descriptor.value === null;
|
|
38
38
|
}
|
|
39
39
|
async function waitForPluginApprovalDecision(params) {
|
|
40
|
-
const waitPromise = callGatewayTool("plugin.approval.waitDecision", { timeoutMs:
|
|
40
|
+
const waitPromise = callGatewayTool("plugin.approval.waitDecision", { timeoutMs: 13e4 }, { id: params.approvalId });
|
|
41
41
|
if (!params.signal) return (await waitPromise)?.decision;
|
|
42
42
|
let onAbort;
|
|
43
43
|
const abortPromise = new Promise((_, reject) => {
|
|
@@ -807,6 +807,7 @@ const MCP_TOOL_APPROVAL_TOOL_PARAMS_DISPLAY_KEY = "tool_params_display";
|
|
|
807
807
|
const MCP_TOOL_APPROVAL_SOURCE_KEY = "source";
|
|
808
808
|
const MCP_TOOL_APPROVAL_CONNECTOR_SOURCE = "connector";
|
|
809
809
|
const CODEX_APPS_SERVER_NAME = "codex_apps";
|
|
810
|
+
const COMPUTER_USE_APPROVAL_TITLE = "Computer Use approval";
|
|
810
811
|
const PLUGIN_APP_ID_META_KEYS = [
|
|
811
812
|
"app_id",
|
|
812
813
|
"appId",
|
|
@@ -862,7 +863,7 @@ async function handleCodexAppServerElicitationRequest(params) {
|
|
|
862
863
|
}
|
|
863
864
|
return buildPluginPolicyElicitationResponse(pluginResolution.entry, requestParams);
|
|
864
865
|
}
|
|
865
|
-
const approvalPrompt = readBridgeableApprovalElicitation(requestParams);
|
|
866
|
+
const approvalPrompt = readComputerUseApprovalElicitation(requestParams, params.computerUseMcpServerName) ?? readBridgeableApprovalElicitation(requestParams);
|
|
866
867
|
if (!approvalPrompt) return;
|
|
867
868
|
const outcome = await requestPluginApprovalOutcome({
|
|
868
869
|
paramsForRun: params.paramsForRun,
|
|
@@ -1014,6 +1015,25 @@ function readBridgeableApprovalElicitation(requestParams) {
|
|
|
1014
1015
|
meta: requestParams["_meta"]
|
|
1015
1016
|
};
|
|
1016
1017
|
}
|
|
1018
|
+
function readComputerUseApprovalElicitation(requestParams, expectedServerName) {
|
|
1019
|
+
const serverName = readString(requestParams, "serverName");
|
|
1020
|
+
if (!serverName || !expectedServerName || serverName !== expectedServerName || readString(requestParams, "mode") !== "form" || !isJsonObject(requestParams?.requestedSchema)) return;
|
|
1021
|
+
const requestedSchema = requestParams.requestedSchema;
|
|
1022
|
+
if (readString(requestedSchema, "type") !== "object" || !isJsonObject(requestedSchema.properties)) return;
|
|
1023
|
+
const meta = isJsonObject(requestParams?.["_meta"]) ? requestParams["_meta"] : {};
|
|
1024
|
+
const title = sanitizeDisplayText(readString(requestParams, "message") ?? "") || COMPUTER_USE_APPROVAL_TITLE;
|
|
1025
|
+
return {
|
|
1026
|
+
title,
|
|
1027
|
+
description: buildApprovalDescription({
|
|
1028
|
+
title,
|
|
1029
|
+
meta,
|
|
1030
|
+
requestedSchema,
|
|
1031
|
+
serverName: sanitizeOptionalDisplayText(serverName)
|
|
1032
|
+
}),
|
|
1033
|
+
requestedSchema,
|
|
1034
|
+
meta
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1017
1037
|
function buildApprovalDescription(params) {
|
|
1018
1038
|
const connectorName = sanitizeOptionalDisplayText(readString(params.meta, MCP_TOOL_APPROVAL_CONNECTOR_NAME_KEY));
|
|
1019
1039
|
const toolTitle = sanitizeOptionalDisplayText(readString(params.meta, MCP_TOOL_APPROVAL_TOOL_TITLE_KEY));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.20-beta.1",
|
|
4
4
|
"description": "OpenClaw Codex harness and model provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@earendil-works/pi-coding-agent": "0.75.
|
|
12
|
-
"@openai/codex": "0.
|
|
11
|
+
"@earendil-works/pi-coding-agent": "0.75.3",
|
|
12
|
+
"@openai/codex": "0.132.0",
|
|
13
13
|
"ajv": "8.20.0",
|
|
14
14
|
"ws": "8.20.1",
|
|
15
15
|
"zod": "4.4.3"
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.5.1-beta.1"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.5.
|
|
30
|
+
"pluginApi": ">=2026.5.20-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.
|
|
33
|
+
"openclawVersion": "2026.5.20-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"release": {
|
|
36
36
|
"publishToClawHub": true,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"openclaw.plugin.json"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"openclaw": ">=2026.5.
|
|
48
|
+
"openclaw": ">=2026.5.20-beta.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|