Skip to content

Commit d58197c

Browse files
TheArchitectitYour Name
authored andcommitted
fix: update slash command count and add /setup assertion in test
- 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 ultraworkers#3218.
1 parent 3845040 commit d58197c

3 files changed

Lines changed: 40 additions & 31 deletions

File tree

rust/crates/commands/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6011,7 +6011,8 @@ mod tests {
60116011
assert!(help.contains("aliases: /skill"));
60126012
assert!(!help.contains("/login"));
60136013
assert!(!help.contains("/logout"));
6014-
assert_eq!(slash_command_specs().len(), 139);
6014+
assert!(help.contains("/setup"));
6015+
assert_eq!(slash_command_specs().len(), 140);
60156016
assert!(resume_supported_slash_commands().len() >= 39);
60166017
}
60176018

rust/crates/runtime/src/config.rs

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,29 @@ pub struct RuntimeFeatureConfig {
167167

168168
/// Controls which external AI coding framework rules are imported into the system prompt.
169169
#[derive(Debug, Clone, PartialEq, Eq, Default)]
170+
pub enum RulesImportConfig {
171+
/// Import from all supported frameworks when files are detected.
172+
#[default]
173+
Auto,
174+
/// Do not import external framework rules; keep Claw instruction files only.
175+
None,
176+
/// Import only the named frameworks.
177+
List(Vec<String>),
178+
}
179+
180+
impl RulesImportConfig {
181+
#[must_use]
182+
pub fn should_import(&self, framework: &str) -> bool {
183+
match self {
184+
Self::Auto => true,
185+
Self::None => false,
186+
Self::List(frameworks) => frameworks
187+
.iter()
188+
.any(|candidate| candidate.eq_ignore_ascii_case(framework)),
189+
}
190+
}
191+
}
192+
170193
/// Stored provider configuration from the setup wizard.
171194
///
172195
/// Represents the `provider` section in `~/.claw/settings.json`, used as a
@@ -202,29 +225,6 @@ impl RuntimeProviderConfig {
202225
}
203226
}
204227

205-
pub enum RulesImportConfig {
206-
/// Import from all supported frameworks when files are detected.
207-
#[default]
208-
Auto,
209-
/// Do not import external framework rules; keep Claw instruction files only.
210-
None,
211-
/// Import only the named frameworks.
212-
List(Vec<String>),
213-
}
214-
215-
impl RulesImportConfig {
216-
#[must_use]
217-
pub fn should_import(&self, framework: &str) -> bool {
218-
match self {
219-
Self::Auto => true,
220-
Self::None => false,
221-
Self::List(frameworks) => frameworks
222-
.iter()
223-
.any(|candidate| candidate.eq_ignore_ascii_case(framework)),
224-
}
225-
}
226-
}
227-
228228
/// Ordered chain of fallback model identifiers used when the primary
229229
/// provider returns a retryable failure (429/500/503/etc.). The chain is
230230
/// strict: each entry is tried in order until one succeeds.
@@ -915,6 +915,11 @@ impl RuntimeConfig {
915915
&self.feature_config.rules_import
916916
}
917917

918+
#[must_use]
919+
pub fn provider(&self) -> &RuntimeProviderConfig {
920+
&self.feature_config.provider
921+
}
922+
918923
/// Merge config-level default trusted roots with per-call roots.
919924
///
920925
/// Config roots are defaults and are kept first; per-call roots extend the

rust/crates/runtime/src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ pub use compact::{
6666
};
6767
pub use config::{
6868
clear_user_provider_settings, default_config_home, save_user_provider_settings,
69-
suppress_config_warnings_for_json_mode, ConfigEntry, ConfigError, ConfigLoader, ConfigSource,
70-
McpConfigCollection, McpManagedProxyServerConfig, McpOAuthConfig, McpRemoteServerConfig,
71-
McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport,
69+
suppress_config_warnings_for_json_mode, ApiTimeoutConfig, ConfigEntry, ConfigError,
70+
ConfigFileReport, ConfigFileStatus, ConfigInspection, ConfigLoader, ConfigSource,
71+
McpConfigCollection, McpInvalidServerConfig, McpManagedProxyServerConfig, McpOAuthConfig,
72+
McpRemoteServerConfig, McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport,
7273
McpWebSocketServerConfig, OAuthConfig, ProviderFallbackConfig, ResolvedPermissionMode,
73-
RuntimeConfig, RuntimeFeatureConfig, RuntimeHookConfig, RuntimePermissionRuleConfig,
74-
RuntimePluginConfig, RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME,
74+
RulesImportConfig, RuntimeConfig, RuntimeFeatureConfig, RuntimeHookCommand, RuntimeHookConfig,
75+
RuntimeInvalidHookConfig, RuntimePermissionRuleConfig, RuntimePluginConfig,
76+
RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME,
7577
};
7678
pub use config_validate::{
7779
check_unsupported_format, format_diagnostics, validate_config_file, ConfigDiagnostic,
@@ -142,8 +144,9 @@ pub use policy_engine::{
142144
PolicyEvaluation, PolicyRule, ReconcileReason, ReviewStatus,
143145
};
144146
pub use prompt::{
145-
load_system_prompt, prepend_bullets, ContextFile, ModelFamilyIdentity, ProjectContext,
146-
PromptBuildError, SystemPromptBuilder, FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY,
147+
load_system_prompt, load_system_prompt_with_context, prepend_bullets, ContextFile,
148+
ModelFamilyIdentity, ProjectContext, PromptBuildError, SystemPromptBuilder,
149+
FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY,
147150
};
148151
pub use recovery_recipes::{
149152
attempt_recovery, recipe_for, EscalationPolicy, FailureScenario, RecoveryAttemptState,

0 commit comments

Comments
 (0)