diff --git a/crates/arc-workflows/src/hook/executor.rs b/crates/arc-workflows/src/hook/executor.rs index 675af329b..45df35cb4 100644 --- a/crates/arc-workflows/src/hook/executor.rs +++ b/crates/arc-workflows/src/hook/executor.rs @@ -96,7 +96,7 @@ impl HookExecutorImpl { return decision; } HookDecision::Block { - reason: Some(format!("hook exited with code 2")), + reason: Some("hook exited with code 2".to_string()), } } else { HookDecision::Block { diff --git a/crates/arc-workflows/src/hook/types.rs b/crates/arc-workflows/src/hook/types.rs index de23529e9..6bd99471b 100644 --- a/crates/arc-workflows/src/hook/types.rs +++ b/crates/arc-workflows/src/hook/types.rs @@ -108,9 +108,10 @@ pub struct PromptHookResponse { } /// Decision returned by blocking hooks. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "decision", rename_all = "snake_case")] pub enum HookDecision { + #[default] Proceed, Skip { #[serde(default)] @@ -125,11 +126,6 @@ pub enum HookDecision { }, } -impl Default for HookDecision { - fn default() -> Self { - Self::Proceed - } -} impl HookDecision { /// Merge two decisions. Block > Skip/Override > Proceed. diff --git a/crates/arc-workflows/src/parser/semantic.rs b/crates/arc-workflows/src/parser/semantic.rs index 04ec5e382..93f55e275 100644 --- a/crates/arc-workflows/src/parser/semantic.rs +++ b/crates/arc-workflows/src/parser/semantic.rs @@ -109,7 +109,7 @@ impl SemanticState { Self::add_class_to_node(node, cls); } // Legacy: translate codergen_mode to type if type is not explicitly set - if node.attrs.get("type").is_none() { + if !node.attrs.contains_key("type") { if let Some(mode) = node.attrs.get("codergen_mode").and_then(AttrValue::as_str) { let mapped = match mode { "one_shot" => "prompt",