@openclaw/codex 2026.9.1 → 2026.9.3
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/README.md +2 -0
- package/dist/api.js +18 -23
- package/dist/apply-B6el6hdO.js +357 -0
- package/dist/{attempt-client-cleanup-DYHcRQAa.js → attempt-client-cleanup-D6cR54TV.js} +113 -49
- package/dist/{attempt-context-DmQUNWwT.js → attempt-context-AO4DSjE0.js} +11 -9
- package/dist/{event-projector-usage-C5mcrGjp.js → attempt-notifications--H8zXR5-.js} +3 -89
- package/dist/auth-cache-key-Kq6oerr6.js +498 -0
- package/dist/auth-profile-CwzO4_RG.js +43 -0
- package/dist/auth-profile-selection-DFu9e167.js +45 -0
- package/dist/{binding-connection-E6uDsPlx.js → binding-connection-QqgcPCgk.js} +18 -3
- package/dist/{bounded-turn-wzJrwKKe.js → bounded-turn-lRpmZHFv.js} +54 -150
- package/dist/build-state-6RL6qohz.js +19 -0
- package/dist/{capabilities-dIjNVCYH.js → capabilities-BeqLPbtM.js} +2 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-BEKu4yDx.js +3983 -0
- package/dist/command-dispatch-CisT9Jqq.js +21 -0
- package/dist/{command-formatters-CLHhEB1Q.js → command-formatters-DeTfrapr.js} +2 -2
- package/dist/{command-handlers-CTGb2csu.js → command-handlers-BfIsJEuA.js} +158 -76
- package/dist/command-rpc-BMqRQOFX.js +226 -0
- package/dist/{compact-_t0HQrUS.js → compact-CGJZ2rlb.js} +89 -49
- package/dist/config-JDfTI4VI.js +106 -0
- package/dist/{config-BhmfC1s6.js → config-options-jnIFvwxD.js} +208 -654
- package/dist/config-runtime-BWf6JLWG.js +11 -0
- package/dist/config-utils-C57JiJrU.js +69 -0
- package/dist/conversation-binding-CxOlHiix.js +889 -0
- package/dist/{plugin-marketplace-discovery-CfFlKqDl.js → conversation-control-CUCrSIQI.js} +36 -155
- package/dist/doctor-contract-api.js +8 -9
- package/dist/{dynamic-tools-BU9tmlYm.js → dynamic-tools-D-JBoaLt.js} +734 -698
- package/dist/{effective-mcp-catalog-DzYBW4h1.js → effective-mcp-catalog-J_5Ep5Um.js} +4 -3
- package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
- package/dist/ephemeral-turn-DSwzP8YY.js +101 -0
- package/dist/{event-projector-assistant-message-DHRFXKbS.js → event-projector-assistant-message-BmBM4qBV.js} +23 -27
- package/dist/event-projector-usage-CIyrYYid.js +102 -0
- package/dist/{harness-DXVZ5II5.js → harness-FR6eQgyO.js} +47 -17
- package/dist/harness.js +1 -1
- package/dist/history-rejection-B4nOXNXF.js +13 -0
- package/dist/{image-payload-sanitizer-CnfoUPCE.js → image-payload-sanitizer-tupAr-2o.js} +29 -15
- package/dist/incognito-session-uhrBF6wJ.js +15 -0
- package/dist/index.js +413 -2893
- package/dist/{isolated-completion-kg9kv4iH.js → isolated-completion-DHBefrzg.js} +12 -21
- package/dist/{managed-binary-4-Vjz5GH.js → managed-binary-DrjjRRUD.js} +17 -84
- package/dist/managed-thread-store-D1t5jh3G.js +66 -0
- package/dist/media-understanding-provider.js +4 -1
- package/dist/{model-catalog-CUM68Hkl.js → model-catalog-B_6M04Wo.js} +6 -5
- package/dist/{models-sYnEc0gd.js → models-P9k2qAof.js} +4 -4
- package/dist/native-execution-policy-umd0tgh4.js +128 -0
- package/dist/{native-subagent-monitor-CnH147jH.js → native-subagent-monitor-BbCUKRwC.js} +76 -48
- package/dist/node-cli-sessions-rj0ysJwM.js +527 -0
- package/dist/{node-exec-server.runtime-CstNHCmC.js → node-exec-server.runtime-BY_ctYnT.js} +54 -23
- package/dist/plan-BMJdMOEF.js +711 -0
- package/dist/plugin-activation-BQK-f5sV.js +133 -0
- package/dist/{thread-resume-C7pyVKeW.js → plugin-app-cache-key-CdSQzWyX.js} +5 -53
- package/dist/{plugin-approval-roundtrip-CNe-Xrjx.js → plugin-approval-roundtrip-DeW95wB5.js} +1 -1
- package/dist/plugin-inventory-CoRCzWW4.js +325 -0
- package/dist/plugin-marketplace-discovery-3akBizzF.js +134 -0
- package/dist/{plugin-metadata-cache-BFrPhb2c.js → plugin-metadata-cache-DgNfRAGA.js} +13 -9
- package/dist/protocol-CAAcVIKF.js +275 -0
- package/dist/{provider-capabilities-DW5p4k9w.js → provider-capabilities-W4tfK5Y5.js} +2 -2
- package/dist/{rate-limits-CawQJfUS.js → rate-limits-Bqnx1N4z.js} +1 -1
- package/dist/request-CGvGOpeR.js +198 -0
- package/dist/{run-attempt-D1hJO4fX.js → run-attempt-DwKds3DN.js} +1498 -1028
- package/dist/{runtime-artifact-C3jVimFn.js → runtime-artifact-T-NwqeSH.js} +28 -28
- package/dist/sandbox-guard-BcT66fWy.js +165 -0
- package/dist/{session-binding-BHuTCRZQ.js → session-binding-CKSepwIC.js} +118 -324
- package/dist/session-binding-record-CaZjYwNS.js +256 -0
- package/dist/session-catalog-HaDcp7Sv.js +1533 -0
- package/dist/session-catalog-adoption-BKLtSrwi.js +251 -0
- package/dist/session-catalog-archive-D0i2pGj2.js +56 -0
- package/dist/session-catalog-home-id-D7-aLiNt.js +190 -0
- package/dist/session-catalog-node-adoption-BUuDYY8R.js +182 -0
- package/dist/session-catalog-node-continue-CBtc4wkI.js +238 -0
- package/dist/session-catalog-parsing-CdD3JhdM.js +280 -0
- package/dist/session-catalog-provenance-DkJHo735.js +124 -0
- package/dist/{session-cli-CmFEXMAM.js → session-cli-CbgaHh0f.js} +3 -2
- package/dist/session-history-Cz-tOOYj.js +96 -0
- package/dist/{session-upstream-marker-C351-5Qw.js → session-history-import-DFN7sWRU.js} +5 -49
- package/dist/session-history-read-cxPUxyVV.js +50 -0
- package/dist/session-history-worker-runtime.js +60 -0
- package/dist/{settled-turn-context-D3SNWtUn.js → session-history.worker-CNEvGaU5.js} +75 -69
- package/dist/session-history.worker.js +2 -0
- package/dist/{session-initialization-BeWzjGiR.js → session-initialization-Jo86C60I.js} +2 -1
- package/dist/{session-permission-policy-DeWVTCMj.js → session-permission-policy-B22InTp_.js} +4 -7
- package/dist/{session-retirement-BujDjXVF.js → session-retirement-BSNG_mhf.js} +8 -7
- package/dist/session-upstream-marker-D15C9NHp.js +46 -0
- package/dist/settled-turn-context-Du6gdUDd.js +45 -0
- package/dist/{settled-turn-finalizer-BVJx4yoc.js → settled-turn-finalizer-BuLUrZl2.js} +54 -42
- package/dist/shared-client-CVhez2Uo.js +2911 -0
- package/dist/{side-question-BTZAII4l.js → side-question-DLbr2vUU.js} +135 -191
- package/dist/source-Da-h6f7e.js +518 -0
- package/dist/thread-archive-guard-D1bP04Tf.js +53 -0
- package/dist/{thread-lifecycle-DAcEJ_Om.js → thread-lifecycle-D1pzRwHB.js} +467 -977
- package/dist/{thread-ownership-zGokd8i1.js → thread-ownership-D6oASVRu.js} +15 -17
- package/dist/{thread-policy-g4KbJPzp.js → thread-policy-D8kI7yAO.js} +2 -2
- package/dist/thread-resume-T5cveyxA.js +52 -0
- package/dist/timeout-BVw8aaM1.js +33 -0
- package/dist/transcript-mirror-attestation-DibE0krH.js +89 -0
- package/dist/{transcript-mirror-DTUxFWa_.js → transcript-mirror-t5TOccct.js} +111 -379
- package/dist/{transport-stdio-CyPldczm.js → transport-stdio-BGjHoYLr.js} +80 -48
- package/dist/{upstream-session-fork-CYlBIGVt.js → upstream-session-fork-De-sLJ2r.js} +94 -166
- package/dist/{usage-Bj-rrzkR.js → usage-CPPTmBvZ.js} +4 -3
- package/dist/version-omm6IPI3.js +12 -0
- package/dist/{web-search-provider.runtime-D2FWSK4w.js → web-search-provider.runtime-CSVgQL0w.js} +3 -3
- package/openclaw.plugin.json +22 -1
- package/package.json +6 -6
- package/dist/request-DYAI5FQE.js +0 -475
- package/dist/session-catalog-yyvTWFOw.js +0 -3120
- package/dist/session-history-C5J1AKzG.js +0 -87
- package/dist/shared-client-DxcfF9KX.js +0 -7494
- package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-Co2Vfcf_.js} +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
1
|
+
import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
|
|
3
2
|
import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.js";
|
|
3
|
+
import { t as readCodexMirroredSessionHistoryMessages } from "./session-history-Cz-tOOYj.js";
|
|
4
|
+
import { N as claimCodexAppServerLiveThread, U as releaseCodexAppServerLiveThread, W as retainCodexAppServerLiveThread } from "./shared-client-CVhez2Uo.js";
|
|
5
|
+
import { A as shouldRecordNativeToolTranscript, B as readNonEmptyStringArray, C as isSideEffectingNativeToolItem, D as itemTitle, E as itemStatus, H as readNullableString$1, I as readHookOutputEntries, L as readItem, N as normalizeOptionalString$1, O as matchesCodexSnapshotTurn, S as isNonSuccessItemStatus, T as itemName, j as shouldSynthesizeToolProgressForItem, w as itemKind, x as isMutatingNativeToolItem, y as auditNativeToolTerminalStatus, z as readNonEmptyString } from "./attempt-client-cleanup-D6cR54TV.js";
|
|
4
6
|
import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.js";
|
|
5
|
-
import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-
|
|
6
|
-
import { n as readCodexMirroredSessionHistoryMessages } from "./session-history-C5J1AKzG.js";
|
|
7
|
+
import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-DeW95wB5.js";
|
|
7
8
|
import { asFiniteNumber, asNonArrayRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
import path from "node:path";
|
|
9
9
|
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
10
|
-
import
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
11
12
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
13
|
+
import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, embeddedAgentLog, emitAgentEvent, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, runAgentHarnessAfterToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
14
|
import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
13
|
-
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
14
15
|
import { createAgentHarnessTaskRuntime, deliverAgentHarnessTaskCompletion, isDurableAgentHarnessCompletionDelivery } from "openclaw/plugin-sdk/agent-harness-task-runtime";
|
|
15
16
|
//#region extensions/codex/src/app-server/event-projector-tool-output.ts
|
|
16
17
|
const TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 1e4;
|
|
@@ -19,7 +20,6 @@ var ToolOutputAccumulator = class {
|
|
|
19
20
|
constructor() {
|
|
20
21
|
this.prefixByItem = /* @__PURE__ */ new Map();
|
|
21
22
|
this.originalLengthByItem = /* @__PURE__ */ new Map();
|
|
22
|
-
this.normalizedLengthByItem = /* @__PURE__ */ new Map();
|
|
23
23
|
this.trimStateByItem = /* @__PURE__ */ new Map();
|
|
24
24
|
this.truncatedItemIds = /* @__PURE__ */ new Set();
|
|
25
25
|
this.textByItem = /* @__PURE__ */ new Map();
|
|
@@ -28,19 +28,7 @@ var ToolOutputAccumulator = class {
|
|
|
28
28
|
const originalLength = (this.originalLengthByItem.get(itemId) ?? this.textByItem.get(itemId)?.length ?? 0) + delta.length;
|
|
29
29
|
this.originalLengthByItem.set(itemId, originalLength);
|
|
30
30
|
const normalizedLength = updateToolOutputTrimState(this.trimStateByItem, itemId, delta);
|
|
31
|
-
this.
|
|
32
|
-
if (this.truncatedItemIds.has(itemId)) {
|
|
33
|
-
const next = appendBoundedToolTranscriptText(this.prefixByItem.get(itemId) ?? this.textByItem.get(itemId) ?? "", "", originalLength);
|
|
34
|
-
this.prefixByItem.set(itemId, next.rawPrefix);
|
|
35
|
-
this.textByItem.set(itemId, next.text);
|
|
36
|
-
return {
|
|
37
|
-
text: next.text,
|
|
38
|
-
originalLength,
|
|
39
|
-
normalizedLength,
|
|
40
|
-
rawPrefix: next.rawPrefix
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const next = appendBoundedToolTranscriptText(this.prefixByItem.get(itemId) ?? this.textByItem.get(itemId) ?? "", delta, originalLength);
|
|
31
|
+
const next = appendBoundedToolTranscriptText(this.prefixByItem.get(itemId) ?? this.textByItem.get(itemId) ?? "", this.truncatedItemIds.has(itemId) ? "" : delta, originalLength);
|
|
44
32
|
this.prefixByItem.set(itemId, next.rawPrefix);
|
|
45
33
|
this.textByItem.set(itemId, next.text);
|
|
46
34
|
if (originalLength > 1e4) this.truncatedItemIds.add(itemId);
|
|
@@ -561,7 +549,8 @@ var CodexToolProgressProjection = class {
|
|
|
561
549
|
else if (this.lastNativeToolError?.mutatingAction !== true) this.lastNativeToolError = void 0;
|
|
562
550
|
}
|
|
563
551
|
emitToolResultSummary(item) {
|
|
564
|
-
if (!item ||
|
|
552
|
+
if (!item || item.type === "dynamicToolCall") return;
|
|
553
|
+
if (!this.params.onToolResult || !this.shouldEmitToolResult()) return;
|
|
565
554
|
if (this.resultSummaryItemIds.has(item.id)) return;
|
|
566
555
|
const toolName = itemName(item);
|
|
567
556
|
const args = itemToolArgs(item);
|
|
@@ -574,7 +563,8 @@ var CodexToolProgressProjection = class {
|
|
|
574
563
|
});
|
|
575
564
|
}
|
|
576
565
|
emitToolResultOutput(item) {
|
|
577
|
-
if (!item ||
|
|
566
|
+
if (!item || item.type === "dynamicToolCall") return;
|
|
567
|
+
if (!this.params.onToolResult || !this.shouldEmitToolOutput()) return;
|
|
578
568
|
if (this.resultOutputItemIds.has(item.id) || this.resultOutputStreamedItemIds.has(item.id)) return;
|
|
579
569
|
const toolName = itemName(item);
|
|
580
570
|
const output = itemOutputText(item, this.output.textByItem);
|
|
@@ -657,7 +647,7 @@ var CodexToolProgressProjection = class {
|
|
|
657
647
|
return !commandBearing || !channel && this.shouldEmitToolOutput();
|
|
658
648
|
}
|
|
659
649
|
emitTranscriptToolCallProgress(params) {
|
|
660
|
-
if (!shouldEmitTranscriptToolProgress(params.name, params.arguments)) return;
|
|
650
|
+
if (params.name === "progress_card" || !shouldEmitTranscriptToolProgress(params.name, params.arguments)) return;
|
|
661
651
|
this.transcriptProgressCallIds.add(params.id);
|
|
662
652
|
const args = normalizeToolTranscriptArguments(params.arguments);
|
|
663
653
|
const meta = this.shouldIncludeFormattedMeta(isCodexCommandBearingToolCall(params.name, args)) ? inferToolMetaFromArgs(params.name, args, { detailMode: this.toolProgressDetailMode() }) : void 0;
|
|
@@ -669,7 +659,12 @@ var CodexToolProgressProjection = class {
|
|
|
669
659
|
});
|
|
670
660
|
}
|
|
671
661
|
emitTranscriptToolResultProgress(params) {
|
|
672
|
-
if (this.transcriptProgressSuppressedIds.has(params.id) || !shouldEmitTranscriptToolProgress(params.name, this.transcriptArgumentsById.get(params.id))) return;
|
|
662
|
+
if (params.name === "progress_card" && !params.isError || this.transcriptProgressSuppressedIds.has(params.id) || !shouldEmitTranscriptToolProgress(params.name, this.transcriptArgumentsById.get(params.id))) return;
|
|
663
|
+
if (params.name === "progress_card" && this.shouldEmitToolResult()) this.emitToolResultMessage({
|
|
664
|
+
itemId: params.id,
|
|
665
|
+
text: formatToolSummary(params.name),
|
|
666
|
+
isError: true
|
|
667
|
+
});
|
|
673
668
|
if (!this.transcriptProgressCallIds.has(params.id)) this.emitTranscriptToolCallProgress({
|
|
674
669
|
id: params.id,
|
|
675
670
|
name: params.name,
|
|
@@ -947,21 +942,20 @@ var CodexToolTranscriptProjection = class {
|
|
|
947
942
|
isError: result.isError
|
|
948
943
|
}).content;
|
|
949
944
|
}
|
|
950
|
-
async
|
|
945
|
+
async prepareNativeToolResultDetails(item) {
|
|
951
946
|
const preparedDetails = await this.prepareNativeMcpAppResultDetails(item);
|
|
952
947
|
const approvalReviewState = item ? this.approvalReviewsByCallId.get(item.id) : void 0;
|
|
953
948
|
const reviewDetails = approvalReviewState ? {
|
|
954
949
|
approvalReviews: approvalReviewState.reviews,
|
|
955
950
|
approvalReviewOutcome: toolApprovalReviewOutcome(approvalReviewState)
|
|
956
951
|
} : void 0;
|
|
957
|
-
|
|
952
|
+
return reviewDetails ? isJsonObject(preparedDetails) ? {
|
|
958
953
|
...preparedDetails,
|
|
959
954
|
...reviewDetails
|
|
960
955
|
} : {
|
|
961
956
|
...preparedDetails !== void 0 ? { toolDetails: preparedDetails } : {},
|
|
962
957
|
...reviewDetails
|
|
963
958
|
} : preparedDetails;
|
|
964
|
-
this.recordNativeToolResult(item, details);
|
|
965
959
|
}
|
|
966
960
|
async prepareNativeMcpAppResultDetails(item) {
|
|
967
961
|
if (!item || item.type !== "mcpToolCall" || itemStatus(item) === "running") return;
|
|
@@ -1084,13 +1078,14 @@ var CodexToolTranscriptProjection = class {
|
|
|
1084
1078
|
const missingCount = (/* @__PURE__ */ new Set([...missingTranscriptIds, ...missingTrajectoryIds])).size;
|
|
1085
1079
|
return missingCount === 1 ? MISSING_TOOL_RESULT_ERROR : `${MISSING_TOOL_RESULT_ERROR} missingToolResultCount=${missingCount}`;
|
|
1086
1080
|
}
|
|
1087
|
-
async readMirroredSessionMessages() {
|
|
1081
|
+
async readMirroredSessionMessages(signal) {
|
|
1088
1082
|
return await readCodexMirroredSessionHistoryMessages({
|
|
1089
1083
|
agentId: this.params.agentId,
|
|
1090
1084
|
sessionFile: this.params.sessionFile,
|
|
1091
1085
|
sessionId: this.params.sessionId,
|
|
1092
|
-
sessionKey: this.params.sessionKey
|
|
1093
|
-
|
|
1086
|
+
sessionKey: this.params.sessionKey,
|
|
1087
|
+
sessionTarget: this.params.sessionTarget
|
|
1088
|
+
}, void 0, "native-evidence", signal) ?? [];
|
|
1094
1089
|
}
|
|
1095
1090
|
recordToolCall(params) {
|
|
1096
1091
|
if (!params.id || !params.name || this.callIds.has(params.id)) return;
|
|
@@ -1388,6 +1383,16 @@ var CodexEventProjection = class {
|
|
|
1388
1383
|
}
|
|
1389
1384
|
});
|
|
1390
1385
|
}
|
|
1386
|
+
handleRetry(params) {
|
|
1387
|
+
const rateLimited = isJsonObject(params.error) && params.error.codexErrorInfo === "rateLimitExceeded";
|
|
1388
|
+
this.emitAgentEvent({
|
|
1389
|
+
stream: "run_status",
|
|
1390
|
+
data: {
|
|
1391
|
+
phase: "retrying",
|
|
1392
|
+
message: rateLimited ? "Rate limited. The provider is retrying." : "Connection interrupted. The provider is retrying."
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1391
1396
|
flushPendingGuardianWarning() {
|
|
1392
1397
|
const pending = this.pendingGuardianWarning;
|
|
1393
1398
|
if (!pending) return;
|
|
@@ -1444,20 +1449,26 @@ var CodexEventProjection = class {
|
|
|
1444
1449
|
emitStandardItemEvent(params) {
|
|
1445
1450
|
const { item } = params;
|
|
1446
1451
|
if (!item) return;
|
|
1447
|
-
const
|
|
1452
|
+
const activity = item.type === "subAgentActivity";
|
|
1453
|
+
if (activity && params.phase === "start") return;
|
|
1454
|
+
const subagent = activity || item.type === "collabAgentToolCall";
|
|
1455
|
+
const kind = subagent ? "tool" : itemKind(item);
|
|
1448
1456
|
if (!kind) return;
|
|
1449
|
-
const name = itemName(item);
|
|
1457
|
+
const name = subagent ? "subagents" : itemName(item);
|
|
1450
1458
|
const commandBearing = isCommandBearingToolItem(item, itemToolArgs(item));
|
|
1451
|
-
const
|
|
1459
|
+
const subagentStatus = readStringField(item, activity ? "kind" : "status");
|
|
1460
|
+
const interaction = activity && subagentStatus === "interacted";
|
|
1461
|
+
const status = subagent && subagentStatus === "interrupted" ? "failed" : activity ? subagentStatus === "completed" || interaction ? "completed" : "running" : params.phase === "start" ? "running" : itemStatus(item);
|
|
1462
|
+
const meta = subagent ? [interaction ? "message sent" : activity ? subagentStatus : status, readStringField(item, activity ? "agentPath" : "tool")].filter(Boolean).join(": ") : itemMeta(item, this.toolProgress.toolProgressDetailMode());
|
|
1452
1463
|
const suppressChannelProgress = shouldSuppressChannelProgressForItem(item);
|
|
1453
1464
|
this.emitAgentEvent({
|
|
1454
1465
|
stream: "item",
|
|
1455
1466
|
data: {
|
|
1456
|
-
itemId: item.id,
|
|
1467
|
+
itemId: activity && !interaction ? `subagent:${readStringField(item, "agentThreadId") ?? item.id}` : item.id,
|
|
1457
1468
|
phase: params.phase,
|
|
1458
1469
|
kind,
|
|
1459
1470
|
title: itemTitle(item),
|
|
1460
|
-
status
|
|
1471
|
+
status,
|
|
1461
1472
|
...name ? { name } : {},
|
|
1462
1473
|
...meta ? { meta } : {},
|
|
1463
1474
|
...commandBearing ? { commandBearing: true } : {},
|
|
@@ -1465,6 +1476,31 @@ var CodexEventProjection = class {
|
|
|
1465
1476
|
}
|
|
1466
1477
|
});
|
|
1467
1478
|
}
|
|
1479
|
+
async emitSnapshotOnlyNativeToolProgress(params) {
|
|
1480
|
+
const { item, activeItemIds, completedItemIds, isActive } = params;
|
|
1481
|
+
if (!shouldSynthesizeToolProgressForItem(item) || !matchesCodexSnapshotTurn(item, this.turnId) || completedItemIds.has(item.id) || itemStatus(item) === "running") return;
|
|
1482
|
+
if (!activeItemIds.has(item.id)) {
|
|
1483
|
+
this.emitStandardItemEvent({
|
|
1484
|
+
phase: "start",
|
|
1485
|
+
item
|
|
1486
|
+
});
|
|
1487
|
+
await this.emitNormalizedToolItemEvent({
|
|
1488
|
+
phase: "start",
|
|
1489
|
+
item
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
if (!isActive()) return;
|
|
1493
|
+
activeItemIds.delete(item.id);
|
|
1494
|
+
this.emitStandardItemEvent({
|
|
1495
|
+
phase: "end",
|
|
1496
|
+
item
|
|
1497
|
+
});
|
|
1498
|
+
await this.emitNormalizedToolItemEvent({
|
|
1499
|
+
phase: "result",
|
|
1500
|
+
item
|
|
1501
|
+
});
|
|
1502
|
+
completedItemIds.add(item.id);
|
|
1503
|
+
}
|
|
1468
1504
|
async emitNormalizedToolItemEvent(params) {
|
|
1469
1505
|
const projection = projectNormalizedToolItem({
|
|
1470
1506
|
...params,
|
|
@@ -1516,10 +1552,10 @@ function extractCodexNativeSubagentCompletions(notification) {
|
|
|
1516
1552
|
if (!params) return [];
|
|
1517
1553
|
const item = isJsonObject(params.item) ? params.item : void 0;
|
|
1518
1554
|
if (!item) return [];
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
return extractCodexNativeSubagentCompletionsFromText(text).filter((completion) => completion.agentPath === author);
|
|
1555
|
+
const communication = readTrustedInterAgentCommunication(item);
|
|
1556
|
+
const text = communication?.content;
|
|
1557
|
+
if (typeof text !== "string" || !text) return [];
|
|
1558
|
+
return extractCodexNativeSubagentCompletionsFromText(text).filter((completion) => completion.agentPath === communication?.author);
|
|
1523
1559
|
}
|
|
1524
1560
|
/** Parses one or more tagged subagent completion payloads from commentary text. */
|
|
1525
1561
|
function extractCodexNativeSubagentCompletionsFromText(text) {
|
|
@@ -1612,14 +1648,6 @@ function completedWithoutFinalAssistantMessage() {
|
|
|
1612
1648
|
kind: "no_final_assistant_message"
|
|
1613
1649
|
};
|
|
1614
1650
|
}
|
|
1615
|
-
function readTrustedInterAgentCommunicationContent(item) {
|
|
1616
|
-
const communication = readTrustedInterAgentCommunication(item);
|
|
1617
|
-
return typeof communication?.content === "string" ? communication.content : void 0;
|
|
1618
|
-
}
|
|
1619
|
-
function readTrustedInterAgentCommunicationAuthor(item) {
|
|
1620
|
-
const communication = readTrustedInterAgentCommunication(item);
|
|
1621
|
-
return typeof communication?.author === "string" ? communication.author : void 0;
|
|
1622
|
-
}
|
|
1623
1651
|
function readTrustedInterAgentCommunication(item) {
|
|
1624
1652
|
if (readStringField(item, "type") !== "message" || readStringField(item, "role") !== "assistant" || readStringField(item, "phase") !== "commentary") return;
|
|
1625
1653
|
const text = extractSingleTextPart(item);
|