chore: standardize executor type naming to kebab-case (#209)

This commit is contained in:
Solomon
2025-07-16 16:33:27 +01:00
committed by GitHub
parent 471d28defd
commit 5e60e65e27
8 changed files with 42 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
-- Migration to update executor type names from snake_case/camelCase to kebab-case
-- This handles the change from charmopencode -> charm-opencode and setup_script -> setup-script
-- Update task_attempts.executor column
UPDATE task_attempts
SET executor = 'charm-opencode'
WHERE executor = 'charmopencode';
UPDATE task_attempts
SET executor = 'setup-script'
WHERE executor = 'setup_script';
-- Update execution_processes.executor_type column
UPDATE execution_processes
SET executor_type = 'charm-opencode'
WHERE executor_type = 'charmopencode';
UPDATE execution_processes
SET executor_type = 'setup-script'
WHERE executor_type = 'setup_script';

View File

@@ -10,7 +10,7 @@ export const EXECUTOR_TYPES: string[] = [
"claude", "claude",
"amp", "amp",
"gemini", "gemini",
"charmopencode", "charm-opencode",
"claude-code-router" "claude-code-router"
]; ];
@@ -28,7 +28,7 @@ export const EXECUTOR_LABELS: Record<string, string> = {
"claude": "Claude", "claude": "Claude",
"amp": "Amp", "amp": "Amp",
"gemini": "Gemini", "gemini": "Gemini",
"charmopencode": "Charm Opencode", "charm-opencode": "Charm Opencode",
"claude-code-router": "Claude Code Router" "claude-code-router": "Claude Code Router"
}; };

View File

@@ -342,19 +342,19 @@ pub enum ExecutorType {
/// Configuration for different executor types /// Configuration for different executor types
#[derive(Debug, Clone, Serialize, Deserialize, TS)] #[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(tag = "type", rename_all = "lowercase")] #[serde(tag = "type", rename_all = "kebab-case")]
#[ts(export)] #[ts(export)]
pub enum ExecutorConfig { pub enum ExecutorConfig {
Echo, Echo,
Claude, Claude,
Amp, Amp,
Gemini, Gemini,
#[serde(alias = "setup_script")]
SetupScript { SetupScript {
script: String, script: String,
}, },
#[serde(rename = "claude-code-router")]
#[ts(rename = "claude-code-router")]
ClaudeCodeRouter, ClaudeCodeRouter,
#[serde(alias = "charmopencode")]
CharmOpencode, CharmOpencode,
// Future executors can be added here // Future executors can be added here
// Shell { command: String }, // Shell { command: String },
@@ -378,9 +378,9 @@ impl FromStr for ExecutorConfig {
"claude" => Ok(ExecutorConfig::Claude), "claude" => Ok(ExecutorConfig::Claude),
"amp" => Ok(ExecutorConfig::Amp), "amp" => Ok(ExecutorConfig::Amp),
"gemini" => Ok(ExecutorConfig::Gemini), "gemini" => Ok(ExecutorConfig::Gemini),
"charmopencode" => Ok(ExecutorConfig::CharmOpencode), "charm-opencode" => Ok(ExecutorConfig::CharmOpencode),
"claude-code-router" => Ok(ExecutorConfig::ClaudeCodeRouter), "claude-code-router" => Ok(ExecutorConfig::ClaudeCodeRouter),
"setup_script" => Ok(ExecutorConfig::SetupScript { "setup-script" => Ok(ExecutorConfig::SetupScript {
script: "setup script".to_string(), script: "setup script".to_string(),
}), }),
_ => Err(format!("Unknown executor type: {}", s)), _ => Err(format!("Unknown executor type: {}", s)),
@@ -464,9 +464,9 @@ impl std::fmt::Display for ExecutorConfig {
ExecutorConfig::Claude => "claude", ExecutorConfig::Claude => "claude",
ExecutorConfig::Amp => "amp", ExecutorConfig::Amp => "amp",
ExecutorConfig::Gemini => "gemini", ExecutorConfig::Gemini => "gemini",
ExecutorConfig::CharmOpencode => "charmopencode", ExecutorConfig::CharmOpencode => "charm-opencode",
ExecutorConfig::ClaudeCodeRouter => "claude-code-router", ExecutorConfig::ClaudeCodeRouter => "claude-code-router",
ExecutorConfig::SetupScript { .. } => "setup_script", ExecutorConfig::SetupScript { .. } => "setup-script",
}; };
write!(f, "{}", s) write!(f, "{}", s)
} }

View File

@@ -122,7 +122,7 @@ impl Executor for SetupScriptExecutor {
Ok(crate::executor::NormalizedConversation { Ok(crate::executor::NormalizedConversation {
entries, entries,
session_id: None, session_id: None,
executor_type: "setup_script".to_string(), executor_type: "setup-script".to_string(),
prompt: Some(self.script.clone()), prompt: Some(self.script.clone()),
summary: None, summary: None,
}) })

View File

@@ -1331,7 +1331,7 @@ pub async fn get_execution_process_normalized_logs(
// Create final normalized conversation // Create final normalized conversation
let executor_type = if process.process_type == ExecutionProcessType::SetupScript { let executor_type = if process.process_type == ExecutionProcessType::SetupScript {
"setup_script".to_string() "setup-script".to_string()
} else { } else {
process process
.executor_type .executor_type

View File

@@ -639,7 +639,7 @@ impl ProcessService {
Some("claude-code-router") => crate::executor::ExecutorConfig::ClaudeCodeRouter, Some("claude-code-router") => crate::executor::ExecutorConfig::ClaudeCodeRouter,
Some("amp") => crate::executor::ExecutorConfig::Amp, Some("amp") => crate::executor::ExecutorConfig::Amp,
Some("gemini") => crate::executor::ExecutorConfig::Gemini, Some("gemini") => crate::executor::ExecutorConfig::Gemini,
Some("charmopencode") => crate::executor::ExecutorConfig::CharmOpencode, Some("charm-opencode") => crate::executor::ExecutorConfig::CharmOpencode,
_ => crate::executor::ExecutorConfig::Echo, // Default for "echo" or None _ => crate::executor::ExecutorConfig::Echo, // Default for "echo" or None
} }
} }
@@ -657,8 +657,8 @@ impl ProcessService {
let (command, args, executor_type_string) = match executor_type { let (command, args, executor_type_string) = match executor_type {
crate::executor::ExecutorType::SetupScript(_) => ( crate::executor::ExecutorType::SetupScript(_) => (
shell_cmd.to_string(), shell_cmd.to_string(),
Some(serde_json::to_string(&[shell_arg, "setup_script"]).unwrap()), Some(serde_json::to_string(&[shell_arg, "setup-script"]).unwrap()),
None, // Setup scripts don't have an executor type Some("setup-script".to_string()),
), ),
crate::executor::ExecutorType::DevServer(_) => ( crate::executor::ExecutorType::DevServer(_) => (
shell_cmd.to_string(), shell_cmd.to_string(),
@@ -885,7 +885,7 @@ impl ProcessService {
// Store delegation context in args for execution monitor to read // Store delegation context in args for execution monitor to read
let args_with_delegation = serde_json::json!([ let args_with_delegation = serde_json::json!([
shell_arg, shell_arg,
"setup_script", "setup-script",
"--delegation-context", "--delegation-context",
delegation_context.to_string() delegation_context.to_string()
]); ]);
@@ -893,7 +893,7 @@ impl ProcessService {
let create_process = CreateExecutionProcess { let create_process = CreateExecutionProcess {
task_attempt_id: attempt_id, task_attempt_id: attempt_id,
process_type: ExecutionProcessType::SetupScript, process_type: ExecutionProcessType::SetupScript,
executor_type: None, // Setup scripts don't have an executor type executor_type: Some("setup-script".to_string()),
command: shell_cmd.to_string(), command: shell_cmd.to_string(),
args: Some(args_with_delegation.to_string()), args: Some(args_with_delegation.to_string()),
working_directory: worktree_path.to_string(), working_directory: worktree_path.to_string(),

View File

@@ -98,8 +98,10 @@ export function OnboardingDialog({ open, onComplete }: OnboardingDialogProps) {
{executor.type === 'claude' && 'Claude Code from Anthropic'} {executor.type === 'claude' && 'Claude Code from Anthropic'}
{executor.type === 'amp' && 'From Sourcegraph'} {executor.type === 'amp' && 'From Sourcegraph'}
{executor.type === 'gemini' && 'Google Gemini from Bloop'} {executor.type === 'gemini' && 'Google Gemini from Bloop'}
{executor.type === 'charmopencode' && {executor.type === 'charm-opencode' &&
'Charm/Opencode AI assistant'} 'Charm/Opencode AI assistant'}
{executor.type === 'claude-code-router' &&
'Claude Code Router'}
{executor.type === 'echo' && {executor.type === 'echo' &&
'This is just for debugging vibe-kanban itself'} 'This is just for debugging vibe-kanban itself'}
</p> </p>

View File

@@ -22,7 +22,7 @@ export type SoundConstants = { sound_files: Array<SoundFile>, sound_labels: Arra
export type ConfigConstants = { editor: EditorConstants, sound: SoundConstants, }; export type ConfigConstants = { editor: EditorConstants, sound: SoundConstants, };
export type ExecutorConfig = { "type": "echo" } | { "type": "claude" } | { "type": "amp" } | { "type": "gemini" } | { "type": "setupscript", script: string, } | { "type": "claude-code-router" } | { "type": "charmopencode" }; export type ExecutorConfig = { "type": "echo" } | { "type": "claude" } | { "type": "amp" } | { "type": "gemini" } | { "type": "setup-script", script: string, } | { "type": "claude-code-router" } | { "type": "charm-opencode" };
export type ExecutorConstants = { executor_types: Array<ExecutorConfig>, executor_labels: Array<string>, }; export type ExecutorConstants = { executor_types: Array<ExecutorConfig>, executor_labels: Array<string>, };
@@ -128,7 +128,7 @@ export const EXECUTOR_TYPES: string[] = [
"claude", "claude",
"amp", "amp",
"gemini", "gemini",
"charmopencode", "charm-opencode",
"claude-code-router" "claude-code-router"
]; ];
@@ -146,7 +146,7 @@ export const EXECUTOR_LABELS: Record<string, string> = {
"claude": "Claude", "claude": "Claude",
"amp": "Amp", "amp": "Amp",
"gemini": "Gemini", "gemini": "Gemini",
"charmopencode": "Charm Opencode", "charm-opencode": "Charm Opencode",
"claude-code-router": "Claude Code Router" "claude-code-router": "Claude Code Router"
}; };