"Editing file" label spins forever on an abandoned tool step (compact tool summary ignores session liveness)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
Residual noted while fixing the work-block rail in PR #6536 (Slice C). Out of scope there because it lives in the shared compact tool summary, not in the focus-mode block, and it affects every variant.
## Problem
`labelForStatus` in `desktop/src/features/agents/ui/agentSessionToolSummary.ts` derives its present-tense label from the item's raw status alone:
```ts
const running = item.status === "executing" || item.status === "pending";
...
if (descriptor.groupKey === "file-edit:str_replace") {
if (failed) return "Edit failed";
if (running) return "Editing file"; // <-- no liveness check
return "Edited file";
}
```
A tool item keeps `executing` **permanently** if the agent dies mid-step — nothing ever transitions it. So reopening old history shows "Editing file" for an edit that stopped happening days ago, in the present tense, indefinitely.
This is the same bug class already fixed for the work-block rail in #6536. There, `toolEntryState` (`agentSessionWorkBlockGrouping.ts:279`) takes `liveTurnId` and only reports `running` when a live turn actually owns the step:
```ts
return liveTurnId !== null && item.turnId === liveTurnId ? "running" : "settled";
```
`buildCompactToolSummary` has no equivalent gate, so the same abandoned step that correctly renders as settled on the rail still claims to be in progress wherever the compact summary is used.
## Scope
`buildCompactToolSummary` has several callers (`AgentSessionTranscriptList.tsx`, `AgentSessionToolItem/ToolItem.tsx`, `CompactToolSummaryRow.tsx`, `agentSessionTranscriptPresentation.ts`), so a fix needs to thread liveness to all of them, or resolve the label at a boundary that already knows it.
Worth checking whether other present-tense labels have the same problem — the `file-edit:str_replace` branch is the one with an explicit present-tense string, but `if (running) return label` returns the descriptor's own label, which may also read as in-progress.
Suggested approach: make the liveness argument **required** rather than optional, matching the decision in `projectWorkBlockEntries` — a default lets a caller that has not thought about liveness silently get the spins-forever behaviour.
Contributor guide
Research direction
Start with labelForStatus and buildCompactToolSummary in desktop/src/features/agents/ui/agentSessionToolSummary.ts, then trace callers in AgentSessionTranscriptList.tsx, AgentSessionToolItem/ToolItem.tsx, CompactToolSummaryRow.tsx, and agentSessionTranscriptPresentation.ts. Compare the liveness handling with toolEntryState in agentSessionWorkBlockGrouping.ts:279. Done means abandoned executing steps no longer show present-tense labels in any compact summary variant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100