Preserve explicit resume paths while parsing slash command arguments

The release-harness merge taught --resume to keep multi-token slash commands together, but that also misclassified absolute session paths as slash commands. This follow-up keeps the latest-session shortcut for real slash commands while still treating absolute and relative filesystem paths as explicit resume targets, which restores the new integration test and the intended resume flow.

Constraint: --resume must accept both implicit latest-session shortcuts and absolute filesystem paths
Rejected: Require --resume latest for all slash-command-only invocations | breaks the new shortcut UX merged from 9103/9202
Confidence: high
Scope-risk: narrow
Directive: Distinguish slash commands with looks_like_slash_command_token before assuming a leading slash means latest-session shorthand
Tested: cargo build -p rusty-claude-cli; cargo test -p rusty-claude-cli
Not-tested: Non-UTF8 session path handling
This commit is contained in:
Yeachan-Heo
2026-04-02 08:40:34 +00:00
parent 9fb79d07ee
commit 8f1f65dd98

View File

@@ -637,7 +637,7 @@ fn parse_system_prompt_args(args: &[String]) -> Result<CliAction, String> {
fn parse_resume_args(args: &[String]) -> Result<CliAction, String> {
let (session_path, command_tokens): (PathBuf, &[String]) = match args.first() {
None => (PathBuf::from(LATEST_SESSION_REFERENCE), &[]),
Some(first) if first.trim_start().starts_with('/') => {
Some(first) if looks_like_slash_command_token(first) => {
(PathBuf::from(LATEST_SESSION_REFERENCE), args)
}
Some(first) => (PathBuf::from(first), &args[1..]),