{"record":{"id":"cd570442be869a51","repo":"affaan-m/ECC","slug":"worktree-resolution-does-not-accept-a-session-id-w","errorCode":null,"errorMessage":"worktree-resolution does not accept a session ID when --all is set","messagePattern":"worktree-resolution does not accept a session ID when --all is set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":2032,"sourceCode":"                    println!(\"{}\", serde_json::to_string_pretty(&reports)?);\n                } else {\n                    println!(\"{}\", serde_json::to_string_pretty(&reports[0])?);\n                }\n            } else {\n                println!(\"{}\", format_worktree_status_reports_human(&reports));\n            }\n            if check {\n                std::process::exit(worktree_status_reports_exit_code(&reports));\n            }\n        }\n        Some(Commands::WorktreeResolution {\n            session_id,\n            all,\n            json,\n            check,\n        }) => {\n            if all && session_id.is_some() {\n                return Err(anyhow::anyhow!(\n                    \"worktree-resolution does not accept a session ID when --all is set\"\n                ));\n            }\n            let reports = if all {\n                session::manager::list_sessions(&db)?\n                    .into_iter()\n                    .map(|session| build_worktree_resolution_report(&session))\n                    .collect::<Result<Vec<_>>>()?\n                    .into_iter()\n                    .filter(|report| report.conflicted)\n                    .collect::<Vec<_>>()\n            } else {\n                let id = session_id.unwrap_or_else(|| \"latest\".to_string());\n                let resolved_id = resolve_session_id(&db, &id)?;\n                let session = db\n                    .get_session(&resolved_id)?\n                    .ok_or_else(|| anyhow::anyhow!(\"Session not found: {resolved_id}\"))?;\n                vec![build_worktree_resolution_report(&session)?]","sourceCodeStart":2014,"sourceCodeEnd":2050,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/ecc2/src/main.rs#L2014-L2050","documentation":"Argument-conflict error from the WorktreeResolution command handler in ecc2/src/main.rs. When --all is set together with a session_id, the handler bails: \"worktree-resolution does not accept a session ID when --all is set\". --all means 'resolve across every conflicted session', so naming one session is contradictory.","triggerScenarios":"Running `worktree-resolution --all <session_id>` such that both `all` is true and `session_id` is Some.","commonSituations":"User assumed --all plus an id scopes the operation; a wrapper script appends an id unconditionally; copy-paste from a previous single-session invocation.","solutions":["Drop either --all or the session id.","Check --help for the mutual exclusivity of --all and the positional id.","Fix any wrapper script that always appends an id."],"exampleFix":"# before\n$ ecc worktree-resolution --all abc123\n\n# after (pick one)\n$ ecc worktree-resolution --all\n$ ecc worktree-resolution abc123","handlingStrategy":"validation","validationCode":"if all && session_id.is_some() {\n    eprintln!(\"--all cannot be combined with a session id\");\n    return Ok(());\n}","typeGuard":"fn args_consistent(all: bool, session_id: &Option<String>) -> bool {\n    !(all && session_id.is_some())\n}","tryCatchPattern":"let reports = if all {\n    if session_id.is_some() {\n        eprintln!(\"ignoring session id because --all was set\");\n    }\n    // ...build all-session reports\n} else {\n    // ...build single-session report\n};","preventionTips":["Read --help to learn which flags are mutually exclusive.","Use clap's `conflicts_with` to enforce mutual exclusivity at parse time.","Audit wrapper scripts that append positional args unconditionally.","Prefer explicit --all or an explicit id, never both."],"tags":["rust","cli","args","worktree"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}