mirror of
https://github.com/instructkr/claw-code.git
synced 2026-06-09 16:02:14 +08:00
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 #3218.
This commit is contained in:
committed by
Your Name
parent
3845040b9d
commit
d58197cca4
@@ -6011,7 +6011,8 @@ mod tests {
|
|||||||
assert!(help.contains("aliases: /skill"));
|
assert!(help.contains("aliases: /skill"));
|
||||||
assert!(!help.contains("/login"));
|
assert!(!help.contains("/login"));
|
||||||
assert!(!help.contains("/logout"));
|
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);
|
assert!(resume_supported_slash_commands().len() >= 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,29 @@ pub struct RuntimeFeatureConfig {
|
|||||||
|
|
||||||
/// Controls which external AI coding framework rules are imported into the system prompt.
|
/// Controls which external AI coding framework rules are imported into the system prompt.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Default)]
|
#[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.
|
/// Stored provider configuration from the setup wizard.
|
||||||
///
|
///
|
||||||
/// Represents the `provider` section in `~/.claw/settings.json`, used as a
|
/// 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
|
/// Ordered chain of fallback model identifiers used when the primary
|
||||||
/// provider returns a retryable failure (429/500/503/etc.). The chain is
|
/// provider returns a retryable failure (429/500/503/etc.). The chain is
|
||||||
/// strict: each entry is tried in order until one succeeds.
|
/// strict: each entry is tried in order until one succeeds.
|
||||||
@@ -915,6 +915,11 @@ impl RuntimeConfig {
|
|||||||
&self.feature_config.rules_import
|
&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.
|
/// Merge config-level default trusted roots with per-call roots.
|
||||||
///
|
///
|
||||||
/// Config roots are defaults and are kept first; per-call roots extend the
|
/// Config roots are defaults and are kept first; per-call roots extend the
|
||||||
|
|||||||
@@ -66,12 +66,14 @@ pub use compact::{
|
|||||||
};
|
};
|
||||||
pub use config::{
|
pub use config::{
|
||||||
clear_user_provider_settings, default_config_home, save_user_provider_settings,
|
clear_user_provider_settings, default_config_home, save_user_provider_settings,
|
||||||
suppress_config_warnings_for_json_mode, ConfigEntry, ConfigError, ConfigLoader, ConfigSource,
|
suppress_config_warnings_for_json_mode, ApiTimeoutConfig, ConfigEntry, ConfigError,
|
||||||
McpConfigCollection, McpManagedProxyServerConfig, McpOAuthConfig, McpRemoteServerConfig,
|
ConfigFileReport, ConfigFileStatus, ConfigInspection, ConfigLoader, ConfigSource,
|
||||||
McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport,
|
McpConfigCollection, McpInvalidServerConfig, McpManagedProxyServerConfig, McpOAuthConfig,
|
||||||
|
McpRemoteServerConfig, McpSdkServerConfig, McpServerConfig, McpStdioServerConfig, McpTransport,
|
||||||
McpWebSocketServerConfig, OAuthConfig, ProviderFallbackConfig, ResolvedPermissionMode,
|
McpWebSocketServerConfig, OAuthConfig, ProviderFallbackConfig, ResolvedPermissionMode,
|
||||||
RuntimeConfig, RuntimeFeatureConfig, RuntimeHookConfig, RuntimePermissionRuleConfig,
|
RulesImportConfig, RuntimeConfig, RuntimeFeatureConfig, RuntimeHookCommand, RuntimeHookConfig,
|
||||||
RuntimePluginConfig, RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME,
|
RuntimeInvalidHookConfig, RuntimePermissionRuleConfig, RuntimePluginConfig,
|
||||||
|
RuntimeProviderConfig, ScopedMcpServerConfig, CLAW_SETTINGS_SCHEMA_NAME,
|
||||||
};
|
};
|
||||||
pub use config_validate::{
|
pub use config_validate::{
|
||||||
check_unsupported_format, format_diagnostics, validate_config_file, ConfigDiagnostic,
|
check_unsupported_format, format_diagnostics, validate_config_file, ConfigDiagnostic,
|
||||||
@@ -142,8 +144,9 @@ pub use policy_engine::{
|
|||||||
PolicyEvaluation, PolicyRule, ReconcileReason, ReviewStatus,
|
PolicyEvaluation, PolicyRule, ReconcileReason, ReviewStatus,
|
||||||
};
|
};
|
||||||
pub use prompt::{
|
pub use prompt::{
|
||||||
load_system_prompt, prepend_bullets, ContextFile, ModelFamilyIdentity, ProjectContext,
|
load_system_prompt, load_system_prompt_with_context, prepend_bullets, ContextFile,
|
||||||
PromptBuildError, SystemPromptBuilder, FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY,
|
ModelFamilyIdentity, ProjectContext, PromptBuildError, SystemPromptBuilder,
|
||||||
|
FRONTIER_MODEL_NAME, SYSTEM_PROMPT_DYNAMIC_BOUNDARY,
|
||||||
};
|
};
|
||||||
pub use recovery_recipes::{
|
pub use recovery_recipes::{
|
||||||
attempt_recovery, recipe_for, EscalationPolicy, FailureScenario, RecoveryAttemptState,
|
attempt_recovery, recipe_for, EscalationPolicy, FailureScenario, RecoveryAttemptState,
|
||||||
|
|||||||
Reference in New Issue
Block a user