Avoid cloning deferred TUI lifecycle payloads (#34347)

## What changed

- Move lifecycle and approval payloads into either the interrupt queue or the
  immediate handler instead of cloning them for both branches.
- Borrow MCP elicitation request metadata while constructing the corresponding
  form, and consume apply-patch changes after collecting notification paths.

## Testing

- Add a history replay test confirming deferred MCP start and completion events
  remain FIFO after streaming finishes.

GitOrigin-RevId: 84ed34f6ff173463a1da016dc140405392c0ba45
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-20 13:54:11 +00:00
1 parent 2244d11a1d
commit ada5a79ddf
7 files changed
+111 -52

No files matched your search

@@ -44,10 +44,10 @@ impl ChatWidget {
return;
}
}
let item2 = item.clone();
self.defer_or_handle(
|q| q.push_item_started(item),
|s| s.handle_command_execution_started_now(item2),
item,
InterruptManager::push_item_started,
Self::handle_command_execution_started_now,
);
}
@@ -155,10 +155,10 @@ impl ChatWidget {
return;
}
}
let item2 = item.clone();
self.defer_or_handle(
|q| q.push_item_completed(item),
|s| s.handle_command_execution_completed_now(item2),
item,
InterruptManager::push_item_completed,
Self::handle_command_execution_completed_now,
);
}