Skip to content

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

Rust

fix(cli): JSON parity for /memory and /providers in resume mode

YeonGyu-Kim7587f2c1ebff
diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs
index d68b486a..df768130 100644
--- a/rust/crates/commands/src/lib.rs
+++ b/rust/crates/commands/src/lib.rs
@@ -1320,7 +1320,7 @@ pub fn validate_slash_command_input(
"skills" | "skill" => SlashCommand::Skills {
args: parse_skills_args(remainder.as_deref())?,
},
- "doctor" => {
+ "doctor" | "providers" => {
validate_no_args(command, &args)?;
SlashCommand::Doctor
}
diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs
index 601999bb..e7ced4ac 100644
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@ -2773,7 +2773,7 @@ fn run_resume_command(
SlashCommand::Memory => Ok(ResumeCommandOutcome {
session: session.clone(),
message: Some(render_memory_report()?),
- json: None,
+ json: Some(render_memory_json()?),
}),
SlashCommand::Init => {
let message = init_claude_md()?;
@@ -2829,11 +2829,14 @@ fn run_resume_command(
json: Some(handle_skills_slash_command_json(args.as_deref(), &cwd)?),
})
}
- SlashCommand::Doctor => Ok(ResumeCommandOutcome {
- session: session.clone(),
- message: Some(render_doctor_report()?.render()),
- json: None,
- }),
+ SlashCommand::Doctor => {
+ let report = render_doctor_report()?;
+ Ok(ResumeCommandOutcome {
+ session: session.clone(),
+ message: Some(report.render()),
+ json: Some(report.json_value()),
+ })
+ }
SlashCommand::Stats => {
let usage = UsageTracker::from_session(session).cumulative_usage();
Ok(ResumeCommandOutcome {
@@ -5421,6 +5424,28 @@ fn render_memory_report() -> Result<String, Box<dyn std::error::Error>> {
))
}
+fn render_memory_json() -> Result<serde_json::Value, Box<dyn std::error::Error>> {
+ let cwd = env::current_dir()?;
+ let project_context = ProjectContext::discover(&cwd, DEFAULT_DATE)?;
+ let files: Vec<_> = project_context
+ .instruction_files
+ .iter()
+ .map(|f| {
+ json!({
+ "path": f.path.display().to_string(),
+ "lines": f.content.lines().count(),
+ "preview": f.content.lines().next().unwrap_or("").trim(),
+ })
+ })
+ .collect();
+ Ok(json!({
+ "kind": "memory",
+ "cwd": cwd.display().to_string(),
+ "instruction_files": files.len(),
+ "files": files,
+ }))
+}
+
fn init_claude_md() -> Result<String, Box<dyn std::error::Error>> {
let cwd = env::current_dir()?;
Ok(initialize_repo(&cwd)?.render())