@@ -390,6 +390,7 @@ const Tui = struct {
390390 self.phase = p.phase;
391391 self.keepName(&self.detail, p.detail);
392392 if (p.phase == .pausing) self.paused = true;
393+ if (p.phase == .running_tool) self.renderPendingCall();
393394 if (p.phase == .waiting_model) {
394395 self.stream_kind = .none;
395396 self.text_bytes = 0;
@@ -481,16 +482,32 @@ const Tui = struct {
481482 }
482483 }
483484
484- fn commitToolResult(self: *Tui, name: []const u8, text: []const u8, is_error: bool, diffs: []const tools_index.FileDiff, body: ?[]const u8, images: []const message_mod.ImageContent) void {
485+ fn renderPendingCall(self: *Tui) void {
486+ if (self.pending_calls.items.len == 0) return;
487+ const call = &self.pending_calls.items[0];
488+ if (call.rendered) return;
485489 self.scrollback.separator = true;
490+ self.commitLines(tool_view.callBody(self.s, call.name, call.summary));
491+ call.rendered = true;
492+ }
493+
494+ fn commitToolResult(self: *Tui, name: []const u8, text: []const u8, is_error: bool, diffs: []const tools_index.FileDiff, body: ?[]const u8, images: []const message_mod.ImageContent) void {
486495 const shown = render.stripAnsi(self.s, text);
487496 const meta: ?[]const u8 = if (!is_error) body else null;
497+ var head_committed = false;
488498 if (self.pending_calls.items.len > 0) {
489499 const call = self.pending_calls.orderedRemove(0);
490- self.commitLines(tool_view.callBody(self.s, call.name, call.summary, meta));
500+ head_committed = true;
501+ if (!call.rendered) {
502+ self.scrollback.separator = true;
503+ self.commitLines(tool_view.callBody(self.s, call.name, call.summary));
504+ }
491505 }
506+ if (!head_committed) self.scrollback.separator = true;
492507 if (self.cfg.show_images) self.commitImages(images);
493- if (meta == null) {
508+ if (meta) |m| {
509+ self.push(tool_view.metaLine(self.s, m));
510+ } else {
494511 const width = @max(self.term.width() - BODY_PREFIX.len, 1);
495512 const is_bash = std.mem.eql(u8, name, "bash");
496513 const bash_exit: ?[]const u8 = if (is_bash) tool_view.exitLine(self.s, shown) else null;
@@ -529,8 +546,9 @@ const Tui = struct {
529546
530547 fn flushCalls(self: *Tui) void {
531548 for (self.pending_calls.items) |call| {
549+ if (call.rendered) continue;
532550 self.scrollback.separator = true;
533- self.commitLines(tool_view.callBody(self.s, call.name, call.summary, null));
551+ self.commitLines(tool_view.callBody(self.s, call.name, call.summary));
534552 }
535553 self.pending_calls.clearRetainingCapacity();
536554 _ = self.calls.reset(.retain_capacity);