From 1b7939e6805c0db8d8399f06081eea1adba1075f Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 3 May 2026 04:16:01 -0500 Subject: [PATCH] feat(doctor): surface memory feature state in --json output (#489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operators ask "is memory on?" and "where does it live?" without wanting to boot the TUI. Adds a \`memory\` block to the JSON doctor report: \`\`\`json "memory": { "enabled": false, // honours DEEPSEEK_MEMORY env "path": "/Users/you/.deepseek/memory.md", // expanded path "file_present": false // does the file exist on disk? } \`\`\` The \`enabled\` field reads \`DEEPSEEK_MEMORY\` directly so it stays correct on this stabilization branch even though the dedicated \`Config::memory_enabled()\` accessor lives on the memory-MVP branch (#518). When both PRs land, the duplicated env-parse can collapse to a single method call — TODO comment marks the spot. Verified: - \`deepseek doctor --json\` shows \`enabled: false\` by default - \`DEEPSEEK_MEMORY=on deepseek doctor --json\` shows \`enabled: true\` - All gates green (1856 main + supporting) Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/tui/src/main.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/crates/tui/src/main.rs b/crates/tui/src/main.rs index 63cf5bba..5f6dc8bb 100644 --- a/crates/tui/src/main.rs +++ b/crates/tui/src/main.rs @@ -1824,6 +1824,32 @@ fn run_doctor_json( let tools_dir = default_tools_dir(); let plugins_dir = default_plugins_dir(); + // Memory feature state (#489). Operators ask "is memory on?" and + // "where does it live?" — surface both here so the question can be + // answered without booting the TUI. Both inputs are checked: the + // config flag and the env-var override that the runtime would + // honour. (The dedicated `Config::memory_enabled()` accessor lives + // on the memory-MVP branch (#518); this duplicates the same logic + // until the two PRs land and it can be replaced with a single + // method call.) + let memory_path = config.memory_path(); + let memory_enabled_env = std::env::var("DEEPSEEK_MEMORY") + .ok() + .map(|raw| { + matches!( + raw.trim().to_ascii_lowercase().as_str(), + "1" | "on" | "true" | "yes" | "y" | "enabled" + ) + }) + .unwrap_or(false); + let memory_summary = json!({ + // The MVP feature is opt-in by default; this defaults to false + // on branches without the [memory] section in `Config`. + "enabled": memory_enabled_env, + "path": memory_path.display().to_string(), + "file_present": memory_path.exists(), + }); + let report = json!({ "version": env!("CARGO_PKG_VERSION"), "config_path": config_path.display().to_string(), @@ -1840,6 +1866,7 @@ fn run_doctor_json( .default_text_model .clone() .unwrap_or_else(|| DEFAULT_TEXT_MODEL.to_string()), + "memory": memory_summary, "mcp": mcp_summary, "skills": { "selected": selected_skills_dir.display().to_string(),