Stop showing the held tool call as running during a pause

This commit is contained in:
Ian Gulliver
2026-10-22 22:14:19 -07:00
parent 293c21ca8c
commit 11e21bcf18
6 changed files with 42 additions and 12 deletions
+5 -2
View File
@@ -1334,7 +1334,7 @@ struct RowView: View {
} content: {
VStack(alignment: .leading, spacing: 6) {
PreBox(text: input)
ToolResult(result: row.result, unfinished: row.unfinished, started: row.started)
ToolResult(result: row.result, unfinished: row.unfinished, held: row.held, started: row.started)
}
.padding(.vertical, 6)
}
@@ -1350,7 +1350,7 @@ struct RowView: View {
ForEach(row.body!.rows) { child in
RowView(row: child, model: model, nested: true)
}
ToolResult(result: row.result, unfinished: row.unfinished, started: row.started)
ToolResult(result: row.result, unfinished: row.unfinished, held: row.held, started: row.started)
}
}
@@ -1703,11 +1703,14 @@ private struct DiscussItem: View {
private struct ToolResult: View {
let result: String?
let unfinished: Bool
let held: Bool
let started: Date?
var body: some View {
if let result {
PreBox(text: result)
} else if held {
label("held by pause")
} else if unfinished || started == nil {
label(unfinished ? "no result" : "running…")
} else {
+14 -1
View File
@@ -78,6 +78,7 @@ final class Row: Identifiable {
var tag = false
var result: String?
var unfinished = false
var held = false
var started: Date?
var status = "starting…"
var statusState = SubagentState.running
@@ -97,7 +98,7 @@ final class Row: Identifiable {
var pending: Bool {
switch kind {
case .tool, .subagent:
return result == nil && !unfinished
return result == nil && !unfinished && !held
case .group:
return body!.rows.contains { $0.pending }
default:
@@ -590,6 +591,18 @@ final class TranscriptBuilder {
ctx.questions[item.id]?.question = item
continue
}
if ev.kind == "agent.held" {
ctx.tools[jsString(p["tool_use_id"])]?.held = true
continue
}
if ev.kind == "session.paused" {
if !bool(p, "paused") {
for tool in ctx.tools.values {
tool.held = false
}
}
continue
}
let sub = ctx.subagents[parent]
if ev.kind == "agent.tool_call" && isSubagentCall(p) {
let row = renderSubagent(p, parent)