fix: prevent stack overflow in status mode and remove unused variables
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -93,18 +93,18 @@ pub fn generate_status_info(
|
|||||||
|
|
||||||
let mut meta_plugin_info = Vec::new();
|
let mut meta_plugin_info = Vec::new();
|
||||||
|
|
||||||
// Sort meta plugin types by their meta name
|
// Sort meta plugin types by their string representation to avoid creating plugins just for sorting
|
||||||
let mut sorted_meta_plugins: Vec<MetaPluginType> = MetaPluginType::iter().collect();
|
let mut sorted_meta_plugins: Vec<MetaPluginType> = MetaPluginType::iter().collect();
|
||||||
sorted_meta_plugins.sort_by_key(|meta_plugin_type| {
|
sorted_meta_plugins.sort_by_key(|meta_plugin_type| meta_plugin_type.to_string());
|
||||||
let mut meta_plugin = meta_plugin::get_meta_plugin(meta_plugin_type.clone());
|
|
||||||
meta_plugin.meta_name()
|
|
||||||
});
|
|
||||||
|
|
||||||
for meta_plugin_type in sorted_meta_plugins {
|
for meta_plugin_type in sorted_meta_plugins {
|
||||||
let mut meta_plugin = meta_plugin::get_meta_plugin(meta_plugin_type.clone());
|
let mut meta_plugin = meta_plugin::get_meta_plugin(meta_plugin_type.clone());
|
||||||
let is_supported = meta_plugin.is_supported();
|
let is_supported = meta_plugin.is_supported();
|
||||||
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
||||||
|
|
||||||
|
// Get meta name first to avoid borrowing issues
|
||||||
|
let meta_name = meta_plugin.meta_name();
|
||||||
|
|
||||||
// Note: In status mode we don't have access to actual settings,
|
// Note: In status mode we don't have access to actual settings,
|
||||||
// so we can't configure plugins with their settings here.
|
// so we can't configure plugins with their settings here.
|
||||||
// Plugin configuration happens during save operations.
|
// Plugin configuration happens during save operations.
|
||||||
@@ -137,7 +137,7 @@ pub fn generate_status_info(
|
|||||||
};
|
};
|
||||||
|
|
||||||
meta_plugin_info.push(MetaPluginInfo {
|
meta_plugin_info.push(MetaPluginInfo {
|
||||||
meta_name: meta_plugin.meta_name(),
|
meta_name,
|
||||||
found: is_supported,
|
found: is_supported,
|
||||||
enabled: is_enabled,
|
enabled: is_enabled,
|
||||||
binary: binary_display,
|
binary: binary_display,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ impl MetaPluginProgram {
|
|||||||
args: Vec<&str>,
|
args: Vec<&str>,
|
||||||
meta_name: String,
|
meta_name: String,
|
||||||
split_whitespace: bool,
|
split_whitespace: bool,
|
||||||
options: Option<std::collections::HashMap<String, serde_yaml::Value>>,
|
_options: Option<std::collections::HashMap<String, serde_yaml::Value>>,
|
||||||
outputs: Option<std::collections::HashMap<String, serde_yaml::Value>>,
|
outputs: Option<std::collections::HashMap<String, serde_yaml::Value>>,
|
||||||
) -> MetaPluginProgram {
|
) -> MetaPluginProgram {
|
||||||
let program_path = which(program);
|
let program_path = which(program);
|
||||||
|
|||||||
Reference in New Issue
Block a user