@openclaw/codex 2026.6.33 → 2026.6.35
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/{app-server-policy-BaB2492Z.js → app-server-policy-UdM9fipd.js} +1 -1
- package/dist/{attempt-notifications-Dl3RWAT-.js → attempt-notifications-Bzk6P-cp.js} +1 -1
- package/dist/{command-handlers-bbSxpNAI.js → command-handlers-BH6JevGQ.js} +6 -6
- package/dist/{computer-use-B_iZKrBI.js → computer-use-XfHZnTBE.js} +1 -1
- package/dist/{conversation-binding-Ba3nVSYu.js → conversation-binding-DrIWS5rX.js} +4 -4
- package/dist/harness.js +2 -2
- package/dist/index.js +9 -9
- package/dist/{media-understanding-provider-S-u-JwTs.js → media-understanding-provider-5YQx83ng.js} +4 -4
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-CrrooS6N.js → models-B5oPkfmf.js} +1 -1
- package/dist/{plugin-app-cache-key-BwzTPSGU.js → plugin-app-cache-key-D5ckrLBm.js} +1 -1
- package/dist/{protocol-validators-B19q5BIX.js → protocol-validators-CB4mtyrs.js} +106 -12
- package/dist/{provider-J2nTGL8Q.js → provider-CojmGiaW.js} +51 -16
- package/dist/{provider-capabilities-B3pUz-8b.js → provider-capabilities-Cu8jJpp3.js} +2 -2
- package/dist/provider-catalog.js +72 -29
- package/dist/provider.js +2 -2
- package/dist/{run-attempt-CDCK3aeX.js → run-attempt-Do5QKTZ-.js} +130 -25
- package/dist/{side-question-DJ4g2wVk.js → side-question-DUp0Z5_n.js} +6 -6
- package/dist/{thread-lifecycle-DXrm-WWA.js → thread-lifecycle-BDghpA0C.js} +11 -5
- package/dist/{web-search-provider.runtime-3WDe3iwG.js → web-search-provider.runtime-D-v5Y41V.js} +2 -2
- package/npm-shrinkwrap.json +30 -30
- package/openclaw.plugin.json +1 -1
- package/package.json +5 -5
package/dist/provider-catalog.js
CHANGED
|
@@ -6,44 +6,85 @@ const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
|
6
6
|
/** Synthetic auth marker understood by Codex app-server runtime paths. */
|
|
7
7
|
const CODEX_APP_SERVER_AUTH_MARKER = "codex-app-server";
|
|
8
8
|
const DEFAULT_CONTEXT_WINDOW = 272e3;
|
|
9
|
+
const DEFAULT_RUNTIME_CONTEXT_TOKENS = 272e3;
|
|
9
10
|
const DEFAULT_MAX_TOKENS = 128e3;
|
|
11
|
+
const KNOWN_CONTEXT_WINDOW_BY_MODEL_ID = Object.freeze({
|
|
12
|
+
"gpt-5.6-sol": 372e3,
|
|
13
|
+
"gpt-5.6-terra": 372e3,
|
|
14
|
+
"gpt-5.6-luna": 372e3
|
|
15
|
+
});
|
|
10
16
|
/** Offline fallback catalog used when live app-server discovery is unavailable. */
|
|
11
|
-
const FALLBACK_CODEX_MODELS = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
const FALLBACK_CODEX_MODELS = [
|
|
18
|
+
{
|
|
19
|
+
id: "gpt-5.6-sol",
|
|
20
|
+
model: "gpt-5.6-sol",
|
|
21
|
+
displayName: "GPT-5.6 Sol",
|
|
22
|
+
description: "Latest frontier agentic coding model.",
|
|
23
|
+
isDefault: true,
|
|
24
|
+
contextWindow: 372e3,
|
|
25
|
+
inputModalities: ["text", "image"],
|
|
26
|
+
supportedReasoningEfforts: [
|
|
27
|
+
"low",
|
|
28
|
+
"medium",
|
|
29
|
+
"high",
|
|
30
|
+
"xhigh",
|
|
31
|
+
"max"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "gpt-5.6-luna",
|
|
36
|
+
model: "gpt-5.6-luna",
|
|
37
|
+
displayName: "GPT-5.6 Luna",
|
|
38
|
+
description: "High-throughput frontier agentic coding model.",
|
|
39
|
+
contextWindow: 372e3,
|
|
40
|
+
inputModalities: ["text", "image"],
|
|
41
|
+
supportedReasoningEfforts: [
|
|
42
|
+
"low",
|
|
43
|
+
"medium",
|
|
44
|
+
"high",
|
|
45
|
+
"xhigh",
|
|
46
|
+
"max"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "gpt-5.5",
|
|
51
|
+
model: "gpt-5.5",
|
|
52
|
+
displayName: "GPT-5.5",
|
|
53
|
+
description: "Previous frontier agentic coding model.",
|
|
54
|
+
inputModalities: ["text", "image"],
|
|
55
|
+
supportedReasoningEfforts: [
|
|
56
|
+
"low",
|
|
57
|
+
"medium",
|
|
58
|
+
"high",
|
|
59
|
+
"xhigh"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "gpt-5.4-mini",
|
|
64
|
+
model: "gpt-5.4-mini",
|
|
65
|
+
displayName: "GPT-5.4-Mini",
|
|
66
|
+
description: "Smaller frontier agentic coding model.",
|
|
67
|
+
inputModalities: ["text", "image"],
|
|
68
|
+
supportedReasoningEfforts: [
|
|
69
|
+
"low",
|
|
70
|
+
"medium",
|
|
71
|
+
"high",
|
|
72
|
+
"xhigh"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
];
|
|
37
76
|
/**
|
|
38
77
|
* Converts a Codex app-server model record into OpenClaw provider model config.
|
|
39
78
|
*/
|
|
40
79
|
function buildCodexModelDefinition(model) {
|
|
41
80
|
const id = model.id.trim() || model.model.trim();
|
|
81
|
+
const supportedReasoningEfforts = model.supportedReasoningEfforts;
|
|
82
|
+
const contextWindow = model.contextWindow ?? KNOWN_CONTEXT_WINDOW_BY_MODEL_ID[id] ?? DEFAULT_CONTEXT_WINDOW;
|
|
42
83
|
return {
|
|
43
84
|
id,
|
|
44
85
|
name: model.displayName?.trim() || id,
|
|
45
86
|
api: "openai-chatgpt-responses",
|
|
46
|
-
reasoning:
|
|
87
|
+
reasoning: supportedReasoningEfforts !== void 0 ? supportedReasoningEfforts.length > 0 : shouldDefaultToReasoningModel(id),
|
|
47
88
|
input: model.inputModalities.includes("image") ? ["text", "image"] : ["text"],
|
|
48
89
|
cost: {
|
|
49
90
|
input: 0,
|
|
@@ -51,10 +92,12 @@ function buildCodexModelDefinition(model) {
|
|
|
51
92
|
cacheRead: 0,
|
|
52
93
|
cacheWrite: 0
|
|
53
94
|
},
|
|
54
|
-
contextWindow
|
|
95
|
+
contextWindow,
|
|
96
|
+
contextTokens: Math.min(contextWindow, DEFAULT_RUNTIME_CONTEXT_TOKENS),
|
|
55
97
|
maxTokens: DEFAULT_MAX_TOKENS,
|
|
56
98
|
compat: {
|
|
57
|
-
supportsReasoningEffort:
|
|
99
|
+
...supportedReasoningEfforts !== void 0 ? { supportsReasoningEffort: supportedReasoningEfforts.length > 0 } : {},
|
|
100
|
+
...supportedReasoningEfforts && supportedReasoningEfforts.length > 0 ? { supportedReasoningEfforts: [...supportedReasoningEfforts] } : {},
|
|
58
101
|
supportsUsageInStreaming: true
|
|
59
102
|
}
|
|
60
103
|
};
|
package/dist/provider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildCodexProviderCatalog, r as
|
|
2
|
-
export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
|
|
1
|
+
import { a as readCodexSupportedReasoningEfforts, i as isModernCodexModel, n as buildCodexProviderCatalog, o as resolveCodexSupportedReasoningEffort, r as isMaxReasoningCodexModel, t as buildCodexProvider } from "./provider-CojmGiaW.js";
|
|
2
|
+
export { buildCodexProvider, buildCodexProviderCatalog, isMaxReasoningCodexModel, isModernCodexModel, readCodexSupportedReasoningEfforts, resolveCodexSupportedReasoningEffort };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { A as resolveCodexContextEngineProjectionReserveTokens, D as fitCodexProjectedContextForTurnStart, E as resolveCodexDynamicToolsLoadingForRuntime, H as readCodexNotificationTurnId, M as buildCodexPluginThreadConfigInputFingerprint, N as mergeCodexThreadConfigs, O as projectContextEngineAssemblyForCodex, P as shouldBuildCodexPluginThreadConfig, R as defaultCodexAppInventoryCache, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, a as buildDeveloperInstructions, b as sanitizeCodexHistoryImagePayloads, c as codexDynamicToolsFingerprint, f as resolveCodexAppServerThreadModelSelection, h as startOrResumeThread, i as buildContextEngineBinding, j as buildCodexPluginThreadConfig, k as resolveCodexContextEngineProjectionMaxChars, l as isContextEngineBindingCompatible, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, s as buildTurnStartParams, v as isCodexAppServerProfilerEnabled, z as describeCodexNotificationCorrelation } from "./thread-lifecycle-
|
|
3
|
-
import { C as readCodexNotificationItem, D as updateActiveTurnItemIds, E as shouldDisarmAssistantCompletionIdleWatch, S as isTurnNotification, T as readRawResponseToolCallId, _ as isRawToolOutputCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isRetryableErrorNotification, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawReasoningCompletionNotification, h as isRawFunctionToolOutputCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningItemCompletionNotification, w as readNotificationItemId, x as isTerminalTurnStatus, y as isReasoningProgressNotification } from "./attempt-notifications-
|
|
2
|
+
import { A as resolveCodexContextEngineProjectionReserveTokens, D as fitCodexProjectedContextForTurnStart, E as resolveCodexDynamicToolsLoadingForRuntime, H as readCodexNotificationTurnId, M as buildCodexPluginThreadConfigInputFingerprint, N as mergeCodexThreadConfigs, O as projectContextEngineAssemblyForCodex, P as shouldBuildCodexPluginThreadConfig, R as defaultCodexAppInventoryCache, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, a as buildDeveloperInstructions, b as sanitizeCodexHistoryImagePayloads, c as codexDynamicToolsFingerprint, f as resolveCodexAppServerThreadModelSelection, h as startOrResumeThread, i as buildContextEngineBinding, j as buildCodexPluginThreadConfig, k as resolveCodexContextEngineProjectionMaxChars, l as isContextEngineBindingCompatible, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, s as buildTurnStartParams, v as isCodexAppServerProfilerEnabled, z as describeCodexNotificationCorrelation } from "./thread-lifecycle-BDghpA0C.js";
|
|
3
|
+
import { C as readCodexNotificationItem, D as updateActiveTurnItemIds, E as shouldDisarmAssistantCompletionIdleWatch, S as isTurnNotification, T as readRawResponseToolCallId, _ as isRawToolOutputCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isRetryableErrorNotification, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawReasoningCompletionNotification, h as isRawFunctionToolOutputCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningItemCompletionNotification, w as readNotificationItemId, x as isTerminalTurnStatus, y as isReasoningProgressNotification } from "./attempt-notifications-Bzk6P-cp.js";
|
|
4
4
|
import { a as isCodexAppServerApprovalPolicyAllowedByRequirements, d as resolveCodexComputerUseConfig, f as resolveCodexModelBackedReviewerPolicyContext, g as withMcpElicitationsApprovalPolicy, h as shouldAutoApproveCodexAppServerApprovals, l as readCodexPluginConfig, m as resolveOpenClawExecPolicyForCodexAppServer, p as resolveCodexPluginsPolicy, s as isCodexSandboxExecServerEnabled, u as resolveCodexAppServerRuntimeOptions } from "./config-DfV7hMHu.js";
|
|
5
|
-
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-
|
|
6
|
-
import {
|
|
5
|
+
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-CB4mtyrs.js";
|
|
6
|
+
import { l as resolveCodexUsageLimitResetAtMs, s as formatCodexUsageLimitErrorMessage, u as shouldRefreshCodexRateLimitsForUsageLimitMessage } from "./provider-CojmGiaW.js";
|
|
7
7
|
import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, n as CodexAppServerRpcError, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-DsqoRGhJ.js";
|
|
8
8
|
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding, r as clearCodexAppServerBindingForThread } from "./session-binding-CP5b8iN1.js";
|
|
9
|
-
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-
|
|
10
|
-
import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-
|
|
9
|
+
import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-D5ckrLBm.js";
|
|
10
|
+
import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-UdM9fipd.js";
|
|
11
11
|
import { d as resolveCodexAppServerAuthAccountCacheKey, f as resolveCodexAppServerAuthProfileId, h as resolveCodexAppServerHomeDir, m as resolveCodexAppServerFallbackApiKeyCacheKey, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, s as retireSharedCodexAppServerClientIfCurrent, t as clearSharedCodexAppServerClientIfCurrent, u as refreshCodexAppServerAuthTokens } from "./shared-client-Ll9fWpy9.js";
|
|
12
12
|
import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-E-67xUhS.js";
|
|
13
|
-
import { A as resolveCodexAppServerExecutionCwd, B as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as emitDynamicToolErrorDiagnostic, D as createCodexDynamicToolBuildStageTracker, E as buildDynamicTools, F as shouldEnableCodexAppServerNativeToolSurface, G as resolveCodexTurnTerminalIdleTimeoutMs, H as resolveCodexStartupTimeoutMs, I as shouldRequireCodexSandboxExecServerEnvironment, K as withCodexStartupTimeout, L as shouldWarnCodexDynamicToolBuildStageSummary, M as resolveCodexExternalSandboxPolicyForOpenClawSandbox, N as resolveCodexMessageToolProvider, O as disableCodexPluginThreadConfig, P as resolveCodexSandboxEnvironmentSelection, S as toCodexDynamicToolProtocolResponse, T as emitDynamicToolTerminalDiagnostic, U as resolveCodexTurnAssistantCompletionIdleTimeoutMs, V as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, W as resolveCodexTurnCompletionIdleTimeoutMs, _ as resolveDynamicToolCallTimeoutMs, a as buildCodexNativeHookRelayConfig, b as shouldReleaseTurnAfterTerminalDynamicTool, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as isMatchingDynamicToolTerminalDiagnostic, h as isDynamicToolTerminalDiagnosticEvent, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexAppServerHookChannelId, k as formatCodexDynamicToolBuildStageSummary, l as resolveCodexNativeHookRelayTtlMs, m as hasPendingDynamicToolTerminalDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as handleDynamicToolCallWithTimeout, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as resolveTerminalDynamicToolBatchAction, w as emitDynamicToolStartedDiagnostic, x as toCodexDynamicToolProgressResponse, y as shouldBlockTerminalReleaseForNonTerminalDynamicToolResult, z as handleCodexAppServerApprovalRequest } from "./provider-capabilities-
|
|
14
|
-
import { t as ensureCodexComputerUse } from "./computer-use-
|
|
13
|
+
import { A as resolveCodexAppServerExecutionCwd, B as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as emitDynamicToolErrorDiagnostic, D as createCodexDynamicToolBuildStageTracker, E as buildDynamicTools, F as shouldEnableCodexAppServerNativeToolSurface, G as resolveCodexTurnTerminalIdleTimeoutMs, H as resolveCodexStartupTimeoutMs, I as shouldRequireCodexSandboxExecServerEnvironment, K as withCodexStartupTimeout, L as shouldWarnCodexDynamicToolBuildStageSummary, M as resolveCodexExternalSandboxPolicyForOpenClawSandbox, N as resolveCodexMessageToolProvider, O as disableCodexPluginThreadConfig, P as resolveCodexSandboxEnvironmentSelection, S as toCodexDynamicToolProtocolResponse, T as emitDynamicToolTerminalDiagnostic, U as resolveCodexTurnAssistantCompletionIdleTimeoutMs, V as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, W as resolveCodexTurnCompletionIdleTimeoutMs, _ as resolveDynamicToolCallTimeoutMs, a as buildCodexNativeHookRelayConfig, b as shouldReleaseTurnAfterTerminalDynamicTool, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as isMatchingDynamicToolTerminalDiagnostic, h as isDynamicToolTerminalDiagnosticEvent, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexAppServerHookChannelId, k as formatCodexDynamicToolBuildStageSummary, l as resolveCodexNativeHookRelayTtlMs, m as hasPendingDynamicToolTerminalDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as handleDynamicToolCallWithTimeout, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as resolveTerminalDynamicToolBatchAction, w as emitDynamicToolStartedDiagnostic, x as toCodexDynamicToolProgressResponse, y as shouldBlockTerminalReleaseForNonTerminalDynamicToolResult, z as handleCodexAppServerApprovalRequest } from "./provider-capabilities-Cu8jJpp3.js";
|
|
14
|
+
import { t as ensureCodexComputerUse } from "./computer-use-XfHZnTBE.js";
|
|
15
15
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
|
|
16
16
|
import fs from "node:fs/promises";
|
|
17
17
|
import path, { posix } from "node:path";
|
|
@@ -5501,7 +5501,14 @@ var CodexNativeSubagentTaskMirror = class {
|
|
|
5501
5501
|
this.handleThreadStatusChanged(params);
|
|
5502
5502
|
return;
|
|
5503
5503
|
}
|
|
5504
|
-
if (notification.method === "item/started" || notification.method === "item/completed")
|
|
5504
|
+
if (notification.method === "item/started" || notification.method === "item/completed") {
|
|
5505
|
+
const item = isJsonObject(params.item) ? params.item : void 0;
|
|
5506
|
+
if (notification.method === "item/completed" && item && readString$3(item, "type") === "subAgentActivity") {
|
|
5507
|
+
this.handleSubagentActivityItem(params);
|
|
5508
|
+
return;
|
|
5509
|
+
}
|
|
5510
|
+
this.handleCollabAgentItem(params);
|
|
5511
|
+
}
|
|
5505
5512
|
}
|
|
5506
5513
|
handleThreadStarted(params) {
|
|
5507
5514
|
const notification = readThreadStartedNotification(params);
|
|
@@ -5615,31 +5622,56 @@ var CodexNativeSubagentTaskMirror = class {
|
|
|
5615
5622
|
this.applyCollabAgentStatus(threadId, toolCallStatus, state?.message);
|
|
5616
5623
|
}
|
|
5617
5624
|
}
|
|
5625
|
+
handleSubagentActivityItem(params) {
|
|
5626
|
+
const item = isJsonObject(params.item) ? params.item : void 0;
|
|
5627
|
+
if (!item || readString$3(item, "type") !== "subAgentActivity" || readString$3(params, "threadId") !== this.params.parentThreadId) return;
|
|
5628
|
+
const threadId = trimOptional(readString$3(item, "agentThreadId"));
|
|
5629
|
+
if (!threadId || normalizeSubagentActivityKind(readString$3(item, "kind")) !== "started") return;
|
|
5630
|
+
const agentPath = trimOptional(readString$3(item, "agentPath"));
|
|
5631
|
+
const eventAt = this.now();
|
|
5632
|
+
this.createRunningTask({
|
|
5633
|
+
threadId,
|
|
5634
|
+
label: "Codex subagent",
|
|
5635
|
+
task: agentPath ? `Codex native subagent ${agentPath}` : "Codex native subagent",
|
|
5636
|
+
startedAt: eventAt,
|
|
5637
|
+
progressSummary: "Codex native subagent started."
|
|
5638
|
+
});
|
|
5639
|
+
}
|
|
5618
5640
|
createTaskFromCollabSpawnItem(threadId, item) {
|
|
5619
|
-
const normalizedThreadId = threadId.trim();
|
|
5620
|
-
if (!normalizedThreadId || this.mirroredThreadIds.has(normalizedThreadId)) return;
|
|
5621
|
-
this.mirroredThreadIds.add(normalizedThreadId);
|
|
5622
5641
|
const prompt = trimOptional(readString$3(item, "prompt"));
|
|
5623
|
-
const
|
|
5642
|
+
const eventAt = this.now();
|
|
5643
|
+
this.createRunningTask({
|
|
5644
|
+
threadId,
|
|
5645
|
+
label: "Codex subagent",
|
|
5646
|
+
task: prompt ?? "Codex native subagent",
|
|
5647
|
+
startedAt: eventAt,
|
|
5648
|
+
progressSummary: "Codex native subagent spawned."
|
|
5649
|
+
});
|
|
5650
|
+
}
|
|
5651
|
+
createRunningTask(params) {
|
|
5652
|
+
const threadId = params.threadId.trim();
|
|
5653
|
+
if (!threadId || this.mirroredThreadIds.has(threadId)) return;
|
|
5654
|
+
this.mirroredThreadIds.add(threadId);
|
|
5655
|
+
const runId = codexNativeSubagentRunId(threadId);
|
|
5624
5656
|
const createdAt = this.now();
|
|
5625
5657
|
if (!this.runtime.tryCreateRunningTaskRun({
|
|
5626
5658
|
sourceId: runId,
|
|
5627
5659
|
agentId: this.params.agentId,
|
|
5628
5660
|
runId,
|
|
5629
|
-
label:
|
|
5630
|
-
task:
|
|
5661
|
+
label: params.label,
|
|
5662
|
+
task: params.task,
|
|
5631
5663
|
notifyPolicy: "silent",
|
|
5632
5664
|
deliveryStatus: "not_applicable",
|
|
5633
5665
|
preferMetadata: true,
|
|
5634
|
-
startedAt:
|
|
5666
|
+
startedAt: params.startedAt,
|
|
5635
5667
|
lastEventAt: createdAt,
|
|
5636
|
-
progressSummary:
|
|
5668
|
+
progressSummary: params.progressSummary
|
|
5637
5669
|
})) {
|
|
5638
|
-
this.mirroredThreadIds.delete(
|
|
5639
|
-
this.failedMirrorThreadIds.add(
|
|
5670
|
+
this.mirroredThreadIds.delete(threadId);
|
|
5671
|
+
this.failedMirrorThreadIds.add(threadId);
|
|
5640
5672
|
return;
|
|
5641
5673
|
}
|
|
5642
|
-
this.failedMirrorThreadIds.delete(
|
|
5674
|
+
this.failedMirrorThreadIds.delete(threadId);
|
|
5643
5675
|
this.terminalRunIds.delete(runId);
|
|
5644
5676
|
this.authoritativeRunIds.delete(runId);
|
|
5645
5677
|
}
|
|
@@ -5761,6 +5793,9 @@ function readNullableString(value, key) {
|
|
|
5761
5793
|
function normalizeToolName$1(value) {
|
|
5762
5794
|
return value?.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
5763
5795
|
}
|
|
5796
|
+
function normalizeSubagentActivityKind(value) {
|
|
5797
|
+
return value?.replace(/[^a-z]/giu, "").toLowerCase() === "started" ? "started" : void 0;
|
|
5798
|
+
}
|
|
5764
5799
|
function normalizeCollabToolCallStatus(value) {
|
|
5765
5800
|
const key = value?.replace(/[^a-z0-9]/giu, "").toLowerCase();
|
|
5766
5801
|
if (key === "completed" || key === "succeeded" || key === "success") return "completed";
|
|
@@ -5842,6 +5877,7 @@ function registerCodexNativeSubagentMonitor(params) {
|
|
|
5842
5877
|
taskRuntimeScope: params.taskRuntimeScope,
|
|
5843
5878
|
agentId: params.agentId
|
|
5844
5879
|
});
|
|
5880
|
+
return monitor;
|
|
5845
5881
|
}
|
|
5846
5882
|
/** Tracks native subagent thread notifications, transcript completions, and task delivery. */
|
|
5847
5883
|
var CodexNativeSubagentMonitor = class {
|
|
@@ -5868,6 +5904,13 @@ var CodexNativeSubagentMonitor = class {
|
|
|
5868
5904
|
this.childThreadIdsByAgentPath.clear();
|
|
5869
5905
|
this.transcriptPathsByChildThreadId.clear();
|
|
5870
5906
|
}
|
|
5907
|
+
deferUntilParentSettles(parentThreadId, callback) {
|
|
5908
|
+
const normalizedParentThreadId = parentThreadId.trim();
|
|
5909
|
+
const state = this.parentStates.get(normalizedParentThreadId);
|
|
5910
|
+
if (!state || !this.hasUnsettledChildren(normalizedParentThreadId)) return false;
|
|
5911
|
+
state.deferredSettlement = callback;
|
|
5912
|
+
return true;
|
|
5913
|
+
}
|
|
5871
5914
|
configure(options) {
|
|
5872
5915
|
const codexHome = normalizeOptionalString(options.codexHome);
|
|
5873
5916
|
if (codexHome) this.codexHome = codexHome;
|
|
@@ -5905,10 +5948,29 @@ var CodexNativeSubagentMonitor = class {
|
|
|
5905
5948
|
error: formatErrorMessage(error)
|
|
5906
5949
|
});
|
|
5907
5950
|
}
|
|
5951
|
+
this.markChildTurnStarted(notification);
|
|
5952
|
+
await this.handleChildSystemError(notification);
|
|
5908
5953
|
this.captureChildAssistantMessage(notification);
|
|
5909
5954
|
await this.handleChildTurnCompletion(notification);
|
|
5910
5955
|
await this.handleCompletionNotification(notification);
|
|
5911
5956
|
}
|
|
5957
|
+
markChildTurnStarted(notification) {
|
|
5958
|
+
if (notification.method !== "turn/started") return;
|
|
5959
|
+
const childThreadId = readString$2(isJsonObject(notification.params) ? notification.params : void 0, "threadId")?.trim();
|
|
5960
|
+
const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
|
|
5961
|
+
if (childState) childState.settledWithoutCompletion = false;
|
|
5962
|
+
}
|
|
5963
|
+
async handleChildSystemError(notification) {
|
|
5964
|
+
if (notification.method !== "thread/status/changed") return;
|
|
5965
|
+
const params = isJsonObject(notification.params) ? notification.params : void 0;
|
|
5966
|
+
if (readString$2(isJsonObject(params?.status) ? params.status : void 0, "type") !== "systemError") return;
|
|
5967
|
+
const childThreadId = readString$2(params, "threadId")?.trim();
|
|
5968
|
+
const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
|
|
5969
|
+
if (childState) {
|
|
5970
|
+
childState.settledWithoutCompletion = true;
|
|
5971
|
+
await this.flushDeferredParentSettlements(childState.parentThreadId);
|
|
5972
|
+
}
|
|
5973
|
+
}
|
|
5912
5974
|
ensureParentTaskRuntime(state) {
|
|
5913
5975
|
if (state.taskRuntime || !state.requesterSessionKey || !state.taskRuntimeScope) return;
|
|
5914
5976
|
state.taskRuntime = this.runtime.createAgentHarnessTaskRuntime({
|
|
@@ -5945,6 +6007,12 @@ var CodexNativeSubagentMonitor = class {
|
|
|
5945
6007
|
const parentThreadId = item ? (readString$2(item, "senderThreadId") ?? readString$2(params, "threadId"))?.trim() : void 0;
|
|
5946
6008
|
const state = parentThreadId ? this.parentStates.get(parentThreadId) : void 0;
|
|
5947
6009
|
if (state && parentThreadId) {
|
|
6010
|
+
if (notification.method === "item/completed" && readString$2(item, "type") === "subAgentActivity") {
|
|
6011
|
+
const childThreadId = readString$2(item, "agentThreadId")?.trim();
|
|
6012
|
+
const agentPath = readString$2(item, "agentPath");
|
|
6013
|
+
if (childThreadId) this.registerChildThread(parentThreadId, childThreadId, agentPath === void 0 ? {} : { agentPath });
|
|
6014
|
+
return state;
|
|
6015
|
+
}
|
|
5948
6016
|
const childThreadIds = normalizeToolName(readString$2(item, "tool")) === "spawnagent" ? new Set([...readStringArray(item?.receiverThreadIds), ...readObjectStringKeys(item?.agentsStates)]) : new Set(readStringArray(item?.receiverThreadIds));
|
|
5949
6017
|
for (const childThreadId of childThreadIds) this.registerChildThread(parentThreadId, childThreadId);
|
|
5950
6018
|
}
|
|
@@ -6031,6 +6099,8 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6031
6099
|
if (childState && turn && readString$2(turn, "status") === "interrupted") {
|
|
6032
6100
|
const turnId = readString$2(turn, "id");
|
|
6033
6101
|
if (turnId) childState.assistantMessagesByTurn.delete(turnId);
|
|
6102
|
+
childState.settledWithoutCompletion = true;
|
|
6103
|
+
await this.flushDeferredParentSettlements(childState.parentThreadId);
|
|
6034
6104
|
return;
|
|
6035
6105
|
}
|
|
6036
6106
|
if (childState && turn) this.captureChildTurnAssistantMessages(childState, turn);
|
|
@@ -6084,7 +6154,10 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6084
6154
|
childState.noFinalCompletionFallbackTimer = void 0;
|
|
6085
6155
|
}
|
|
6086
6156
|
}
|
|
6087
|
-
if (!state.requesterSessionKey)
|
|
6157
|
+
if (!state.requesterSessionKey) {
|
|
6158
|
+
await this.flushDeferredParentSettlements(state.parentThreadId);
|
|
6159
|
+
return;
|
|
6160
|
+
}
|
|
6088
6161
|
const completionKey = buildCompletionDedupeKey(state.parentThreadId, completion);
|
|
6089
6162
|
if (state.deliveredCompletionKeys.has(completionKey)) return;
|
|
6090
6163
|
const deliveryState = childState ?? this.ensureChildState(state.parentThreadId, completion.childThreadId);
|
|
@@ -6137,6 +6210,7 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6137
6210
|
});
|
|
6138
6211
|
} finally {
|
|
6139
6212
|
childState.deliveringCompletionKey = void 0;
|
|
6213
|
+
await this.flushDeferredParentSettlements(state.parentThreadId);
|
|
6140
6214
|
}
|
|
6141
6215
|
}
|
|
6142
6216
|
markCompletionDeliveryPending(completion, error) {
|
|
@@ -6169,6 +6243,28 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6169
6243
|
}, delayMs);
|
|
6170
6244
|
unrefTimer(childState.completionDeliveryTimer);
|
|
6171
6245
|
}
|
|
6246
|
+
hasUnsettledChildren(parentThreadId) {
|
|
6247
|
+
for (const childState of this.childStates.values()) if (childState.parentThreadId === parentThreadId && (childState.pendingCompletion !== void 0 || childState.deliveringCompletionKey !== void 0 || !childState.transcriptTerminal && !childState.settledWithoutCompletion)) return true;
|
|
6248
|
+
return false;
|
|
6249
|
+
}
|
|
6250
|
+
async flushDeferredParentSettlements(parentThreadId) {
|
|
6251
|
+
if (this.hasUnsettledChildren(parentThreadId)) return;
|
|
6252
|
+
const state = this.parentStates.get(parentThreadId);
|
|
6253
|
+
const callback = state?.deferredSettlement;
|
|
6254
|
+
if (!state || !callback) return;
|
|
6255
|
+
state.deferredSettlement = void 0;
|
|
6256
|
+
await this.runDeferredParentSettlement(parentThreadId, callback);
|
|
6257
|
+
}
|
|
6258
|
+
async runDeferredParentSettlement(parentThreadId, callback) {
|
|
6259
|
+
try {
|
|
6260
|
+
await callback();
|
|
6261
|
+
} catch (error) {
|
|
6262
|
+
embeddedAgentLog.warn("Failed to finish deferred Codex app-server cleanup", {
|
|
6263
|
+
parentThreadId,
|
|
6264
|
+
error: formatErrorMessage(error)
|
|
6265
|
+
});
|
|
6266
|
+
}
|
|
6267
|
+
}
|
|
6172
6268
|
finalizeCompletionTask(completion, eventAt) {
|
|
6173
6269
|
const taskRuntime = this.getTaskRuntimeForChild(completion.childThreadId);
|
|
6174
6270
|
if (!taskRuntime) return;
|
|
@@ -6209,7 +6305,8 @@ var CodexNativeSubagentMonitor = class {
|
|
|
6209
6305
|
assistantMessagesByTurn: /* @__PURE__ */ new Map(),
|
|
6210
6306
|
transcriptPollAttempt: 0,
|
|
6211
6307
|
transcriptTerminal: false,
|
|
6212
|
-
completionDeliveryAttempt: 0
|
|
6308
|
+
completionDeliveryAttempt: 0,
|
|
6309
|
+
settledWithoutCompletion: false
|
|
6213
6310
|
};
|
|
6214
6311
|
this.childStates.set(normalizedChildThreadId, childState);
|
|
6215
6312
|
}
|
|
@@ -8151,6 +8248,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8151
8248
|
trajectoryEndRecorded = true;
|
|
8152
8249
|
};
|
|
8153
8250
|
let nativeHookRelay;
|
|
8251
|
+
const nativeSubagentMonitorRef = {};
|
|
8154
8252
|
let releaseSharedClientLease;
|
|
8155
8253
|
let sharedCodexClientRetiredForOneShotCleanup = false;
|
|
8156
8254
|
const releaseSharedClientLeaseOnce = () => {
|
|
@@ -8665,7 +8763,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
8665
8763
|
return notificationQueue;
|
|
8666
8764
|
};
|
|
8667
8765
|
const nativeSubagentCodexHome = appServer.start.transport === "stdio" ? appServer.start.env?.CODEX_HOME ?? resolveCodexAppServerHomeDir(agentDir) : void 0;
|
|
8668
|
-
registerCodexNativeSubagentMonitor({
|
|
8766
|
+
nativeSubagentMonitorRef.current = registerCodexNativeSubagentMonitor({
|
|
8669
8767
|
client,
|
|
8670
8768
|
parentThreadId: thread.threadId,
|
|
8671
8769
|
requesterSessionKey: params.sessionKey,
|
|
@@ -9536,7 +9634,14 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
9536
9634
|
}
|
|
9537
9635
|
});
|
|
9538
9636
|
if (!timedOut && !runAbortController.signal.aborted) await steeringQueueRef.current?.flushPending();
|
|
9539
|
-
|
|
9637
|
+
const yieldedOneShotCleanupDeferred = !timedOut && params.cleanupBundleMcpOnRunEnd === true && yieldDetected && nativeSubagentMonitorRef.current?.deferUntilParentSettles(thread.threadId, async () => {
|
|
9638
|
+
await unsubscribeCodexThreadBestEffort(client, {
|
|
9639
|
+
threadId: thread.threadId,
|
|
9640
|
+
timeoutMs: 5e3
|
|
9641
|
+
});
|
|
9642
|
+
await releaseSharedClientLeaseAndRetireOneShotClient();
|
|
9643
|
+
});
|
|
9644
|
+
if (!timedOut && !yieldedOneShotCleanupDeferred) await unsubscribeCodexThreadBestEffort(client, {
|
|
9540
9645
|
threadId: thread.threadId,
|
|
9541
9646
|
timeoutMs: CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS
|
|
9542
9647
|
});
|
|
@@ -9545,7 +9650,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
9545
9650
|
notificationCleanup();
|
|
9546
9651
|
requestCleanup();
|
|
9547
9652
|
closeCleanup?.();
|
|
9548
|
-
await releaseSharedClientLeaseAndRetireOneShotClient();
|
|
9653
|
+
if (!yieldedOneShotCleanupDeferred) await releaseSharedClientLeaseAndRetireOneShotClient();
|
|
9549
9654
|
if (nativeHookRelay) if (shouldDelayNativeHookRelayUnregister) scheduleCodexNativeHookRelayUnregister({
|
|
9550
9655
|
relay: nativeHookRelay,
|
|
9551
9656
|
hookTimeoutSec: options.nativeHookRelay?.hookTimeoutSec
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { H as readCodexNotificationTurnId, N as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-
|
|
2
|
+
import { H as readCodexNotificationTurnId, N as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-BDghpA0C.js";
|
|
3
3
|
import { f as resolveCodexModelBackedReviewerPolicyContext, h as shouldAutoApproveCodexAppServerApprovals, l as readCodexPluginConfig, m as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, u as resolveCodexAppServerRuntimeOptions } from "./config-DfV7hMHu.js";
|
|
4
|
-
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-
|
|
5
|
-
import {
|
|
4
|
+
import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-CB4mtyrs.js";
|
|
5
|
+
import { a as readCodexSupportedReasoningEfforts, s as formatCodexUsageLimitErrorMessage } from "./provider-CojmGiaW.js";
|
|
6
6
|
import { i as isCodexAppServerApprovalRequest } from "./client-DsqoRGhJ.js";
|
|
7
7
|
import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-CP5b8iN1.js";
|
|
8
|
-
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-
|
|
8
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-UdM9fipd.js";
|
|
9
9
|
import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-Ll9fWpy9.js";
|
|
10
10
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.js";
|
|
11
|
-
import { C as emitDynamicToolErrorDiagnostic, F as shouldEnableCodexAppServerNativeToolSurface, N as resolveCodexMessageToolProvider, R as filterToolsForVisionInputs, T as emitDynamicToolTerminalDiagnostic, _ as resolveDynamicToolCallTimeoutMs, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as handleDynamicToolCallWithTimeout, r as CODEX_NATIVE_HOOK_RELAY_EVENTS, w as emitDynamicToolStartedDiagnostic, z as handleCodexAppServerApprovalRequest } from "./provider-capabilities-
|
|
11
|
+
import { C as emitDynamicToolErrorDiagnostic, F as shouldEnableCodexAppServerNativeToolSurface, N as resolveCodexMessageToolProvider, R as filterToolsForVisionInputs, T as emitDynamicToolTerminalDiagnostic, _ as resolveDynamicToolCallTimeoutMs, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as handleDynamicToolCallWithTimeout, r as CODEX_NATIVE_HOOK_RELAY_EVENTS, w as emitDynamicToolStartedDiagnostic, z as handleCodexAppServerApprovalRequest } from "./provider-capabilities-Cu8jJpp3.js";
|
|
12
12
|
import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
|
|
13
13
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
14
14
|
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -291,7 +291,7 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
|
|
|
291
291
|
timeoutMs: appServer.requestTimeoutMs,
|
|
292
292
|
signal: params.opts?.abortSignal
|
|
293
293
|
});
|
|
294
|
-
const effort = resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model);
|
|
294
|
+
const effort = resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model, readCodexSupportedReasoningEfforts(params.runtimeModel?.compat));
|
|
295
295
|
turnId = assertCodexTurnStartResponse(await client.request("turn/start", {
|
|
296
296
|
threadId: childThreadId,
|
|
297
297
|
input: [{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
|
|
2
2
|
import { i as codexSandboxPolicyForTurn, p as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-DfV7hMHu.js";
|
|
3
|
-
import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-
|
|
3
|
+
import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-CB4mtyrs.js";
|
|
4
4
|
import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
|
|
5
|
-
import {
|
|
5
|
+
import { a as readCodexSupportedReasoningEfforts, i as isModernCodexModel, o as resolveCodexSupportedReasoningEffort, r as isMaxReasoningCodexModel } from "./provider-CojmGiaW.js";
|
|
6
6
|
import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-DsqoRGhJ.js";
|
|
7
7
|
import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-CP5b8iN1.js";
|
|
8
8
|
import "node:fs/promises";
|
|
@@ -2082,7 +2082,7 @@ function buildTurnStartParams(params, options) {
|
|
|
2082
2082
|
model: modelSelection.model,
|
|
2083
2083
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
2084
2084
|
...options.appServer.serviceTier !== void 0 ? { serviceTier: options.appServer.serviceTier } : {},
|
|
2085
|
-
effort: resolveReasoningEffort(params.thinkLevel, modelSelection.model),
|
|
2085
|
+
effort: resolveReasoningEffort(params.thinkLevel, modelSelection.model, readCodexSupportedReasoningEfforts(params.model?.compat)),
|
|
2086
2086
|
...options.environmentSelection ? { environments: options.environmentSelection } : {},
|
|
2087
2087
|
collaborationMode: buildTurnCollaborationMode(params, {
|
|
2088
2088
|
model: modelSelection.model,
|
|
@@ -2108,7 +2108,7 @@ function buildTurnCollaborationMode(params, options = {}) {
|
|
|
2108
2108
|
mode: "default",
|
|
2109
2109
|
settings: {
|
|
2110
2110
|
model,
|
|
2111
|
-
reasoning_effort: resolveReasoningEffort(params.thinkLevel, model),
|
|
2111
|
+
reasoning_effort: resolveReasoningEffort(params.thinkLevel, model, readCodexSupportedReasoningEfforts(params.model?.compat)),
|
|
2112
2112
|
developer_instructions: buildTurnScopedCollaborationInstructions(params, options)
|
|
2113
2113
|
}
|
|
2114
2114
|
};
|
|
@@ -2259,9 +2259,15 @@ function resolveCodexAppServerModelProvider(params) {
|
|
|
2259
2259
|
if (isCodexAppServerNativeAuthProfile(params) && normalizedLower === "openai") return;
|
|
2260
2260
|
return normalizedLower === "openai" ? "openai" : normalized;
|
|
2261
2261
|
}
|
|
2262
|
-
function resolveReasoningEffort(thinkLevel, modelId) {
|
|
2262
|
+
function resolveReasoningEffort(thinkLevel, modelId, supportedReasoningEfforts) {
|
|
2263
|
+
if (thinkLevel === "off" || thinkLevel === "adaptive") return null;
|
|
2264
|
+
if (supportedReasoningEfforts) return resolveCodexSupportedReasoningEffort({
|
|
2265
|
+
requested: thinkLevel,
|
|
2266
|
+
supportedReasoningEfforts
|
|
2267
|
+
}) ?? null;
|
|
2263
2268
|
if (thinkLevel === "minimal") return isModernCodexModel(modelId) ? "low" : "minimal";
|
|
2264
2269
|
if (thinkLevel === "low" || thinkLevel === "medium" || thinkLevel === "high" || thinkLevel === "xhigh") return thinkLevel;
|
|
2270
|
+
if (thinkLevel === "max" && isMaxReasoningCodexModel(modelId)) return "max";
|
|
2265
2271
|
return null;
|
|
2266
2272
|
}
|
|
2267
2273
|
//#endregion
|
package/dist/{web-search-provider.runtime-3WDe3iwG.js → web-search-provider.runtime-D-v5Y41V.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
|
|
2
|
-
import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-
|
|
3
|
-
import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-
|
|
2
|
+
import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-BDghpA0C.js";
|
|
3
|
+
import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-5YQx83ng.js";
|
|
4
4
|
import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
5
|
//#region extensions/codex/src/web-search-provider.runtime.ts
|
|
6
6
|
async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
|