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 /compact and /clear in resume mode

YeonGyu-Kim78dca71f3fbb
diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs
index 3b875eee..524c6038 100644
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@ -2678,7 +2678,12 @@ fn run_resume_command(
Ok(ResumeCommandOutcome {
session: result.compacted_session,
message: Some(format_compact_report(removed, kept, skipped)),
- json: None,
+ json: Some(serde_json::json!({
+ "kind": "compact",
+ "skipped": skipped,
+ "removed_messages": removed,
+ "kept_messages": kept,
+ })),
})
}
SlashCommand::Clear { confirm } => {
@@ -2688,7 +2693,11 @@ fn run_resume_command(
message: Some(
"clear: confirmation required; rerun with /clear --confirm".to_string(),
),
- json: None,
+ json: Some(serde_json::json!({
+ "kind": "error",
+ "error": "confirmation required",
+ "hint": "rerun with /clear --confirm",
+ })),
});
}
let backup_path = write_session_clear_backup(session, session_path)?;
@@ -2704,7 +2713,13 @@ fn run_resume_command(
backup_path.display(),
session_path.display()
)),
- json: None,
+ json: Some(serde_json::json!({
+ "kind": "clear",
+ "previous_session_id": previous_session_id,
+ "new_session_id": new_session_id,
+ "backup": backup_path.display().to_string(),
+ "session_file": session_path.display().to_string(),
+ })),
})
}
SlashCommand::Status => {