惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园_首页
博客园 - 【当耐特】
V
Visual Studio Blog
博客园 - 叶小钗
月光博客
月光博客
美团技术团队
J
Java Code Geeks
小众软件
小众软件
Y
Y Combinator Blog
博客园 - Franky
Martin Fowler
Martin Fowler
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(codex): preserve streamed command output (#83222) · o...
clawsweeper · 2026-05-18 · via Recent Commits to openclaw:main

@@ -146,6 +146,7 @@ export class CodexAppServerEventProjector {

146146

string,

147147

{ chars: number; messages: number; truncated: boolean }

148148

>();

149+

private readonly toolResultOutputTextByItem = new Map<string, string>();

149150

private readonly toolMetas = new Map<string, { toolName: string; meta?: string }>();

150151

private readonly toolTranscriptMessages: AgentMessage[] = [];

151152

private readonly toolTranscriptCallIds = new Set<string>();

@@ -706,7 +707,11 @@ export class CodexAppServerEventProjector {

706707

private handleOutputDelta(params: JsonObject, toolName: string): void {

707708

const itemId = readString(params, "itemId");

708709

const delta = readString(params, "delta");

709-

if (!itemId || !delta || !this.shouldEmitToolOutput()) {

710+

if (!itemId || !delta) {

711+

return;

712+

}

713+

appendToolOutputDeltaText(this.toolResultOutputTextByItem, itemId, delta);

714+

if (!this.shouldEmitToolOutput()) {

710715

return;

711716

}

712717

if (

@@ -953,7 +958,7 @@ export class CodexAppServerEventProjector {

953958

return;

954959

}

955960

const toolResult = itemToolResult(params.item).result;

956-

const output = itemOutputText(params.item);

961+

const output = itemOutputText(params.item, this.toolResultOutputTextByItem);

957962

this.options.trajectoryRecorder?.recordEvent("tool.result", {

958963

threadId: this.threadId,

959964

turnId: this.turnId,

@@ -1029,7 +1034,7 @@ export class CodexAppServerEventProjector {

10291034

}

10301035

this.afterToolCallObservedItemIds.add(item.id);

10311036

const result = itemToolResult(item).result;

1032-

const error = itemToolError(item, status);

1037+

const error = itemToolError(item, status, this.toolResultOutputTextByItem);

10331038

const startedAt =

10341039

typeof item.durationMs === "number" ? Date.now() - Math.max(0, item.durationMs) : undefined;

10351040

const hookParams = {

@@ -1097,7 +1102,7 @@ export class CodexAppServerEventProjector {

10971102

return;

10981103

}

10991104

const toolName = itemName(item);

1100-

const output = itemOutputText(item);

1105+

const output = itemOutputText(item, this.toolResultOutputTextByItem);

11011106

if (!toolName || !output) {

11021107

return;

11031108

}

@@ -1190,7 +1195,7 @@ export class CodexAppServerEventProjector {

11901195

this.recordToolTranscriptResult({

11911196

id: item.id,

11921197

name,

1193-

text: itemTranscriptResultText(item),

1198+

text: itemTranscriptResultText(item, this.toolResultOutputTextByItem),

11941199

isError: isNonSuccessItemStatus(itemStatus(item)),

11951200

});

11961201

}

@@ -1789,14 +1794,15 @@ function itemFileChanges(item: CodexThreadItem): Array<{ path: string; kind: str

17891794

function itemToolError(

17901795

item: CodexThreadItem,

17911796

status: ReturnType<typeof itemStatus>,

1797+

outputTextByItem?: ReadonlyMap<string, string>,

17921798

): string | undefined {

17931799

if (status === "blocked") {

17941800

return "codex native tool blocked";

17951801

}

17961802

if (status !== "failed") {

17971803

return undefined;

17981804

}

1799-

return itemOutputText(item) ?? "codex native tool failed";

1805+

return itemOutputText(item, outputTextByItem) ?? "codex native tool failed";

18001806

}

1801180718021808

function itemMeta(

@@ -1823,9 +1829,12 @@ function itemMeta(

18231829

return undefined;

18241830

}

182518311826-

function itemOutputText(item: CodexThreadItem): string | undefined {

1832+

function itemOutputText(

1833+

item: CodexThreadItem,

1834+

outputTextByItem?: ReadonlyMap<string, string>,

1835+

): string | undefined {

18271836

if (item.type === "commandExecution") {

1828-

return item.aggregatedOutput?.trim() || undefined;

1837+

return item.aggregatedOutput?.trim() || outputTextByItem?.get(item.id)?.trim() || undefined;

18291838

}

18301839

if (item.type === "dynamicToolCall") {

18311840

return collectDynamicToolContentText(item.contentItems).trim() || undefined;

@@ -1839,15 +1848,32 @@ function itemOutputText(item: CodexThreadItem): string | undefined {

18391848

return undefined;

18401849

}

184118501842-

function itemTranscriptResultText(item: CodexThreadItem): string | undefined {

1843-

const output = itemOutputText(item);

1851+

function itemTranscriptResultText(

1852+

item: CodexThreadItem,

1853+

outputTextByItem?: ReadonlyMap<string, string>,

1854+

): string | undefined {

1855+

const output = itemOutputText(item, outputTextByItem);

18441856

if (output) {

18451857

return output;

18461858

}

18471859

const result = itemToolResult(item).result;

18481860

return result ? stringifyJsonValue(result) : itemStatus(item);

18491861

}

185018621863+

function appendToolOutputDeltaText(

1864+

outputTextByItem: Map<string, string>,

1865+

itemId: string,

1866+

delta: string,

1867+

): void {

1868+

const current = outputTextByItem.get(itemId) ?? "";

1869+

if (current.length >= TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS) {

1870+

return;

1871+

}

1872+

const remaining = TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - current.length;

1873+

const next = current + (delta.length > remaining ? delta.slice(0, remaining) : delta);

1874+

outputTextByItem.set(itemId, next);

1875+

}

1876+18511877

function normalizeToolTranscriptArguments(value: unknown): Record<string, unknown> {

18521878

if (!value || typeof value !== "object" || Array.isArray(value)) {

18531879

return {};