From 8dcf10361f20774631a5709794e5b495902be6a5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 10 Apr 2026 06:03:29 +0900 Subject: [PATCH] =?UTF-8?q?fix(cli):=20implement=20/session=20list=20in=20?= =?UTF-8?q?resume=20mode=20=E2=80=94=20ROADMAP=20#21=20partial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /session list previously returned 'unsupported resumed slash command' in --output-format json --resume mode. It only reads the sessions directory so does not need a live runtime session. Adds a Session{action:"list"} arm in run_resume_command() before the unsupported catchall. Emits: {kind:session_list, sessions:[...ids], active:} 159 CLI tests pass. --- rust/crates/rusty-claude-cli/src/main.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index b399f9a..fb06e10 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -2964,6 +2964,25 @@ fn run_resume_command( }) } SlashCommand::Unknown(name) => Err(format_unknown_slash_command(name).into()), + // /session list can be served from the sessions directory without a live session. + SlashCommand::Session { + action: Some(ref act), + .. + } if act == "list" => { + let sessions = list_managed_sessions().unwrap_or_default(); + let session_ids: Vec = sessions.iter().map(|s| s.id.clone()).collect(); + let active_id = session.session_id.clone(); + let text = render_session_list(&active_id).unwrap_or_else(|e| format!("error: {e}")); + Ok(ResumeCommandOutcome { + session: session.clone(), + message: Some(text), + json: Some(serde_json::json!({ + "kind": "session_list", + "sessions": session_ids, + "active": active_id, + })), + }) + } SlashCommand::Bughunter { .. } | SlashCommand::Commit { .. } | SlashCommand::Pr { .. }