fix: remove duplicate meta_type and replace meta_name with meta_type

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 21:17:48 -03:00
parent e279af07d3
commit fc54b8ff8f
5 changed files with 11 additions and 8 deletions

View File

@@ -110,7 +110,7 @@ pub fn generate_status_info(
// Get meta name first to avoid borrowing issues
log::debug!("STATUS: Getting meta name...");
let meta_name = meta_plugin.meta_name();
let meta_name = meta_plugin.meta_type().to_string();
log::debug!("STATUS: Got meta name: {}", meta_name);
// Note: In status mode we don't have access to actual settings,

View File

@@ -3,7 +3,7 @@ use std::io::Write;
use std::process::{Command, Stdio, Child};
use which::which;
use crate::meta_plugin::{MetaPlugin, MetaPluginResponse};
use crate::meta_plugin::{MetaPlugin, MetaPluginResponse, MetaPluginType};
pub struct MetaPluginCommand {
pub program: String,
@@ -23,7 +23,6 @@ impl std::fmt::Debug for MetaPluginCommand {
.field("program", &self.program)
.field("args", &self.args)
.field("supported", &self.supported)
.field("meta_name", &self.meta_name)
.field("split_whitespace", &self.split_whitespace)
.field("process", &self.process)
.field("writer", &"Box<dyn Write>")

View File

@@ -95,6 +95,12 @@ impl BaseMetaPlugin {
}
impl MetaPlugin for BaseMetaPlugin {
fn meta_type(&self) -> MetaPluginType {
// This is a base implementation, so we need to return something
// This might not be used, but we need to satisfy the trait
MetaPluginType::Binary
}
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
&self.outputs
}
@@ -214,8 +220,6 @@ pub trait MetaPlugin where Self: 'static {
is_finalized: true,
}
}
fn meta_type(&self) -> MetaPluginType;
// Get program information for display in status
fn program_info(&self) -> Option<(&str, Vec<&str>)> {
@@ -291,7 +295,7 @@ pub fn get_meta_plugin(
// For command type, we need to parse the command from options
let mut program_name = String::new();
let mut args = Vec::new();
let meta_name = MetaPluginType::Command.to_string();
let mut meta_name = MetaPluginType::Command.to_string();
let mut split_whitespace = true;
if let Some(opts) = &options {

View File

@@ -149,7 +149,7 @@ pub fn settings_meta_plugin_types(cmd: &mut Command, settings: &config::Settings
let mut found = false;
for meta_plugin_type in MetaPluginType::iter() {
let meta_plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type.clone(), None, None);
if meta_plugin.meta_name() == trimmed_name {
if meta_plugin.meta_type().to_string() == trimmed_name {
meta_plugin_types.push(meta_plugin_type);
found = true;
break;

View File

@@ -87,7 +87,7 @@ impl MetaService {
let mut output_names: std::collections::HashMap<String, Vec<String>> = std::collections::HashMap::new();
for plugin in plugins.iter() {
let plugin_name = plugin.meta_name();
let plugin_name = plugin.meta_type().to_string();
// For each plugin, collect all the output names it might write to
for (internal_name, output_config) in plugin.outputs() {
let output_name = match output_config {