{"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":"validation","errorClass":"anyhow::Error","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/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L2014-L2050","documentation":"Like `worktree-status`, the `worktree-resolution` subcommand treats `--all` and an explicit session ID as mutually exclusive. Supplying both is ambiguous, so the command validates inputs first and returns this error before querying anything.","triggerScenarios":"Running `ecc2 worktree-resolution --all <session-id>` — `all && session_id.is_some()`.","commonSituations":"Copy-pasting an example that included both forms; scripts that append a session ID while CI config enables `--all`; assuming the ID would narrow the `--all` scope.","solutions":["Drop the session ID argument when using `--all`.","Drop `--all` and pass exactly one session ID for a single-session report.","Fix wrapper scripts to choose one mode based on whether an ID was supplied.","Check `ecc2 worktree-resolution --help` for the accepted usage."],"exampleFix":"// before (shell)\necc2 worktree-resolution --all sess-42\n\n// after\necc2 worktree-resolution --all      # all sessions\necc2 worktree-resolution sess-42    # one session","handlingStrategy":"validation","validationCode":"// shell: guard against combining --all with a session ID\nif $ALL_MODE && [ -n \"$SESSION_ID\" ]; then echo \"--all excludes a session ID\"; exit 1; fi","typeGuard":"fn args_valid(all: bool, session_id: &Option<String>) -> bool {\n    !(all && session_id.is_some())\n}","tryCatchPattern":"// surface the validation error cleanly in wrappers\nif ! ecc2 worktree-resolution \"$@\"; then echo \"invalid worktree-resolution arguments\" >&2; exit 1; fi","preventionTips":["Choose the report mode explicitly per invocation: aggregate OR per-session.","Keep flags and IDs in separate script variables so only one is forwarded.","Document the two usage forms in team runbooks.","Lint CI configs for scripts passing both --all and an ID."],"tags":["cli","arguments","worktree","rust"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}