From cba3f0d80fd707d28d57736f483eb1a154e68bc6 Mon Sep 17 00:00:00 2001 From: dino Date: Thu, 30 Oct 2025 23:14:07 +0000 Subject: [PATCH] chore(magic_palette): add action description to prompt --- crates/magic_palette/src/magic_palette.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/magic_palette/src/magic_palette.rs b/crates/magic_palette/src/magic_palette.rs index ce71472860cdac6354b28e15c08198abfa6e33de..022ab47493e8536964e719cff13e56c9661b0a13 100644 --- a/crates/magic_palette/src/magic_palette.rs +++ b/crates/magic_palette/src/magic_palette.rs @@ -163,8 +163,9 @@ impl PickerDelegate for MagicPaletteDelegate { }; let temperature = AgentSettings::temperature_for_model(&model, cx); let query = self.query.clone(); - let actions = window.available_actions(cx); self.llm_generation_task = cx.spawn_in(window, async move |this, cx| { + let actions = cx.update(|_, cx| cx.action_documentation().clone())?; + if let Some(task) = cx.update(|_, cx| { if !provider.is_authenticated(cx) { Some(provider.authenticate(cx)) @@ -177,8 +178,8 @@ impl PickerDelegate for MagicPaletteDelegate { let actions = actions .into_iter() - .map(|actions| actions.name()) - .collect::>(); + .map(|(name, descriptiopn)| format!("{} – {}", name, descriptiopn)) + .collect::>(); let actions = actions.join("\n"); let prompt = format!( "You are helping a user find the most relevant actions in Zed editor based on their natural language query.