Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

fix: update slash command count and add /setup assertion in test

TheArchitectitd58197cca4e7
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<String>),
+}
+
+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<String>),
-}
-
-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,