Stop showing the held tool call as running during a pause
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user