chore: standardize executor type naming to kebab-case (#209)
This commit is contained in:
@@ -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';
|
||||
@@ -10,7 +10,7 @@ export const EXECUTOR_TYPES: string[] = [
|
||||
"claude",
|
||||
"amp",
|
||||
"gemini",
|
||||
"charmopencode",
|
||||
"charm-opencode",
|
||||
"claude-code-router"
|
||||
];
|
||||
|
||||
@@ -28,7 +28,7 @@ export const EXECUTOR_LABELS: Record<string, string> = {
|
||||
"claude": "Claude",
|
||||
"amp": "Amp",
|
||||
"gemini": "Gemini",
|
||||
"charmopencode": "Charm Opencode",
|
||||
"charm-opencode": "Charm Opencode",
|
||||
"claude-code-router": "Claude Code Router"
|
||||
};
|
||||
|
||||
|
||||
@@ -342,19 +342,19 @@ pub enum ExecutorType {
|
||||
|
||||
/// Configuration for different executor types
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(tag = "type", rename_all = "lowercase")]
|
||||
#[serde(tag = "type", rename_all = "kebab-case")]
|
||||
#[ts(export)]
|
||||
pub enum ExecutorConfig {
|
||||
Echo,
|
||||
Claude,
|
||||
Amp,
|
||||
Gemini,
|
||||
#[serde(alias = "setup_script")]
|
||||
SetupScript {
|
||||
script: String,
|
||||
},
|
||||
#[serde(rename = "claude-code-router")]
|
||||
#[ts(rename = "claude-code-router")]
|
||||
ClaudeCodeRouter,
|
||||
#[serde(alias = "charmopencode")]
|
||||
CharmOpencode,
|
||||
// Future executors can be added here
|
||||
// Shell { command: String },
|
||||
@@ -378,9 +378,9 @@ impl FromStr for ExecutorConfig {
|
||||
"claude" => Ok(ExecutorConfig::Claude),
|
||||
"amp" => Ok(ExecutorConfig::Amp),
|
||||
"gemini" => Ok(ExecutorConfig::Gemini),
|
||||
"charmopencode" => Ok(ExecutorConfig::CharmOpencode),
|
||||
"charm-opencode" => Ok(ExecutorConfig::CharmOpencode),
|
||||
"claude-code-router" => Ok(ExecutorConfig::ClaudeCodeRouter),
|
||||
"setup_script" => Ok(ExecutorConfig::SetupScript {
|
||||
"setup-script" => Ok(ExecutorConfig::SetupScript {
|
||||
script: "setup script".to_string(),
|
||||
}),
|
||||
_ => Err(format!("Unknown executor type: {}", s)),
|
||||
@@ -464,9 +464,9 @@ impl std::fmt::Display for ExecutorConfig {
|
||||
ExecutorConfig::Claude => "claude",
|
||||
ExecutorConfig::Amp => "amp",
|
||||
ExecutorConfig::Gemini => "gemini",
|
||||
ExecutorConfig::CharmOpencode => "charmopencode",
|
||||
ExecutorConfig::CharmOpencode => "charm-opencode",
|
||||
ExecutorConfig::ClaudeCodeRouter => "claude-code-router",
|
||||
ExecutorConfig::SetupScript { .. } => "setup_script",
|
||||
ExecutorConfig::SetupScript { .. } => "setup-script",
|
||||
};
|
||||
write!(f, "{}", s)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ impl Executor for SetupScriptExecutor {
|
||||
Ok(crate::executor::NormalizedConversation {
|
||||
entries,
|
||||
session_id: None,
|
||||
executor_type: "setup_script".to_string(),
|
||||
executor_type: "setup-script".to_string(),
|
||||
prompt: Some(self.script.clone()),
|
||||
summary: None,
|
||||
})
|
||||
|
||||
@@ -1331,7 +1331,7 @@ pub async fn get_execution_process_normalized_logs(
|
||||
|
||||
// Create final normalized conversation
|
||||
let executor_type = if process.process_type == ExecutionProcessType::SetupScript {
|
||||
"setup_script".to_string()
|
||||
"setup-script".to_string()
|
||||
} else {
|
||||
process
|
||||
.executor_type
|
||||
|
||||
@@ -639,7 +639,7 @@ impl ProcessService {
|
||||
Some("claude-code-router") => crate::executor::ExecutorConfig::ClaudeCodeRouter,
|
||||
Some("amp") => crate::executor::ExecutorConfig::Amp,
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -657,8 +657,8 @@ impl ProcessService {
|
||||
let (command, args, executor_type_string) = match executor_type {
|
||||
crate::executor::ExecutorType::SetupScript(_) => (
|
||||
shell_cmd.to_string(),
|
||||
Some(serde_json::to_string(&[shell_arg, "setup_script"]).unwrap()),
|
||||
None, // Setup scripts don't have an executor type
|
||||
Some(serde_json::to_string(&[shell_arg, "setup-script"]).unwrap()),
|
||||
Some("setup-script".to_string()),
|
||||
),
|
||||
crate::executor::ExecutorType::DevServer(_) => (
|
||||
shell_cmd.to_string(),
|
||||
@@ -885,7 +885,7 @@ impl ProcessService {
|
||||
// Store delegation context in args for execution monitor to read
|
||||
let args_with_delegation = serde_json::json!([
|
||||
shell_arg,
|
||||
"setup_script",
|
||||
"setup-script",
|
||||
"--delegation-context",
|
||||
delegation_context.to_string()
|
||||
]);
|
||||
@@ -893,7 +893,7 @@ impl ProcessService {
|
||||
let create_process = CreateExecutionProcess {
|
||||
task_attempt_id: attempt_id,
|
||||
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(),
|
||||
args: Some(args_with_delegation.to_string()),
|
||||
working_directory: worktree_path.to_string(),
|
||||
|
||||
@@ -98,8 +98,10 @@ export function OnboardingDialog({ open, onComplete }: OnboardingDialogProps) {
|
||||
{executor.type === 'claude' && 'Claude Code from Anthropic'}
|
||||
{executor.type === 'amp' && 'From Sourcegraph'}
|
||||
{executor.type === 'gemini' && 'Google Gemini from Bloop'}
|
||||
{executor.type === 'charmopencode' &&
|
||||
{executor.type === 'charm-opencode' &&
|
||||
'Charm/Opencode AI assistant'}
|
||||
{executor.type === 'claude-code-router' &&
|
||||
'Claude Code Router'}
|
||||
{executor.type === 'echo' &&
|
||||
'This is just for debugging vibe-kanban itself'}
|
||||
</p>
|
||||
|
||||
@@ -22,7 +22,7 @@ export type SoundConstants = { sound_files: Array<SoundFile>, sound_labels: Arra
|
||||
|
||||
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>, };
|
||||
|
||||
@@ -128,7 +128,7 @@ export const EXECUTOR_TYPES: string[] = [
|
||||
"claude",
|
||||
"amp",
|
||||
"gemini",
|
||||
"charmopencode",
|
||||
"charm-opencode",
|
||||
"claude-code-router"
|
||||
];
|
||||
|
||||
@@ -146,7 +146,7 @@ export const EXECUTOR_LABELS: Record<string, string> = {
|
||||
"claude": "Claude",
|
||||
"amp": "Amp",
|
||||
"gemini": "Gemini",
|
||||
"charmopencode": "Charm Opencode",
|
||||
"charm-opencode": "Charm Opencode",
|
||||
"claude-code-router": "Claude Code Router"
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user