@openclaw/codex 2026.5.5-beta.2 → 2026.5.5
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/harness.js
CHANGED
|
@@ -18,7 +18,7 @@ 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-iMdlA1m8.js");
|
|
22
22
|
return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
|
|
23
23
|
},
|
|
24
24
|
compact: async (params) => {
|
|
@@ -15,6 +15,7 @@ import path from "node:path";
|
|
|
15
15
|
import nodeFs from "node:fs";
|
|
16
16
|
import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
17
17
|
import { buildSessionContext, migrateSessionEntries, parseSessionEntries } from "@mariozechner/pi-coding-agent";
|
|
18
|
+
import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/text-runtime";
|
|
18
19
|
import { resolveUserPath as resolveUserPath$1 } from "openclaw/plugin-sdk/agent-harness";
|
|
19
20
|
//#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
|
|
20
21
|
const DEFAULT_CODEX_APPROVAL_TIMEOUT_MS = 12e4;
|
|
@@ -961,6 +962,40 @@ async function readCodexMirroredSessionHistoryMessages(sessionFile) {
|
|
|
961
962
|
}
|
|
962
963
|
}
|
|
963
964
|
//#endregion
|
|
965
|
+
//#region extensions/codex/src/app-server/tool-progress-normalization.ts
|
|
966
|
+
function resolveCodexToolProgressDetailMode(value) {
|
|
967
|
+
return value === "raw" ? "raw" : "explain";
|
|
968
|
+
}
|
|
969
|
+
function sanitizeCodexAgentEventValue(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
970
|
+
if (typeof value === "string") return redactToolPayloadText(value);
|
|
971
|
+
if (Array.isArray(value)) {
|
|
972
|
+
if (seen.has(value)) return "[Circular]";
|
|
973
|
+
seen.add(value);
|
|
974
|
+
return value.map((entry) => sanitizeCodexAgentEventValue(entry, seen));
|
|
975
|
+
}
|
|
976
|
+
if (value && typeof value === "object") {
|
|
977
|
+
if (seen.has(value)) return "[Circular]";
|
|
978
|
+
seen.add(value);
|
|
979
|
+
const out = {};
|
|
980
|
+
for (const [key, child] of Object.entries(value)) out[key] = typeof child === "string" ? redactSensitiveFieldValue(key, child) : sanitizeCodexAgentEventValue(child, seen);
|
|
981
|
+
return out;
|
|
982
|
+
}
|
|
983
|
+
return value;
|
|
984
|
+
}
|
|
985
|
+
function sanitizeCodexAgentEventRecord(value) {
|
|
986
|
+
return sanitizeCodexAgentEventValue(value);
|
|
987
|
+
}
|
|
988
|
+
function sanitizeCodexToolArguments(value) {
|
|
989
|
+
if (!isJsonObject(value)) return;
|
|
990
|
+
return sanitizeCodexAgentEventRecord(value);
|
|
991
|
+
}
|
|
992
|
+
function sanitizeCodexToolResponse(response) {
|
|
993
|
+
return sanitizeCodexAgentEventRecord(response);
|
|
994
|
+
}
|
|
995
|
+
function inferCodexDynamicToolMeta(call, detailMode) {
|
|
996
|
+
return inferToolMetaFromArgs(call.tool, call.arguments, { detailMode });
|
|
997
|
+
}
|
|
998
|
+
//#endregion
|
|
964
999
|
//#region extensions/codex/src/app-server/transcript-mirror.ts
|
|
965
1000
|
const MIRROR_IDENTITY_META_KEY = "mirrorIdentity";
|
|
966
1001
|
/**
|
|
@@ -1334,6 +1369,10 @@ var CodexAppServerEventProjector = class {
|
|
|
1334
1369
|
phase: "start",
|
|
1335
1370
|
item
|
|
1336
1371
|
});
|
|
1372
|
+
this.emitNormalizedToolItemEvent({
|
|
1373
|
+
phase: "start",
|
|
1374
|
+
item
|
|
1375
|
+
});
|
|
1337
1376
|
this.emitToolResultSummary(item);
|
|
1338
1377
|
this.emitAgentEvent({
|
|
1339
1378
|
stream: "codex_app_server.item",
|
|
@@ -1396,6 +1435,10 @@ var CodexAppServerEventProjector = class {
|
|
|
1396
1435
|
phase: "end",
|
|
1397
1436
|
item
|
|
1398
1437
|
});
|
|
1438
|
+
this.emitNormalizedToolItemEvent({
|
|
1439
|
+
phase: "result",
|
|
1440
|
+
item
|
|
1441
|
+
});
|
|
1399
1442
|
this.emitToolResultSummary(item);
|
|
1400
1443
|
this.emitToolResultOutput(item);
|
|
1401
1444
|
this.emitAgentEvent({
|
|
@@ -1558,6 +1601,7 @@ var CodexAppServerEventProjector = class {
|
|
|
1558
1601
|
const kind = itemKind(item);
|
|
1559
1602
|
if (!kind) return;
|
|
1560
1603
|
const meta = itemMeta(item, this.toolProgressDetailMode());
|
|
1604
|
+
const suppressChannelProgress = shouldSuppressChannelProgressForItem(item);
|
|
1561
1605
|
this.emitAgentEvent({
|
|
1562
1606
|
stream: "item",
|
|
1563
1607
|
data: {
|
|
@@ -1567,7 +1611,33 @@ var CodexAppServerEventProjector = class {
|
|
|
1567
1611
|
title: itemTitle(item),
|
|
1568
1612
|
status: params.phase === "start" ? "running" : itemStatus(item),
|
|
1569
1613
|
...itemName(item) ? { name: itemName(item) } : {},
|
|
1570
|
-
...meta ? { meta } : {}
|
|
1614
|
+
...meta ? { meta } : {},
|
|
1615
|
+
...suppressChannelProgress ? { suppressChannelProgress: true } : {}
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
emitNormalizedToolItemEvent(params) {
|
|
1620
|
+
const { item } = params;
|
|
1621
|
+
if (!item || !shouldSynthesizeToolProgressForItem(item)) return;
|
|
1622
|
+
const name = itemName(item);
|
|
1623
|
+
if (!name) return;
|
|
1624
|
+
const meta = itemMeta(item, this.toolProgressDetailMode());
|
|
1625
|
+
const args = params.phase === "start" ? itemToolArgs(item) : void 0;
|
|
1626
|
+
const status = params.phase === "result" ? itemStatus(item) : "running";
|
|
1627
|
+
this.emitAgentEvent({
|
|
1628
|
+
stream: "tool",
|
|
1629
|
+
data: {
|
|
1630
|
+
phase: params.phase,
|
|
1631
|
+
name,
|
|
1632
|
+
itemId: item.id,
|
|
1633
|
+
toolCallId: item.id,
|
|
1634
|
+
...meta ? { meta } : {},
|
|
1635
|
+
...args ? { args } : {},
|
|
1636
|
+
...params.phase === "result" ? {
|
|
1637
|
+
status,
|
|
1638
|
+
isError: isNonSuccessItemStatus(status),
|
|
1639
|
+
...itemToolResult(item)
|
|
1640
|
+
} : {}
|
|
1571
1641
|
}
|
|
1572
1642
|
});
|
|
1573
1643
|
}
|
|
@@ -1611,7 +1681,7 @@ var CodexAppServerEventProjector = class {
|
|
|
1611
1681
|
return typeof this.params.shouldEmitToolOutput === "function" ? this.params.shouldEmitToolOutput() : this.params.verboseLevel === "full";
|
|
1612
1682
|
}
|
|
1613
1683
|
toolProgressDetailMode() {
|
|
1614
|
-
return this.params.toolProgressDetail
|
|
1684
|
+
return resolveCodexToolProgressDetailMode(this.params.toolProgressDetail);
|
|
1615
1685
|
}
|
|
1616
1686
|
recordToolMeta(item) {
|
|
1617
1687
|
if (!item) return;
|
|
@@ -1856,9 +1926,13 @@ function itemTitle(item) {
|
|
|
1856
1926
|
function itemStatus(item) {
|
|
1857
1927
|
const status = readItemString(item, "status");
|
|
1858
1928
|
if (status === "failed") return "failed";
|
|
1929
|
+
if (status === "declined") return "blocked";
|
|
1859
1930
|
if (status === "inProgress" || status === "running") return "running";
|
|
1860
1931
|
return "completed";
|
|
1861
1932
|
}
|
|
1933
|
+
function isNonSuccessItemStatus(status) {
|
|
1934
|
+
return status === "failed" || status === "blocked";
|
|
1935
|
+
}
|
|
1862
1936
|
function itemName(item) {
|
|
1863
1937
|
if (item.type === "dynamicToolCall" && typeof item.tool === "string") return item.tool;
|
|
1864
1938
|
if (item.type === "mcpToolCall" && typeof item.tool === "string") {
|
|
@@ -1869,6 +1943,49 @@ function itemName(item) {
|
|
|
1869
1943
|
if (item.type === "fileChange") return "apply_patch";
|
|
1870
1944
|
if (item.type === "webSearch") return "web_search";
|
|
1871
1945
|
}
|
|
1946
|
+
function shouldSynthesizeToolProgressForItem(item) {
|
|
1947
|
+
switch (item.type) {
|
|
1948
|
+
case "commandExecution":
|
|
1949
|
+
case "fileChange":
|
|
1950
|
+
case "webSearch":
|
|
1951
|
+
case "mcpToolCall": return true;
|
|
1952
|
+
default: return false;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
function shouldSuppressChannelProgressForItem(item) {
|
|
1956
|
+
if (shouldSynthesizeToolProgressForItem(item)) return true;
|
|
1957
|
+
return item.type === "dynamicToolCall";
|
|
1958
|
+
}
|
|
1959
|
+
function itemToolArgs(item) {
|
|
1960
|
+
if (item.type === "commandExecution") return sanitizeCodexAgentEventRecord({
|
|
1961
|
+
command: item.command,
|
|
1962
|
+
...typeof item.cwd === "string" ? { cwd: item.cwd } : {}
|
|
1963
|
+
});
|
|
1964
|
+
if (item.type === "webSearch" && typeof item.query === "string") return sanitizeCodexAgentEventRecord({ query: item.query });
|
|
1965
|
+
if (item.type === "mcpToolCall") return sanitizeCodexToolArguments(item.arguments);
|
|
1966
|
+
}
|
|
1967
|
+
function itemToolResult(item) {
|
|
1968
|
+
if (item.type === "commandExecution") return { result: sanitizeCodexAgentEventRecord({
|
|
1969
|
+
status: item.status,
|
|
1970
|
+
exitCode: item.exitCode,
|
|
1971
|
+
durationMs: item.durationMs
|
|
1972
|
+
}) };
|
|
1973
|
+
if (item.type === "fileChange") return { result: sanitizeCodexAgentEventRecord({
|
|
1974
|
+
status: item.status,
|
|
1975
|
+
changes: item.changes.map((change) => ({
|
|
1976
|
+
path: change.path,
|
|
1977
|
+
kind: change.kind
|
|
1978
|
+
}))
|
|
1979
|
+
}) };
|
|
1980
|
+
if (item.type === "mcpToolCall") return { result: sanitizeCodexAgentEventRecord({
|
|
1981
|
+
status: item.status,
|
|
1982
|
+
durationMs: item.durationMs,
|
|
1983
|
+
...item.error ? { error: item.error } : {},
|
|
1984
|
+
...item.result ? { result: item.result } : {}
|
|
1985
|
+
}) };
|
|
1986
|
+
if (item.type === "webSearch") return { result: sanitizeCodexAgentEventRecord({ status: "completed" }) };
|
|
1987
|
+
return {};
|
|
1988
|
+
}
|
|
1872
1989
|
function itemMeta(item, detailMode = "explain") {
|
|
1873
1990
|
if (item.type === "commandExecution" && typeof item.command === "string") return inferToolMetaFromArgs("exec", {
|
|
1874
1991
|
command: item.command,
|
|
@@ -3057,6 +3174,18 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3057
3174
|
name: call.tool,
|
|
3058
3175
|
arguments: call.arguments
|
|
3059
3176
|
});
|
|
3177
|
+
const toolMeta = inferCodexDynamicToolMeta(call, resolveCodexToolProgressDetailMode(params.toolProgressDetail));
|
|
3178
|
+
const toolArgs = sanitizeCodexToolArguments(call.arguments);
|
|
3179
|
+
emitCodexAppServerEvent(params, {
|
|
3180
|
+
stream: "tool",
|
|
3181
|
+
data: {
|
|
3182
|
+
phase: "start",
|
|
3183
|
+
name: call.tool,
|
|
3184
|
+
toolCallId: call.callId,
|
|
3185
|
+
...toolMeta ? { meta: toolMeta } : {},
|
|
3186
|
+
...toolArgs ? { args: toolArgs } : {}
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3060
3189
|
const response = await handleDynamicToolCallWithTimeout({
|
|
3061
3190
|
call,
|
|
3062
3191
|
toolBridge,
|
|
@@ -3080,6 +3209,17 @@ async function runCodexAppServerAttempt(params, options = {}) {
|
|
|
3080
3209
|
success: response.success,
|
|
3081
3210
|
contentItems: response.contentItems
|
|
3082
3211
|
});
|
|
3212
|
+
emitCodexAppServerEvent(params, {
|
|
3213
|
+
stream: "tool",
|
|
3214
|
+
data: {
|
|
3215
|
+
phase: "result",
|
|
3216
|
+
name: call.tool,
|
|
3217
|
+
toolCallId: call.callId,
|
|
3218
|
+
...toolMeta ? { meta: toolMeta } : {},
|
|
3219
|
+
isError: !response.success,
|
|
3220
|
+
result: sanitizeCodexToolResponse(response)
|
|
3221
|
+
}
|
|
3222
|
+
});
|
|
3083
3223
|
return response;
|
|
3084
3224
|
} finally {
|
|
3085
3225
|
activeAppServerTurnRequests = Math.max(0, activeAppServerTurnRequests - 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.5.5
|
|
3
|
+
"version": "2026.5.5",
|
|
4
4
|
"description": "OpenClaw Codex harness and model provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.5.1-beta.1"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.5.5
|
|
30
|
+
"pluginApi": ">=2026.5.5"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.5
|
|
33
|
+
"openclawVersion": "2026.5.5"
|
|
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.5
|
|
48
|
+
"openclaw": ">=2026.5.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|