
























@@ -16,6 +16,7 @@ import {
1616type EmbeddedRunAttemptResult,
1717type HeartbeatToolResponse,
1818type MessagingToolSend,
19+type ToolProgressDetailMode,
1920} from "openclaw/plugin-sdk/agent-harness-runtime";
2021import { readCodexTurn } from "./protocol-validators.js";
2122import {
@@ -614,6 +615,7 @@ export class CodexAppServerEventProjector {
614615if (!kind) {
615616return;
616617}
618+const meta = itemMeta(item, this.toolProgressDetailMode());
617619this.emitAgentEvent({
618620stream: "item",
619621data: {
@@ -623,7 +625,7 @@ export class CodexAppServerEventProjector {
623625title: itemTitle(item),
624626status: params.phase === "start" ? "running" : itemStatus(item),
625627 ...(itemName(item) ? { name: itemName(item) } : {}),
626- ...(itemMeta(item) ? { meta: itemMeta(item) } : {}),
628+ ...(meta ? { meta } : {}),
627629},
628630});
629631}
@@ -641,7 +643,7 @@ export class CodexAppServerEventProjector {
641643return;
642644}
643645this.toolResultSummaryItemIds.add(itemId);
644-const meta = itemMeta(item);
646+const meta = itemMeta(item, this.toolProgressDetailMode());
645647this.emitToolResultMessage({
646648 itemId,
647649text: formatToolSummary(toolName, meta),
@@ -666,7 +668,7 @@ export class CodexAppServerEventProjector {
666668}
667669this.emitToolResultMessage({
668670 itemId,
669-text: formatToolOutput(toolName, itemMeta(item), output),
671+text: formatToolOutput(toolName, itemMeta(item, this.toolProgressDetailMode()), output),
670672finalOutput: true,
671673});
672674}
@@ -700,6 +702,10 @@ export class CodexAppServerEventProjector {
700702 : this.params.verboseLevel === "full";
701703}
702704705+private toolProgressDetailMode(): ToolProgressDetailMode {
706+return this.params.toolProgressDetail === "raw" ? "raw" : "explain";
707+}
708+703709private recordToolMeta(item: CodexThreadItem | undefined): void {
704710if (!item) {
705711return;
@@ -708,9 +714,10 @@ export class CodexAppServerEventProjector {
708714if (!toolName) {
709715return;
710716}
717+const meta = itemMeta(item, this.toolProgressDetailMode());
711718this.toolMetas.set(item.id, {
712719 toolName,
713- ...(itemMeta(item) ? { meta: itemMeta(item) } : {}),
720+ ...(meta ? { meta } : {}),
714721});
715722}
716723@@ -1047,19 +1054,26 @@ function itemName(item: CodexThreadItem): string | undefined {
10471054return undefined;
10481055}
104910561050-function itemMeta(item: CodexThreadItem): string | undefined {
1057+function itemMeta(
1058+item: CodexThreadItem,
1059+detailMode: ToolProgressDetailMode = "explain",
1060+): string | undefined {
10511061if (item.type === "commandExecution" && typeof item.command === "string") {
1052-return inferToolMetaFromArgs("exec", {
1053-command: item.command,
1054-cwd: typeof item.cwd === "string" ? item.cwd : undefined,
1055-});
1062+return inferToolMetaFromArgs(
1063+"exec",
1064+{
1065+command: item.command,
1066+cwd: typeof item.cwd === "string" ? item.cwd : undefined,
1067+},
1068+{ detailMode },
1069+);
10561070}
10571071if (item.type === "webSearch" && typeof item.query === "string") {
10581072return item.query;
10591073}
10601074const toolName = itemName(item);
10611075if ((item.type === "dynamicToolCall" || item.type === "mcpToolCall") && toolName) {
1062-return inferToolMetaFromArgs(toolName, item.arguments);
1076+return inferToolMetaFromArgs(toolName, item.arguments, { detailMode });
10631077}
10641078return undefined;
10651079}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。