From d58197cca4e7fbf8ffba048b2652e3ad1eef6cc9 Mon Sep 17 00:00:00 2001 From: TheArchitectit Date: Wed, 3 Jun 2026 14:24:41 -0500 Subject: [PATCH] fix: update slash command count and add /setup assertion in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update slash_command_specs().len() assertion from 139 to 140. The /setup command added by this PR increased the spec count by 1 but the test's expected count was not updated, causing CI failure. - Add assert!(help.contains("/setup")) to the renders_help_from_shared_specs test so the new command is verified in the help output. Fixes CI Build ❌ and Test ❌ on #3218. --- rust/crates/commands/src/lib.rs | 3 +- rust/crates/runtime/src/config.rs | 51 +++++++++++++++++-------------- rust/crates/runtime/src/lib.rs | 17 ++++++----- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs index 9580157f..79086913 100644 --- a/rust/crates/commands/src/lib.rs +++ b/rust/crates/commands/src/lib.rs @@ -6011,7 +6011,8 @@ mod tests { assert!(help.contains("aliases: /skill")); assert!(!help.contains("/login")); assert!(!help.contains("/logout")); - assert_eq!(slash_command_specs().len(), 139); + assert!(help.contains("/setup")); + assert_eq!(slash_command_specs().len(), 140); assert!(resume_supported_slash_commands().len() >= 39); } diff --git a/rust/crates/runtime/src/config.rs b/rust/crates/runtime/src/config.rs index 0c56d546..95057563 100644 --- a/rust/crates/runtime/src/config.rs +++ b/rust/crates/runtime/src/config.rs @@ -167,6 +167,29 @@ pub struct RuntimeFeatureConfig { /// Controls which external AI coding framework rules are imported into the system prompt. #[derive(Debug, Clone, PartialEq, Eq, Default)] +pub enum RulesImportConfig { + /// Import from all supported frameworks when files are detected. + #[default] + Auto, + /// Do not import external framework rules; keep Claw instruction files only. + None, + /// Import only the named frameworks. + List(Vec), +} + +impl RulesImportConfig { + #[must_use] + pub fn should_import(&self, framework: &str) -> bool { + match self { + Self::Auto => true, + Self::None => false, + Self::List(frameworks) => frameworks + .iter() + .any(|candidate| candidate.eq_ignore_ascii_case(framework)), + } + } +} + /// Stored provider configuration from the setup wizard. /// /// Represents the `provider` section in `~/.claw/settings.json`, used as a @@ -202,29 +225,6 @@ impl RuntimeProviderConfig { } } -pub enum RulesImportConfig { - /// Import from all supported frameworks when files are detected. - #[default] - Auto, - /// Do not import external framework rules; keep Claw instruction files only. - None, - /// Import only the named frameworks. - List(Vec), -} - -impl RulesImportConfig { - #[must_use] - pub fn should_import(&self, framework: &str) -> bool { - match self { - Self::Auto => true, - Self::None => false, - Self::List(frameworks) => frameworks - .iter() - .any(|candidate| candidate.eq_ignore_ascii_case(framework)), - } - } -} - /// Ordered chain of fallback model identifiers used when the primary /// provider returns a retryable failure (429/500/503/etc.). The chain is /// strict: each entry is tried in order until one succeeds. @@ -915,6 +915,11 @@ impl RuntimeConfig { &self.feature_config.rules_import } + #[must_use] + pub fn provider(&self) -> &RuntimeProviderConfig { + &self.feature_config.provider + } + /// Merge config-level default trusted roots with per-call roots. /// /// Config roots are defaults and are kept first; per-call roots extend the diff --git a/rust/crates/runtime/src/lib.rs b/rust/crates/runtime/src/lib.rs index 6193527b..674d8925 100644 --- a/rust/crates/runtime/src/lib.rs +++ b/rust/crates/runtime/src/lib.rs @@ -66,12 +66,14 @@ pub use compact::{ }; pub use config::{ clear_user_provider_settings, default_config_home, save_user_provider_settings, - suppress_config_warnings_for_json_mode, ConfigEntry, ConfigError, ConfigLoader, ConfigSource, - McpConfigCollection, McpManagedProxyServerConfig, McpOAuthConfig, McpRemoteServerConfig, - McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport, + suppress_config_warnings_for_json_mode, ApiTimeoutConfig, ConfigEntry, ConfigError, + ConfigFileReport, ConfigFileStatus, ConfigInspection, ConfigLoader, ConfigSource, + McpConfigCollection, McpInvalidServerConfig, McpManagedProxyServerConfig, McpOAuthConfig, + McpRemoteServerConfig, McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport, McpWebSocketServerConfig, OAuthConfig, ProviderFallbackConfig, ResolvedPermissionMode, - RuntimeConfig, RuntimeFeatureConfig, RuntimeHookConfig, RuntimePermissionRuleConfig, - RuntimePluginConfig, RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME, + RulesImportConfig, RuntimeConfig, RuntimeFeatureConfig, RuntimeHookCommand, RuntimeHookConfig, + RuntimeInvalidHookConfig, RuntimePermissionRuleConfig, RuntimePluginConfig, + RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME, }; pub use config_validate::{ check_unsupported_format, format_diagnostics, validate_config_file, ConfigDiagnostic, @@ -142,8 +144,9 @@ pub use policy_engine::{ PolicyEvaluation, PolicyRule, ReconcileReason, ReviewStatus, }; pub use prompt::{ - load_system_prompt, prepend_bullets, ContextFile, ModelFamilyIdentity, ProjectContext, - PromptBuildError, SystemPromptBuilder, FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY, + load_system_prompt, load_system_prompt_with_context, prepend_bullets, ContextFile, + ModelFamilyIdentity, ProjectContext, PromptBuildError, SystemPromptBuilder, + FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY, }; pub use recovery_recipes::{ attempt_recovery, recipe_for, EscalationPolicy, FailureScenario, RecoveryAttemptState,