@openclaw/codex 2026.9.1-beta.1 → 2026.9.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/api.js +5 -6
- package/dist/{attempt-client-cleanup-bfsmcQ6m.js → attempt-client-cleanup-DYHcRQAa.js} +31 -45
- package/dist/attempt-context-DmQUNWwT.js +634 -0
- package/dist/{auth-binding-B4FfbcCg.js → auth-binding-Ds_QVm-X.js} +18 -3
- package/dist/{binding-connection-BMvPX73o.js → binding-connection-E6uDsPlx.js} +2 -2
- package/dist/{bounded-turn-B7iBUcuP.js → bounded-turn-wzJrwKKe.js} +15 -20
- package/dist/{capabilities-BRMh0aIq.js → capabilities-dIjNVCYH.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-DEsIufkt.js → command-formatters-CLHhEB1Q.js} +5 -4
- package/dist/{command-handlers-D_-1_qRp.js → command-handlers-CTGb2csu.js} +124 -101
- package/dist/{compact-BglNFZrQ.js → compact-_t0HQrUS.js} +38 -29
- package/dist/{config-giW8X0QA.js → config-BhmfC1s6.js} +294 -282
- package/dist/{context-compaction-activity-BOeJf7yo.js → context-compaction-activity-CMla5FPJ.js} +4 -1
- package/dist/{conversation-binding-data-CW2GuupV.js → conversation-binding-data-BiodpIzq.js} +2 -1
- package/dist/doctor-contract-api.js +143 -12
- package/dist/{dynamic-tools-Dnlfa--w.js → dynamic-tools-BU9tmlYm.js} +599 -655
- package/dist/{effective-mcp-catalog-CTeGrnfO.js → effective-mcp-catalog-DzYBW4h1.js} +2 -2
- package/dist/{event-projector-assistant-message-C5-Ds8mA.js → event-projector-assistant-message-DHRFXKbS.js} +4 -4
- package/dist/{event-projector-usage-Bk1I90Bg.js → event-projector-usage-C5mcrGjp.js} +15 -148
- package/dist/{harness-Csz0F-DK.js → harness-DXVZ5II5.js} +42 -52
- package/dist/harness.js +1 -1
- package/dist/index.js +458 -404
- package/dist/{isolated-completion-Cv6FqygM.js → isolated-completion-kg9kv4iH.js} +4 -4
- package/dist/launch-args-RXQwn8zV.js +90 -0
- package/dist/{managed-binary-DFYK4DWq.js → managed-binary-4-Vjz5GH.js} +14 -9
- package/dist/media-understanding-provider.js +1 -1
- package/dist/model-catalog-CUM68Hkl.js +101 -0
- package/dist/{models-TS3HBU-q.js → models-sYnEc0gd.js} +25 -28
- package/dist/{native-subagent-monitor-4Mfq2HDs.js → native-subagent-monitor-CnH147jH.js} +55 -115
- package/dist/{node-exec-server.runtime-BpWqJO1V.js → node-exec-server.runtime-CstNHCmC.js} +9 -6
- package/dist/{plugin-approval-roundtrip-bUm777tR.js → plugin-approval-roundtrip-CNe-Xrjx.js} +30 -3
- package/dist/{plugin-marketplace-discovery-B9DvaAG-.js → plugin-marketplace-discovery-CfFlKqDl.js} +15 -14
- package/dist/{plugin-metadata-cache-CTCT3w5L.js → plugin-metadata-cache-BFrPhb2c.js} +6 -6
- package/dist/provider-capabilities-DW5p4k9w.js +101 -0
- package/dist/{rate-limits-C5_D8Gmb.js → rate-limits-CawQJfUS.js} +3 -2
- package/dist/{sandbox-guard-kuWTn9C5.js → request-DYAI5FQE.js} +195 -2
- package/dist/{run-attempt-DYc0QCBF.js → run-attempt-D1hJO4fX.js} +828 -2100
- package/dist/{runtime-artifact-BvyT1uyd.js → runtime-artifact-C3jVimFn.js} +21 -14
- package/dist/{session-binding-Bcynfd-_.js → session-binding-BHuTCRZQ.js} +198 -127
- package/dist/{session-catalog-DaLKVtpH.js → session-catalog-yyvTWFOw.js} +564 -408
- package/dist/{session-cli-DMc4oS2w.js → session-cli-CmFEXMAM.js} +1 -1
- package/dist/session-history-C5J1AKzG.js +87 -0
- package/dist/session-initialization-BeWzjGiR.js +74 -0
- package/dist/{session-permission-policy-BrNH1bjy.js → session-permission-policy-DeWVTCMj.js} +2 -2
- package/dist/session-retirement-BujDjXVF.js +97 -0
- package/dist/{session-upstream-marker-BIkusb95.js → session-upstream-marker-C351-5Qw.js} +19 -4
- package/dist/settled-turn-context-D3SNWtUn.js +268 -0
- package/dist/settled-turn-finalizer-BVJx4yoc.js +104 -0
- package/dist/{shared-client-DKz23hHY.js → shared-client-DxcfF9KX.js} +3480 -679
- package/dist/{side-question-DjA_jsNe.js → side-question-BTZAII4l.js} +108 -70
- package/dist/{thread-lifecycle-L7oEkTlq.js → thread-lifecycle-DAcEJ_Om.js} +2188 -1915
- package/dist/{thread-ownership-DZeuKH1j.js → thread-ownership-zGokd8i1.js} +25 -14
- package/dist/thread-policy-g4KbJPzp.js +54 -0
- package/dist/{plugin-app-cache-key-C1CAdfcP.js → thread-resume-C7pyVKeW.js} +59 -7
- package/dist/{transcript-mirror-DsCMWBca.js → transcript-mirror-DTUxFWa_.js} +79 -17
- package/dist/transport-stdio-CyPldczm.js +726 -0
- package/dist/{upstream-prompt-provenance-CFmsKwr9.js → upstream-prompt-provenance-LphB8slG.js} +8 -4
- package/dist/upstream-session-fork-CYlBIGVt.js +966 -0
- package/dist/{usage-ROIaW3wo.js → usage-Bj-rrzkR.js} +3 -3
- package/dist/{web-search-provider.runtime-ClaNPV7N.js → web-search-provider.runtime-D2FWSK4w.js} +3 -3
- package/openclaw.plugin.json +1 -30
- package/package.json +6 -6
- package/dist/command-rpc-CCeCkf_v.js +0 -90
- package/dist/incognito-session-ET_ufDH-.js +0 -2
- package/dist/model-catalog-i9rNBthX.js +0 -48
- package/dist/protocol-validators-VeJxxJ0U.js +0 -2421
- package/dist/request-DXXGHko0.js +0 -157
- package/dist/session-catalog-home-id-BNwAJ9D7.js +0 -18
- package/dist/session-retirement-CcNC3YSY.js +0 -36
- package/dist/settled-turn-finalizer-Dc3ApjU4.js +0 -328
- package/dist/thread-resume-BE9qNEW0.js +0 -30
- package/dist/transport-stdio-DhoGy33Z.js +0 -99
- package/dist/upstream-session-fork-DlaHxSLC.js +0 -326
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
4
|
-
import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-
|
|
1
|
+
import { $t as isJsonObject, Wt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-DxcfF9KX.js";
|
|
2
|
+
import { E as readCodexPluginConfig, r as resolveCodexAppServerHomeScope } from "./config-BhmfC1s6.js";
|
|
3
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-wzJrwKKe.js";
|
|
4
|
+
import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-DHRFXKbS.js";
|
|
5
5
|
//#region extensions/codex/src/app-server/isolated-completion.ts
|
|
6
6
|
const ISOLATED_PASSIVE_ITEM_TYPES = /* @__PURE__ */ new Set(["agentMessage", "reasoning"]);
|
|
7
7
|
function assertIsolatedCompletionItems(items, prompt) {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region extensions/codex/src/app-server/launch-args.ts
|
|
2
|
+
const CODEX_VALUE_OPTIONS = /* @__PURE__ */ new Set([
|
|
3
|
+
"-m",
|
|
4
|
+
"--model",
|
|
5
|
+
"--local-provider",
|
|
6
|
+
"-p",
|
|
7
|
+
"--profile",
|
|
8
|
+
"-s",
|
|
9
|
+
"--sandbox",
|
|
10
|
+
"-a",
|
|
11
|
+
"--ask-for-approval",
|
|
12
|
+
"-C",
|
|
13
|
+
"--cd",
|
|
14
|
+
"--add-dir",
|
|
15
|
+
"--remote",
|
|
16
|
+
"--remote-auth-token-env",
|
|
17
|
+
"-c",
|
|
18
|
+
"--config",
|
|
19
|
+
"--enable",
|
|
20
|
+
"--disable",
|
|
21
|
+
"--listen",
|
|
22
|
+
"--code-mode-host",
|
|
23
|
+
"--ws-auth",
|
|
24
|
+
"--ws-token-file",
|
|
25
|
+
"--ws-token-sha256",
|
|
26
|
+
"--ws-shared-secret-file",
|
|
27
|
+
"--ws-issuer",
|
|
28
|
+
"--ws-audience",
|
|
29
|
+
"--ws-max-clock-skew-seconds"
|
|
30
|
+
]);
|
|
31
|
+
/** One tokenization owner for launch, turn policy, reviewer trust, and private turns. */
|
|
32
|
+
function readCodexArgs(args) {
|
|
33
|
+
const tokens = [];
|
|
34
|
+
let nativeSubcommand = false;
|
|
35
|
+
let end = 0;
|
|
36
|
+
for (const [index, arg] of args.entries()) {
|
|
37
|
+
if (index < end) continue;
|
|
38
|
+
end = index + 1;
|
|
39
|
+
const attached = /^(--[^=]+)=([\s\S]*)$/u.exec(arg) ?? /^(-[cmpisaC])=?([\s\S]+)$/u.exec(arg);
|
|
40
|
+
const name = attached?.[1] ?? arg;
|
|
41
|
+
let value = attached?.[2];
|
|
42
|
+
if (name === "-i" || name === "--image") while (args[end]?.startsWith("-") === false) end += 1;
|
|
43
|
+
else if (!attached && CODEX_VALUE_OPTIONS.has(name)) {
|
|
44
|
+
value = args[end];
|
|
45
|
+
if (value !== void 0) end += 1;
|
|
46
|
+
}
|
|
47
|
+
tokens.push({
|
|
48
|
+
index,
|
|
49
|
+
end,
|
|
50
|
+
name,
|
|
51
|
+
value
|
|
52
|
+
});
|
|
53
|
+
if (name === "app-server") nativeSubcommand = true;
|
|
54
|
+
if (name === "--" && nativeSubcommand) break;
|
|
55
|
+
}
|
|
56
|
+
return tokens;
|
|
57
|
+
}
|
|
58
|
+
function readCodexAppServerConfigOptions(args) {
|
|
59
|
+
return readCodexArgs(args).filter(({ name }) => name === "-c" || name === "--config" || name === "-p" || name === "--profile");
|
|
60
|
+
}
|
|
61
|
+
/** The stdio proxy forwards to an external server; it does not own that runtime. */
|
|
62
|
+
function isCodexAppServerProxyLaunch(args) {
|
|
63
|
+
const tokens = readCodexArgs(args);
|
|
64
|
+
const server = tokens.findLastIndex(({ name }) => name === "app-server");
|
|
65
|
+
return server >= 0 && tokens.slice(server + 1).find(({ name }) => !name.startsWith("-"))?.name === "proxy";
|
|
66
|
+
}
|
|
67
|
+
/** Keeps Codex overrides in one CLI scope without rewriting raw TOML or wrapper prefixes. */
|
|
68
|
+
function normalizeCodexAppServerArgs(rawArgs, enforcedOverride) {
|
|
69
|
+
const tokens = readCodexArgs(rawArgs);
|
|
70
|
+
const subcommandIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? -1;
|
|
71
|
+
const prefix = subcommandIndex < 0 ? [...rawArgs] : rawArgs.slice(0, subcommandIndex);
|
|
72
|
+
const suffix = [];
|
|
73
|
+
if (subcommandIndex >= 0) for (const token of tokens) {
|
|
74
|
+
if (token.index <= subcommandIndex) continue;
|
|
75
|
+
if (token.name === "--") {
|
|
76
|
+
suffix.push(...rawArgs.slice(token.index));
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
(token.name === "-c" || token.name === "--config" ? prefix : suffix).push(...rawArgs.slice(token.index, token.end));
|
|
80
|
+
}
|
|
81
|
+
if (enforcedOverride && !(prefix.at(-2) === "-c" && prefix.at(-1) === enforcedOverride)) prefix.push("-c", enforcedOverride);
|
|
82
|
+
const normalized = subcommandIndex < 0 ? prefix : [
|
|
83
|
+
...prefix,
|
|
84
|
+
"app-server",
|
|
85
|
+
...suffix
|
|
86
|
+
];
|
|
87
|
+
return normalized.length === rawArgs.length && normalized.every((arg, index) => arg === rawArgs[index]) ? rawArgs : normalized;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { normalizeCodexAppServerArgs as n, readCodexAppServerConfigOptions as r, isCodexAppServerProxyLaunch as t };
|
|
@@ -46,7 +46,7 @@ function resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath(params = {}
|
|
|
46
46
|
* Version and package pins for the managed Codex app-server runtime.
|
|
47
47
|
*/
|
|
48
48
|
/** Exact Codex app-server version shipped by the OpenClaw Codex bridge. */
|
|
49
|
-
const CODEX_APP_SERVER_VERSION = "0.
|
|
49
|
+
const CODEX_APP_SERVER_VERSION = "0.152.1";
|
|
50
50
|
/** Inclusive runtime compatibility floor for external app-server binaries. */
|
|
51
51
|
const MIN_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.149.0";
|
|
52
52
|
/** npm package name for the managed Codex app-server binary. */
|
|
@@ -91,12 +91,16 @@ function resolveManagedCodexNativeCommand(command, options = {}) {
|
|
|
91
91
|
if (!packageRoot) return;
|
|
92
92
|
const resolvePackageJson = options.resolvePackageJson ?? resolvePackageJsonFromRoot;
|
|
93
93
|
const pathExists = options.pathExists ?? existsSync;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
const packageJsonPath = resolvePackageJson(target.packageName, packageRoot) ?? resolvePackageJson("@openai/codex", packageRoot);
|
|
95
|
+
if (!packageJsonPath) return;
|
|
96
|
+
const candidate = path.join(path.dirname(packageJsonPath), "vendor", target.triple, "bin", platform === "win32" ? "codex.exe" : "codex");
|
|
97
|
+
return pathExists(candidate) ? candidate : void 0;
|
|
98
|
+
}
|
|
99
|
+
/** Recognizes only the official npm entrypoint, not arbitrary configured wrappers. */
|
|
100
|
+
function resolvePackagedCodexNativeCommand(entrypoint) {
|
|
101
|
+
const packageRoot = path.dirname(path.dirname(entrypoint));
|
|
102
|
+
if (path.basename(packageRoot) !== "codex" || path.basename(path.dirname(packageRoot)) !== "@openai" || path.relative(packageRoot, entrypoint) !== path.join("bin", "codex.js")) return;
|
|
103
|
+
return resolveManagedCodexNativeCommand(entrypoint);
|
|
100
104
|
}
|
|
101
105
|
/** Returns whether a command is one of the standard macOS desktop app executables. */
|
|
102
106
|
function isManagedCodexDesktopCommand(command, platform = process.platform) {
|
|
@@ -147,7 +151,8 @@ function resolveCodexNativeTarget(platform, arch) {
|
|
|
147
151
|
}
|
|
148
152
|
function resolvePackageJsonFromRoot(packageName, root) {
|
|
149
153
|
try {
|
|
150
|
-
|
|
154
|
+
const manifestPath = realpathSync(path.join(root, "package.json"));
|
|
155
|
+
return createRequire(manifestPath).resolve(`${packageName}/package.json`);
|
|
151
156
|
} catch {
|
|
152
157
|
return;
|
|
153
158
|
}
|
|
@@ -245,4 +250,4 @@ async function commandPathExists(filePath, platform) {
|
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
//#endregion
|
|
248
|
-
export {
|
|
253
|
+
export { setManagedCodexPluginRoot as a, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as c, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as d, resolvePackagedCodexNativeCommand as i, resolveMacOSDesktopCodexAppPathCandidates as l, resolveManagedCodexAppServerStartOptions as n, CODEX_APP_SERVER_VERSION as o, resolveManagedCodexNativeCommand as r, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexBundledMarketplaceCandidates as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
1
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-wzJrwKKe.js";
|
|
2
2
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
4
4
|
//#region extensions/codex/media-understanding-provider.ts
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { r as buildCodexRuntimeModelParams } from "./harness-DXVZ5II5.js";
|
|
2
|
+
import { $t as isJsonObject, r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-DxcfF9KX.js";
|
|
3
|
+
import { E as readCodexPluginConfig, i as resolveCodexAppServerRuntimeOptions } from "./config-BhmfC1s6.js";
|
|
4
|
+
import { t as listAllCodexAppServerModels } from "./models-sYnEc0gd.js";
|
|
5
|
+
import { o as withCodexAppServerJsonClient } from "./request-DYAI5FQE.js";
|
|
6
|
+
//#region extensions/codex/src/app-server/model-catalog.ts
|
|
7
|
+
const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 2500;
|
|
8
|
+
const INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
9
|
+
"text",
|
|
10
|
+
"image",
|
|
11
|
+
"audio",
|
|
12
|
+
"video",
|
|
13
|
+
"document"
|
|
14
|
+
]);
|
|
15
|
+
function isModelInputType(value) {
|
|
16
|
+
return INPUT_TYPES.has(value);
|
|
17
|
+
}
|
|
18
|
+
function codexAppServerModelsToCatalogEntries(models, runtime) {
|
|
19
|
+
return models.map((model, providerOrder) => {
|
|
20
|
+
const input = model.inputModalities.filter(isModelInputType);
|
|
21
|
+
const runtimeParams = buildCodexRuntimeModelParams(model.id, model.model);
|
|
22
|
+
return {
|
|
23
|
+
provider: "openai",
|
|
24
|
+
id: model.id,
|
|
25
|
+
name: model.displayName ?? model.id,
|
|
26
|
+
providerOrder,
|
|
27
|
+
nativeRuntime: runtime,
|
|
28
|
+
reasoning: model.supportedReasoningEfforts.length > 0,
|
|
29
|
+
...input.length > 0 ? { input } : {},
|
|
30
|
+
...runtimeParams ? { params: runtimeParams } : {},
|
|
31
|
+
compat: {
|
|
32
|
+
supportsReasoningEffort: model.supportedReasoningEfforts.length > 0,
|
|
33
|
+
supportedReasoningEfforts: model.supportedReasoningEfforts
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** One harness registration owns its observations; none travel with worker snapshots. */
|
|
39
|
+
function createCodexAppServerModelCatalog(runtime) {
|
|
40
|
+
const scopes = /* @__PURE__ */ new WeakMap();
|
|
41
|
+
const scopeKey = (params) => JSON.stringify([
|
|
42
|
+
params.agentId,
|
|
43
|
+
params.agentDir,
|
|
44
|
+
params.workspaceDir
|
|
45
|
+
]);
|
|
46
|
+
let disposed = false;
|
|
47
|
+
return {
|
|
48
|
+
dispose() {
|
|
49
|
+
disposed = true;
|
|
50
|
+
},
|
|
51
|
+
read(params, pluginConfig) {
|
|
52
|
+
const observation = scopes.get(params.config)?.get(scopeKey(params));
|
|
53
|
+
return !disposed && params.provider === "openai" && observation !== void 0 && observation.pluginConfig === pluginConfig && observation.models?.has(params.modelId) && observation.accountType && observation.isCurrent?.() ? { accountType: observation.accountType } : void 0;
|
|
54
|
+
},
|
|
55
|
+
async load(params, pluginConfig) {
|
|
56
|
+
if (disposed) return [];
|
|
57
|
+
let observations = scopes.get(params.config);
|
|
58
|
+
if (!observations) {
|
|
59
|
+
observations = /* @__PURE__ */ new Map();
|
|
60
|
+
scopes.set(params.config, observations);
|
|
61
|
+
}
|
|
62
|
+
const key = scopeKey(params);
|
|
63
|
+
const observation = { pluginConfig };
|
|
64
|
+
observations.set(key, observation);
|
|
65
|
+
const discovery = readCodexPluginConfig(pluginConfig).discovery;
|
|
66
|
+
if (discovery?.enabled === false) return [];
|
|
67
|
+
const { start } = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
68
|
+
const timeoutMs = discovery?.timeoutMs ?? DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS;
|
|
69
|
+
const result = await withCodexAppServerJsonClient({
|
|
70
|
+
startOptions: start,
|
|
71
|
+
config: params.config,
|
|
72
|
+
agentDir: params.agentDir,
|
|
73
|
+
timeoutMs
|
|
74
|
+
}, async (request, client) => {
|
|
75
|
+
const isCurrent = captureSharedCodexAppServerCatalogLifetime(client);
|
|
76
|
+
const models = (await listAllCodexAppServerModels({
|
|
77
|
+
request,
|
|
78
|
+
limit: 100,
|
|
79
|
+
includeHidden: true
|
|
80
|
+
})).models.filter((model) => !model.hidden || params.configuredModelRefs?.some((ref) => ref.provider === "openai" && ref.model === model.id));
|
|
81
|
+
const account = await request({
|
|
82
|
+
method: "account/read",
|
|
83
|
+
requestParams: { refreshToken: false }
|
|
84
|
+
});
|
|
85
|
+
const observedType = isJsonObject(account.account) ? account.account.type : void 0;
|
|
86
|
+
return {
|
|
87
|
+
models,
|
|
88
|
+
isCurrent,
|
|
89
|
+
accountType: account.requiresOpenaiAuth === true ? observedType === "apiKey" || observedType === "chatgpt" ? observedType : void 0 : void 0
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
if (disposed || observations.get(key) !== observation || !result.isCurrent()) return [];
|
|
93
|
+
observation.models = new Set(result.models.map((model) => model.id));
|
|
94
|
+
observation.accountType = result.accountType;
|
|
95
|
+
observation.isCurrent = result.isCurrent;
|
|
96
|
+
return codexAppServerModelsToCatalogEntries(result.models, runtime);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { createCodexAppServerModelCatalog };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as assertCodexModelListResponse } from "./shared-client-DxcfF9KX.js";
|
|
2
2
|
import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/models.ts
|
|
4
4
|
/**
|
|
@@ -7,22 +7,18 @@ import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/stri
|
|
|
7
7
|
*/
|
|
8
8
|
/** Lists one Codex app-server model page using the configured auth/client options. */
|
|
9
9
|
async function listCodexAppServerModels(options = {}) {
|
|
10
|
-
return await
|
|
11
|
-
...options,
|
|
12
|
-
timeoutMs
|
|
13
|
-
}));
|
|
10
|
+
return await withCodexAppServerModelRequest(options, async (request) => requestModelListPage(request, options));
|
|
14
11
|
}
|
|
15
12
|
/** Walks Codex app-server model pages until exhaustion or the max-page guard. */
|
|
16
13
|
async function listAllCodexAppServerModels(options = {}) {
|
|
17
14
|
const maxPages = normalizeMaxPages(options.maxPages);
|
|
18
|
-
return await
|
|
15
|
+
return await withCodexAppServerModelRequest(options, async (request) => {
|
|
19
16
|
const models = [];
|
|
20
17
|
let cursor = options.cursor;
|
|
21
18
|
let nextCursor;
|
|
22
19
|
for (let page = 0; page < maxPages; page += 1) {
|
|
23
|
-
const result = await requestModelListPage(
|
|
20
|
+
const result = await requestModelListPage(request, {
|
|
24
21
|
...options,
|
|
25
|
-
timeoutMs,
|
|
26
22
|
cursor
|
|
27
23
|
});
|
|
28
24
|
models.push(...result.models);
|
|
@@ -37,18 +33,13 @@ async function listAllCodexAppServerModels(options = {}) {
|
|
|
37
33
|
};
|
|
38
34
|
});
|
|
39
35
|
}
|
|
40
|
-
async function
|
|
36
|
+
async function withCodexAppServerModelRequest(options, run) {
|
|
37
|
+
if (options.request) return await run(options.request);
|
|
41
38
|
const timeoutMs = options.timeoutMs ?? 2500;
|
|
42
39
|
const useSharedClient = options.sharedClient !== false;
|
|
43
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
timeoutMs,
|
|
47
|
-
authProfileId: options.authProfileId,
|
|
48
|
-
authRequirement: options.authRequirement,
|
|
49
|
-
agentDir: options.agentDir,
|
|
50
|
-
config: options.config
|
|
51
|
-
}) : await createIsolatedCodexAppServerClient({
|
|
40
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DxcfF9KX.js").then((n) => n.x);
|
|
41
|
+
const { requestCodexAppServerClientJson } = await import("./request-DYAI5FQE.js").then((n) => n.a);
|
|
42
|
+
const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
|
|
52
43
|
startOptions: options.startOptions,
|
|
53
44
|
timeoutMs,
|
|
54
45
|
authProfileId: options.authProfileId,
|
|
@@ -57,21 +48,26 @@ async function withCodexAppServerModelClient(options, run) {
|
|
|
57
48
|
config: options.config
|
|
58
49
|
});
|
|
59
50
|
try {
|
|
60
|
-
return await run({
|
|
51
|
+
return await run((request) => requestCodexAppServerClientJson({
|
|
52
|
+
...request,
|
|
61
53
|
client,
|
|
62
|
-
timeoutMs
|
|
63
|
-
|
|
54
|
+
timeoutMs,
|
|
55
|
+
config: options.config
|
|
56
|
+
}));
|
|
64
57
|
} finally {
|
|
65
58
|
if (useSharedClient) releaseLeasedSharedCodexAppServerClient(client);
|
|
66
59
|
else client.close();
|
|
67
60
|
}
|
|
68
61
|
}
|
|
69
|
-
async function requestModelListPage(
|
|
70
|
-
return readModelListResult(await
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
async function requestModelListPage(request, options) {
|
|
63
|
+
return readModelListResult(await request({
|
|
64
|
+
method: "model/list",
|
|
65
|
+
requestParams: {
|
|
66
|
+
limit: options.limit ?? null,
|
|
67
|
+
cursor: options.cursor ?? null,
|
|
68
|
+
includeHidden: options.includeHidden ?? null
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
75
71
|
}
|
|
76
72
|
/** Parses a raw Codex app-server model/list response into OpenClaw's normalized shape. */
|
|
77
73
|
function readModelListResult(value) {
|
|
@@ -101,7 +97,8 @@ function readCodexModel(value) {
|
|
|
101
97
|
};
|
|
102
98
|
}
|
|
103
99
|
function readReasoningEfforts(value) {
|
|
104
|
-
|
|
100
|
+
const efforts = value.map((entry) => normalizeOptionalString(entry.reasoningEffort)).filter((entry) => entry !== void 0);
|
|
101
|
+
return uniqueStrings(efforts);
|
|
105
102
|
}
|
|
106
103
|
function normalizeMaxPages(value) {
|
|
107
104
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : 20;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as
|
|
3
|
-
import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-
|
|
4
|
-
import { n as sanitizeCodexHistoryImagePayloads } from "./image-payload-sanitizer-CnfoUPCE.js";
|
|
1
|
+
import { $t as isJsonObject, At as retainCodexAppServerLiveThread, kt as releaseCodexAppServerLiveThread, xt as claimCodexAppServerLiveThread } from "./shared-client-DxcfF9KX.js";
|
|
2
|
+
import { A as shouldRecordNativeToolTranscript, C as isSideEffectingNativeToolItem, D as itemTitle, E as itemStatus, F as readHookOutputEntries, I as readItem, N as normalizeOptionalString$1, R as readNonEmptyString, S as isNonSuccessItemStatus, T as itemName, V as readNullableString$1, j as shouldSynthesizeToolProgressForItem, w as itemKind, x as isMutatingNativeToolItem, y as auditNativeToolTerminalStatus, z as readNonEmptyStringArray } from "./attempt-client-cleanup-DYHcRQAa.js";
|
|
3
|
+
import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.js";
|
|
5
4
|
import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.js";
|
|
6
|
-
import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-
|
|
5
|
+
import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-CNe-Xrjx.js";
|
|
6
|
+
import { n as readCodexMirroredSessionHistoryMessages } from "./session-history-C5J1AKzG.js";
|
|
7
7
|
import { asFiniteNumber, asNonArrayRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
import fs from "node:fs/promises";
|
|
9
8
|
import path from "node:path";
|
|
10
9
|
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
11
10
|
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, embeddedAgentLog, emitAgentEvent, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, runAgentHarnessAfterToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
|
-
import { getSessionEntry, parseSqliteSessionFileMarker, resolveTranscriptSessionKeyBySessionId } from "openclaw/plugin-sdk/session-store-runtime";
|
|
13
11
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
14
12
|
import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
15
|
-
import { readCodexSessionTranscriptEventsBeforeAdmission } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
16
|
-
import { readSessionTranscriptEvents } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
17
13
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
18
|
-
import { buildSessionContext, migrateSessionEntries, parseSessionEntries } from "openclaw/plugin-sdk/agent-sessions";
|
|
19
14
|
import { createAgentHarnessTaskRuntime, deliverAgentHarnessTaskCompletion, isDurableAgentHarnessCompletionDelivery } from "openclaw/plugin-sdk/agent-harness-task-runtime";
|
|
20
15
|
//#region extensions/codex/src/app-server/event-projector-tool-output.ts
|
|
21
16
|
const TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 1e4;
|
|
@@ -114,7 +109,8 @@ function appendBoundedToolTranscriptText(currentPrefix, delta, originalLength) {
|
|
|
114
109
|
};
|
|
115
110
|
const textBudget = TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - notice.length;
|
|
116
111
|
const remaining = Math.max(0, textBudget - currentPrefix.length);
|
|
117
|
-
const
|
|
112
|
+
const prefix = remaining > 0 ? `${currentPrefix}${truncateUtf16Safe(delta, remaining)}` : currentPrefix;
|
|
113
|
+
const rawPrefix = truncateUtf16Safe(prefix, textBudget);
|
|
118
114
|
return {
|
|
119
115
|
text: `${rawPrefix}${notice}`,
|
|
120
116
|
rawPrefix
|
|
@@ -127,7 +123,8 @@ function truncateToolTranscriptText(text, originalLength = text.length) {
|
|
|
127
123
|
if (originalLength <= 1e4 && text.length <= 1e4) return text;
|
|
128
124
|
const notice = toolTranscriptTruncationNotice(originalLength);
|
|
129
125
|
if (notice.length >= 1e4) return notice.slice(1, 10001);
|
|
130
|
-
|
|
126
|
+
const textBudget = TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - notice.length;
|
|
127
|
+
return `${truncateUtf16Safe(text, textBudget)}${notice}`;
|
|
131
128
|
}
|
|
132
129
|
function formatToolSummary(toolName, meta) {
|
|
133
130
|
const trimmedMeta = meta?.trim();
|
|
@@ -570,7 +567,7 @@ var CodexToolProgressProjection = class {
|
|
|
570
567
|
const args = itemToolArgs(item);
|
|
571
568
|
if (!toolName || !shouldEmitTranscriptToolProgress(toolName, args)) return;
|
|
572
569
|
this.resultSummaryItemIds.add(item.id);
|
|
573
|
-
const meta = this.
|
|
570
|
+
const meta = this.shouldIncludeFormattedMeta(isCommandBearingToolItem(item, args)) ? itemMeta(item, this.toolProgressDetailMode()) : void 0;
|
|
574
571
|
this.emitToolResultMessage({
|
|
575
572
|
itemId: item.id,
|
|
576
573
|
text: formatToolSummary(toolName, meta)
|
|
@@ -582,9 +579,10 @@ var CodexToolProgressProjection = class {
|
|
|
582
579
|
const toolName = itemName(item);
|
|
583
580
|
const output = itemOutputText(item, this.output.textByItem);
|
|
584
581
|
if (!toolName || !output || !shouldEmitTranscriptToolProgress(toolName, itemToolArgs(item))) return;
|
|
582
|
+
const meta = this.shouldIncludeFormattedMeta(isCommandBearingToolItem(item, itemToolArgs(item))) ? itemMeta(item, this.toolProgressDetailMode()) : void 0;
|
|
585
583
|
this.emitToolResultMessage({
|
|
586
584
|
itemId: item.id,
|
|
587
|
-
text: formatToolOutput(toolName,
|
|
585
|
+
text: formatToolOutput(toolName, meta, output),
|
|
588
586
|
finalOutput: true,
|
|
589
587
|
isError: isNonSuccessItemStatus(itemStatus(item))
|
|
590
588
|
});
|
|
@@ -643,6 +641,7 @@ var CodexToolProgressProjection = class {
|
|
|
643
641
|
try {
|
|
644
642
|
Promise.resolve(this.params.onToolResult?.({
|
|
645
643
|
text,
|
|
644
|
+
...(this.params.messageChannel || this.params.messageProvider) && { channelData: { openclawToolProgressId: params.itemId } },
|
|
646
645
|
...params.isError === true ? { isError: true } : {}
|
|
647
646
|
})).catch(() => {});
|
|
648
647
|
} catch {}
|
|
@@ -653,11 +652,15 @@ var CodexToolProgressProjection = class {
|
|
|
653
652
|
shouldEmitToolOutput() {
|
|
654
653
|
return typeof this.params.shouldEmitToolOutput === "function" ? this.params.shouldEmitToolOutput() : this.params.verboseLevel === "full";
|
|
655
654
|
}
|
|
655
|
+
shouldIncludeFormattedMeta(commandBearing) {
|
|
656
|
+
const channel = this.params.messageChannel ?? this.params.messageProvider;
|
|
657
|
+
return !commandBearing || !channel && this.shouldEmitToolOutput();
|
|
658
|
+
}
|
|
656
659
|
emitTranscriptToolCallProgress(params) {
|
|
657
660
|
if (!shouldEmitTranscriptToolProgress(params.name, params.arguments)) return;
|
|
658
661
|
this.transcriptProgressCallIds.add(params.id);
|
|
659
662
|
const args = normalizeToolTranscriptArguments(params.arguments);
|
|
660
|
-
const meta = this.
|
|
663
|
+
const meta = this.shouldIncludeFormattedMeta(isCodexCommandBearingToolCall(params.name, args)) ? inferToolMetaFromArgs(params.name, args, { detailMode: this.toolProgressDetailMode() }) : void 0;
|
|
661
664
|
if (!this.params.onToolResult || !this.shouldEmitToolResult() || this.resultSummaryItemIds.has(params.id) || this.resultOutputStreamedItemIds.has(params.id)) return;
|
|
662
665
|
this.resultSummaryItemIds.add(params.id);
|
|
663
666
|
this.emitToolResultMessage({
|
|
@@ -717,85 +720,6 @@ var CodexToolProgressProjection = class {
|
|
|
717
720
|
}
|
|
718
721
|
};
|
|
719
722
|
//#endregion
|
|
720
|
-
//#region extensions/codex/src/app-server/session-history.ts
|
|
721
|
-
/**
|
|
722
|
-
* Reads OpenClaw session history for Codex transcript mirroring and sanitizes
|
|
723
|
-
* image payloads before replaying messages into the app-server projector.
|
|
724
|
-
*/
|
|
725
|
-
function isMissingFileError(error) {
|
|
726
|
-
return Boolean(error && typeof error === "object" && "code" in error && error.code === "ENOENT");
|
|
727
|
-
}
|
|
728
|
-
/** Returns sanitized session-context messages for a Codex mirrored session file. */
|
|
729
|
-
async function readCodexMirroredSessionHistoryMessages(target, admission) {
|
|
730
|
-
try {
|
|
731
|
-
const entries = await readCodexMirroredSessionEntries(target, admission);
|
|
732
|
-
if (entries.length === 0) return [];
|
|
733
|
-
const firstEntry = entries[0];
|
|
734
|
-
if (firstEntry?.type !== "session") return [];
|
|
735
|
-
if (typeof firstEntry.id !== "string") return;
|
|
736
|
-
if (firstEntry.id !== target.sessionId) return [];
|
|
737
|
-
migrateSessionEntries(entries);
|
|
738
|
-
return sanitizeCodexHistoryImagePayloads(buildSessionContext(entries.filter((entry) => {
|
|
739
|
-
return entry !== null && typeof entry === "object" && !Array.isArray(entry) && entry.type !== "session";
|
|
740
|
-
})).messages, "codex mirrored history");
|
|
741
|
-
} catch (error) {
|
|
742
|
-
if (isMissingFileError(error)) return [];
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
async function readCodexMirroredSessionEntries(target, admission) {
|
|
747
|
-
if (target.sessionTarget) {
|
|
748
|
-
const { agentId, sessionId, sessionKey, storePath } = target.sessionTarget;
|
|
749
|
-
if (!agentId || !sessionId || !sessionKey || !storePath || sessionId !== target.sessionId || target.agentId !== void 0 && agentId !== target.agentId || target.sessionKey !== void 0 && sessionKey !== target.sessionKey) return [];
|
|
750
|
-
const transcriptTarget = {
|
|
751
|
-
agentId,
|
|
752
|
-
sessionId,
|
|
753
|
-
sessionKey,
|
|
754
|
-
storePath
|
|
755
|
-
};
|
|
756
|
-
return await (admission ? readCodexSessionTranscriptEventsBeforeAdmission(transcriptTarget, admission) : readSessionTranscriptEvents(transcriptTarget));
|
|
757
|
-
}
|
|
758
|
-
const sqliteMarker = parseSqliteSessionFileMarker(target.sessionFile);
|
|
759
|
-
if (sqliteMarker) {
|
|
760
|
-
if (sqliteMarker.sessionId !== target.sessionId || target.agentId !== void 0 && sqliteMarker.agentId !== target.agentId) return [];
|
|
761
|
-
const sessionKey = resolveSqliteMarkerSessionKey(target, sqliteMarker);
|
|
762
|
-
if (!sessionKey) return [];
|
|
763
|
-
const transcriptTarget = {
|
|
764
|
-
agentId: sqliteMarker.agentId,
|
|
765
|
-
sessionId: sqliteMarker.sessionId,
|
|
766
|
-
sessionKey,
|
|
767
|
-
storePath: sqliteMarker.storePath
|
|
768
|
-
};
|
|
769
|
-
return await (admission ? readCodexSessionTranscriptEventsBeforeAdmission(transcriptTarget, admission) : readSessionTranscriptEvents(transcriptTarget));
|
|
770
|
-
}
|
|
771
|
-
if (admission) {
|
|
772
|
-
if (admission.sessionId !== target.sessionId || target.agentId !== void 0 && admission.agentId !== target.agentId || target.sessionKey !== void 0 && admission.sessionKey !== target.sessionKey) return [];
|
|
773
|
-
return await readCodexSessionTranscriptEventsBeforeAdmission({
|
|
774
|
-
agentId: admission.agentId,
|
|
775
|
-
sessionId: admission.sessionId,
|
|
776
|
-
sessionKey: admission.sessionKey,
|
|
777
|
-
storePath: admission.storePath
|
|
778
|
-
}, admission);
|
|
779
|
-
}
|
|
780
|
-
return parseSessionEntries(await fs.readFile(target.sessionFile, "utf-8"));
|
|
781
|
-
}
|
|
782
|
-
function resolveSqliteMarkerSessionKey(target, marker) {
|
|
783
|
-
const explicitSessionKey = target.sessionKey?.trim();
|
|
784
|
-
if (explicitSessionKey) {
|
|
785
|
-
const explicitEntry = getSessionEntry({
|
|
786
|
-
agentId: marker.agentId,
|
|
787
|
-
sessionKey: explicitSessionKey,
|
|
788
|
-
storePath: marker.storePath
|
|
789
|
-
});
|
|
790
|
-
if (explicitEntry) return explicitEntry.sessionId === marker.sessionId ? explicitSessionKey : void 0;
|
|
791
|
-
}
|
|
792
|
-
return resolveTranscriptSessionKeyBySessionId({
|
|
793
|
-
agentId: marker.agentId,
|
|
794
|
-
sessionId: marker.sessionId,
|
|
795
|
-
storePath: marker.storePath
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
//#endregion
|
|
799
723
|
//#region extensions/codex/src/app-server/event-projector-tool-transcript.ts
|
|
800
724
|
const ZERO_USAGE = {
|
|
801
725
|
input: 0,
|
|
@@ -866,6 +790,7 @@ var CodexToolTranscriptProjection = class {
|
|
|
866
790
|
this.nativeMcpAppResultDetailsAttempted = /* @__PURE__ */ new Set();
|
|
867
791
|
this.approvalReviewsByCallId = /* @__PURE__ */ new Map();
|
|
868
792
|
this.rawNativeToolOutputByCallId = /* @__PURE__ */ new Map();
|
|
793
|
+
this.pendingRawPatchOutputIds = /* @__PURE__ */ new Set();
|
|
869
794
|
this.codeModeNativePatchInputsByCallId = /* @__PURE__ */ new Map();
|
|
870
795
|
}
|
|
871
796
|
get transcriptMessages() {
|
|
@@ -969,14 +894,18 @@ var CodexToolTranscriptProjection = class {
|
|
|
969
894
|
} catch {
|
|
970
895
|
return;
|
|
971
896
|
}
|
|
972
|
-
if (args)
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
897
|
+
if (args) {
|
|
898
|
+
this.pendingRawPatchOutputIds.add(callId);
|
|
899
|
+
this.recordToolCall({
|
|
900
|
+
id: callId,
|
|
901
|
+
name: "apply_patch",
|
|
902
|
+
arguments: args
|
|
903
|
+
});
|
|
904
|
+
}
|
|
977
905
|
return;
|
|
978
906
|
}
|
|
979
907
|
if (type !== "custom_tool_call_output" && type !== "function_call_output" || this.namesById.get(callId) !== "apply_patch" && !this.codeModeNativePatchInputsByCallId.has(callId)) return;
|
|
908
|
+
this.pendingRawPatchOutputIds.delete(callId);
|
|
980
909
|
const text = typeof item.output === "string" ? item.output : Array.isArray(item.output) ? collectDynamicToolContentText(item.output) : "";
|
|
981
910
|
if (!text.trim()) return;
|
|
982
911
|
const codeModePatchInput = this.codeModeNativePatchInputsByCallId.get(callId);
|
|
@@ -1168,13 +1097,20 @@ var CodexToolTranscriptProjection = class {
|
|
|
1168
1097
|
this.callIds.add(params.id);
|
|
1169
1098
|
this.namesById.set(params.id, params.name);
|
|
1170
1099
|
this.progress.recordTranscriptCall(params);
|
|
1171
|
-
|
|
1100
|
+
const message = attachCodexMirrorIdentity(this.createToolCallMessage(params), `${this.turnId}:tool:${params.id}:call`);
|
|
1101
|
+
this.messages.push(message);
|
|
1102
|
+
this.options.checkpointMessage?.({ read: () => message });
|
|
1172
1103
|
}
|
|
1173
1104
|
recordToolResult(params) {
|
|
1174
1105
|
if (!params.id || !params.name || this.resultIds.has(params.id)) return;
|
|
1175
1106
|
this.resultIds.add(params.id);
|
|
1176
1107
|
this.progress.recordTranscriptResult(params);
|
|
1177
|
-
|
|
1108
|
+
const message = attachCodexMirrorIdentity(this.createToolResultMessage(params), `${this.turnId}:tool:${params.id}:result`);
|
|
1109
|
+
this.messages.push(message);
|
|
1110
|
+
this.options.checkpointMessage?.({
|
|
1111
|
+
read: () => message,
|
|
1112
|
+
ready: () => !this.pendingRawPatchOutputIds.has(params.id)
|
|
1113
|
+
});
|
|
1178
1114
|
}
|
|
1179
1115
|
recordMissingToolError(missingTranscriptIds, missingTrajectoryIds) {
|
|
1180
1116
|
const firstMissingId = missingTranscriptIds.find((id) => Boolean(this.namesById.get(id))) ?? missingTrajectoryIds.find((id) => Boolean(this.trajectoryNamesById.get(id) ?? this.namesById.get(id)));
|
|
@@ -1288,6 +1224,7 @@ function normalizeApprovalReviewStatus(status) {
|
|
|
1288
1224
|
return status === "inProgress" ? "in_progress" : status === "timedOut" ? "timed_out" : status;
|
|
1289
1225
|
}
|
|
1290
1226
|
const GUARDIAN_TIMEOUT_WARNING = "Automatic approval review timed out while evaluating the requested approval.";
|
|
1227
|
+
const LOG_ONLY_CODEX_WARNING_PATTERNS = [/^Configured service tier `[^`\r\n]+` is not advertised as supported for model `[^`\r\n]+` and will be omitted from requests\.$/, /^Code Mode is enabled in configuration, but model `[^`\r\n]+` does not advertise Code Mode support\. This may degrade model performance\. Disable `features\.code_mode` and `features\.code_mode_only`, or select a model whose metadata enables Code Mode\.$/];
|
|
1291
1228
|
function projectNormalizedToolItem(params) {
|
|
1292
1229
|
const { item } = params;
|
|
1293
1230
|
if (!item || !shouldSynthesizeToolProgressForItem(item)) return;
|
|
@@ -1429,7 +1366,8 @@ var CodexEventProjection = class {
|
|
|
1429
1366
|
}
|
|
1430
1367
|
handleWarning(params) {
|
|
1431
1368
|
const message = [readStringField(params, "summary") ?? readStringField(params, "message"), readStringField(params, "details")].filter(Boolean).join("\n");
|
|
1432
|
-
if (message)
|
|
1369
|
+
if (LOG_ONLY_CODEX_WARNING_PATTERNS.some((pattern) => pattern.test(message))) embeddedAgentLog.warn(message);
|
|
1370
|
+
else if (message) this.emitAgentEvent({
|
|
1433
1371
|
stream: "notice",
|
|
1434
1372
|
data: {
|
|
1435
1373
|
phase: "warning",
|
|
@@ -2347,19 +2285,21 @@ var Monitor = class {
|
|
|
2347
2285
|
if (childState && !childState.terminal) this.emitChildTaskActivity(notification, childState);
|
|
2348
2286
|
this.captureChildAssistantMessage(notification);
|
|
2349
2287
|
await this.handleChildTurnCompletion(notification);
|
|
2350
|
-
if (notification.method === "thread/status/changed" && threadId && threadStatus)
|
|
2351
|
-
if (
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2288
|
+
if (notification.method === "thread/status/changed" && threadId && threadStatus) {
|
|
2289
|
+
if (threadStatus !== "systemerror") {
|
|
2290
|
+
if (childState) this.clearSystemErrorFallback(childState);
|
|
2291
|
+
} else {
|
|
2292
|
+
if (childState) {
|
|
2293
|
+
this.resumeChild(childState, { scheduleRecovery: false });
|
|
2294
|
+
this.setRecoveryFallback(childState, systemErrorFallbackCompletion(childState.childThreadId), this.now());
|
|
2295
|
+
}
|
|
2296
|
+
this.reconcileChildThread(threadId).catch((error) => {
|
|
2297
|
+
this.logRecoveryFailure(threadId, error);
|
|
2298
|
+
return false;
|
|
2299
|
+
}).then((reconciled) => {
|
|
2300
|
+
if (!reconciled && childState && this.childStates.get(threadId) === childState) this.scheduleRecoveryPoll(childState);
|
|
2301
|
+
});
|
|
2356
2302
|
}
|
|
2357
|
-
this.reconcileChildThread(threadId).catch((error) => {
|
|
2358
|
-
this.logRecoveryFailure(threadId, error);
|
|
2359
|
-
return false;
|
|
2360
|
-
}).then((reconciled) => {
|
|
2361
|
-
if (!reconciled && childState && this.childStates.get(threadId) === childState) this.scheduleRecoveryPoll(childState);
|
|
2362
|
-
});
|
|
2363
2303
|
}
|
|
2364
2304
|
await this.handleCompletionNotification(notification);
|
|
2365
2305
|
}
|
|
@@ -3379,4 +3319,4 @@ function unrefTimer(timer) {
|
|
|
3379
3319
|
if (typeof timer === "object" && timer && "unref" in timer) timer.unref();
|
|
3380
3320
|
}
|
|
3381
3321
|
//#endregion
|
|
3382
|
-
export {
|
|
3322
|
+
export { CodexToolProgressProjection as a, isCodexCommandBearingToolCall as c, sanitizeCodexToolResponse as d, CodexToolTranscriptProjection as i, resolveCodexToolProgressDetailMode as l, CodexEventProjection as n, shouldEmitTranscriptToolProgress as o, emitCodexAgentEvent as r, inferCodexDynamicToolMeta as s, codexNativeSubagentMonitorRuntime as t, sanitizeCodexToolArguments as u };
|