{"record":{"id":"a2be1d649d82b375","repo":"gitbutlerapp/gitbutler","slug":"target-kind-is-required-when-target-value-is-provi","errorCode":null,"errorMessage":"target kind is required when target value is provided","messagePattern":"target kind is required when target value is provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-agentlog/src/cli.rs","lineNumber":361,"sourceCode":"                    let timeline = get_session_timeline_outline(\n                        &repo_path,\n                        &session_key,\n                        status,\n                        Some(limit.unwrap_or(DEFAULT_TIMELINE_LIMIT)),\n                    )\n                    .context(\"failed to read agent session timeline\")?;\n                    Ok(CommandOutput::Timeline(timeline))\n                }\n            }\n        }\n        Command::Skim { target, value } => {\n            let explicit_target = match (target, value) {\n                (Some(target), Some(value)) => Some((target, value)),\n                (Some(target), None) => {\n                    anyhow::bail!(\"{} target value is required\", target.as_str())\n                }\n                (None, Some(_)) => {\n                    anyhow::bail!(\"target kind is required when target value is provided\")\n                }\n                (None, None) => None,\n            };\n            let repo_path = if explicit_target.is_some() {\n                resolve_read_repo_path(dir)?\n            } else {\n                resolve_workdir(dir)?\n            };\n            let (target, value) = match explicit_target {\n                Some(target) => target,\n                None => skim::resolve_default_branch_target(&repo_path)?,\n            };\n            let target_key = related_session_target_key(target, &value);\n            let sessions = find_related_sessions_limited_by_statuses(\n                &repo_path,\n                target.related_target(&target_key),\n                None,\n                &[PublicationStatus::LocalOnly, PublicationStatus::Published],","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/2497b8007aa4a1922dae9a805b32ffe5b5037785/crates/but-agentlog/src/cli.rs#L343-L379","documentation":"The mirror case of the missing-value error: but-agentlog skim received a target value without a target kind (Command::Skim { target: None, value: Some(_) }). The tool cannot tell whether the value names a branch, review, or change, so it bails instead of guessing.","triggerScenarios":"Running `but agentlog skim <value>` with only the value, or a wrapper passing a value flag without the kind — reaching the (None, Some(_)) match arm.","commonSituations":"Scripts forwarding a variable that is set for value but empty for kind; misordered arguments; users assuming the bare form is a branch name.","solutions":["Add the target kind: but agentlog skim branch <name> (or review/change as appropriate).","If you meant the default target, remove the value too so skim auto-detects the applied GitButler branch.","Check `but agentlog skim --help` for the accepted argument shape."],"exampleFix":"# before\nbut agentlog skim feat/auth\n# after\nbut agentlog skim branch feat/auth","handlingStrategy":"validation","validationCode":"fn skim_args_consistent(target: Option<TargetKind>, value: Option<&str>) -> bool {\n    matches!((target, value), (None, None) | (Some(_), Some(_)))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Emit kind and value as one unit from scripts.","Validate argv shape before spawning `but agentlog skim`.","Consult --help rather than guessing positional forms."],"tags":["cli","argument-validation","agentlog","skim"],"backgroundTag":"missing-cli-argument","analyzedSha":"2497b8007aa4a1922dae9a805b32ffe5b5037785","analyzedAt":"2026-08-17T00:30:25.648Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}