Inline assistant: Clear failure text when regenerating (#44911)

Michael Benfield created

Release Notes:

- N/A

Change summary

crates/agent_ui/src/buffer_codegen.rs | 3 +++
1 file changed, 3 insertions(+)

Detailed changes

crates/agent_ui/src/buffer_codegen.rs 🔗

@@ -409,6 +409,9 @@ impl CodegenAlternative {
         model: Arc<dyn LanguageModel>,
         cx: &mut Context<Self>,
     ) -> Result<()> {
+        // Clear the model explanation since the user has started a new generation.
+        self.description = None;
+
         if let Some(transformation_transaction_id) = self.transformation_transaction_id.take() {
             self.buffer.update(cx, |buffer, cx| {
                 buffer.undo_transaction(transformation_transaction_id, cx);