Skip to content

Commit 8459ac7

Browse files
committed
fix(coding-agent): keep pending tool calls visible in parked transcript viewer
The append-tailing refactor routed full local/remote rebuilds through buildSessionContext(transcript:true), which strips dangling (resultless) tool_use blocks for LLM-context safety. That hid a parked/advisor agent's in-flight tool call (e.g. a pending search) from the hub transcript. Display semantics differ from LLM semantics: only collapse through buildSessionContext when a compaction is present; otherwise map message entries verbatim so pending calls render, matching prior viewer behavior.
1 parent e3fca3e commit 8459ac7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/coding-agent/src/modes/components/agent-transcript-viewer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,17 @@ export class AgentTranscriptViewer implements Component {
335335

336336
#messagesFromEntries(entries: readonly FileEntry[]): AgentMessage[] {
337337
const sessionEntries = entries.filter(isSessionEntry);
338+
// Display semantics differ from LLM context: a parked/advisor transcript must
339+
// keep pending (resultless) tool calls visible. buildSessionContext strips
340+
// dangling tool_use blocks, so only route through it when a compaction is
341+
// present (where collapse is required); otherwise map messages verbatim.
342+
if (!sessionEntries.some(entry => entry.type === "compaction")) {
343+
const messages: AgentMessage[] = [];
344+
for (const entry of sessionEntries) {
345+
if (entry.type === "message") messages.push(entry.message);
346+
}
347+
return messages;
348+
}
338349
return buildSessionContext(sessionEntries, undefined, undefined, {
339350
transcript: true,
340351
collapseCompactedHistory: true,

0 commit comments

Comments
 (0)