Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/crates/commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[
SlashCommandSpec {
name: "memory",
aliases: &[],
summary: "Inspect loaded Claude instruction memory files",
summary: "Show instruction files and persistent auto memory",
argument_hint: None,
resume_supported: true,
},
Expand Down
19 changes: 18 additions & 1 deletion rust/crates/runtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pub struct RuntimeFeatureConfig {
api_timeout: ApiTimeoutConfig,
rules_import: RulesImportConfig,
provider: RuntimeProviderConfig,
auto_memory_enabled: bool,
}

/// Controls which external AI coding framework rules are imported into the system prompt.
Expand Down Expand Up @@ -801,6 +802,7 @@ fn build_runtime_config(
api_timeout: parse_optional_api_timeout_config(&merged_value)?,
rules_import: parse_optional_rules_import(&merged_value)?,
provider: parse_optional_provider_config(&merged_value)?,
auto_memory_enabled: parse_auto_memory_enabled(&merged_value),
};

Ok(RuntimeConfig {
Expand All @@ -826,7 +828,10 @@ impl RuntimeConfig {
Self {
merged: BTreeMap::new(),
loaded_entries: Vec::new(),
feature_config: RuntimeFeatureConfig::default(),
feature_config: RuntimeFeatureConfig {
auto_memory_enabled: true,
..RuntimeFeatureConfig::default()
},
}
}

Expand Down Expand Up @@ -1012,6 +1017,11 @@ impl RuntimeFeatureConfig {
&self.rules_import
}

#[must_use]
pub fn auto_memory_enabled(&self) -> bool {
self.auto_memory_enabled
}

/// Merge this config's default trusted roots with per-call roots.
#[must_use]
pub fn trusted_roots_with_overrides(&self, per_call_roots: &[String]) -> Vec<String> {
Expand Down Expand Up @@ -2172,6 +2182,13 @@ fn parse_optional_provider_config(root: &JsonValue) -> Result<RuntimeProviderCon
})
}

fn parse_auto_memory_enabled(root: &JsonValue) -> bool {
root.as_object()
.and_then(|object| object.get("autoMemoryEnabled"))
.and_then(JsonValue::as_bool)
.unwrap_or(true)
}

fn parse_filesystem_mode_label(value: &str) -> Result<FilesystemIsolationMode, ConfigError> {
match value {
"off" => Ok(FilesystemIsolationMode::Off),
Expand Down
4 changes: 4 additions & 0 deletions rust/crates/runtime/src/config_validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ const TOP_LEVEL_FIELDS: &[FieldSpec] = &[
name: "subagentModel",
expected: FieldType::String,
},
FieldSpec {
name: "autoMemoryEnabled",
expected: FieldType::Bool,
},
];

const HOOKS_FIELDS: &[FieldSpec] = &[
Expand Down
2 changes: 2 additions & 0 deletions rust/crates/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub mod mcp_lifecycle_hardened;
pub mod mcp_server;
mod mcp_stdio;
pub mod mcp_tool_bridge;
pub mod memory_store;
mod oauth;
pub mod permission_enforcer;
mod permissions;
Expand Down Expand Up @@ -123,6 +124,7 @@ pub use mcp_stdio::{
McpTool, McpToolCallContent, McpToolCallParams, McpToolCallResult, McpToolDiscoveryReport,
UnsupportedMcpServer,
};
pub use memory_store::{MemoryEntry, MemoryStore, MemoryType};
pub use oauth::{
clear_oauth_credentials, code_challenge_s256, credentials_path, generate_pkce_pair,
generate_state, load_oauth_credentials, loopback_redirect_uri, parse_oauth_callback_query,
Expand Down
Loading