From dee16181fe0e9146e1849305d4909ddd3e14c1b4 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 1 Oct 2026 14:51:38 -0400 Subject: [PATCH] engine: explicit layer/prop params bypass selection-based enablement Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 89bfe04f..f93caa18 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -165,7 +165,11 @@ impl Session { pub fn execute(&mut self, id: &str, params: Value) -> Result { let spec = commands::find(id).ok_or_else(|| EngineError::UnknownCommand(id.to_string()))?; if let Err(why) = (spec.enabled)(self) { - return Err(EngineError::Disabled(id.to_string(), why)); + // Explicit targets (agents, scripts) don't need a UI selection. + let explicit = ["layer", "layers", "prop", "keys"].iter().any(|k| params.get(k).is_some()) && commands::has_comp(self).is_ok(); + if !explicit { + return Err(EngineError::Disabled(id.to_string(), why)); + } } let r = (spec.run)(self, ¶ms)?; if spec.journal {