From 7b9df57a354b31f10fdeee25e643d47da65dadc8 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:48:00 +0100 Subject: [PATCH] agent_ui: Clear original agent prompt when creating a new worktree (#51839) Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --- crates/agent_ui/src/agent_panel.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 7e7aca1c25a0db1acf97be92c7889049ab05b339..41f2092f251c95ab2964a24557ffd24753ddfdb5 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -3021,8 +3021,17 @@ impl AgentPanel { multi_workspace.activate(new_workspace.clone(), cx); })?; - this.update_in(cx, |this, _window, cx| { + this.update_in(cx, |this, window, cx| { this.worktree_creation_status = None; + + if let Some(thread_view) = this.active_thread_view(cx) { + thread_view.update(cx, |thread_view, cx| { + thread_view + .message_editor + .update(cx, |editor, cx| editor.clear(window, cx)); + }); + } + cx.notify(); })?;