{"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":"exception","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/58e5313667b857ef39a730e380af31816a7b1768/crates/but-agentlog/src/cli.rs#L343-L379","documentation":"In crates/but-agentlog/src/cli.rs run_from_dir, the Skim command bails with \"target kind is required when target value is provided\" when a value is given without a target kind. The match treats (None, Some(_)) as invalid; only both-or-neither are accepted.","triggerScenarios":"Running `but agentlog skim <value>` where the value lands in the `value` positional while `target` is None — the (None, Some(_)) arm bails.","commonSituations":"Omitting the kind keyword, e.g. `but agentlog skim my-session` instead of `but agentlog skim session my-session`; script argument shifting that drops the kind.","solutions":["Prefix the value with its target kind: `but agentlog skim session <value>` (or branch/change/review as applicable).","Pass no filter arguments at all to skim everything, instead of a bare value.","In wrappers/scripts, always emit both arguments together or neither."],"exampleFix":"// before\nbut agentlog skim abc123\n// after\nbut agentlog skim session abc123","handlingStrategy":"validation","validationCode":"# require both or neither\nif [ -n \"$VALUE\" ] && [ -z \"$TARGET\" ]; then echo \"provide a target kind\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass a bare value to skim; always prefix with branch|session|review|change as supported.","Keep target/value pairs together when constructing CLI args programmatically.","Prefer no-arg skim when filtering intent is unclear."],"tags":["rust","cli","argument-validation","agentlog"],"backgroundTag":"missing-required-argument","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}