mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-05-30 11:45:20 +08:00
fix(#758): --cwd, --date, --session missing-value errors now use missing_flag_value prefix + hint
This commit is contained in:
parent
02d77ae1f1
commit
b8b3af6fc9
@ -7681,3 +7681,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed)
|
|||||||
756. **`--reasoning-effort bogus`, `--model` (no value), and sibling missing/invalid flag-value errors all returned `error_kind:"unknown"` + `hint:null`** — gaebal-gajae pinpoint on `0e8a449e`. All `missing value for --X` and `invalid value for --reasoning-effort` error strings were single-line with no classifier arm. Fix: (a) prefix all with `missing_flag_value:` / `invalid_flag_value:` + `\n` usage hint; (b) add `message.starts_with("missing_flag_value:")` → `"missing_flag_value"` and `message.starts_with("invalid_flag_value:")` → `"invalid_flag_value"` classifier arms. Covers `--model`, `--output-format`, `--permission-mode`, `--base-commit`, `--reasoning-effort`. Regression guard: `flag_value_errors_have_error_kind_and_hint_756` — invalid `--reasoning-effort HIGH` → `invalid_flag_value` + hint with valid values; missing `--model` → `missing_flag_value` + non-null hint. Source: gaebal-gajae dogfood on `0e8a449e`, 2026-05-26.
|
756. **`--reasoning-effort bogus`, `--model` (no value), and sibling missing/invalid flag-value errors all returned `error_kind:"unknown"` + `hint:null`** — gaebal-gajae pinpoint on `0e8a449e`. All `missing value for --X` and `invalid value for --reasoning-effort` error strings were single-line with no classifier arm. Fix: (a) prefix all with `missing_flag_value:` / `invalid_flag_value:` + `\n` usage hint; (b) add `message.starts_with("missing_flag_value:")` → `"missing_flag_value"` and `message.starts_with("invalid_flag_value:")` → `"invalid_flag_value"` classifier arms. Covers `--model`, `--output-format`, `--permission-mode`, `--base-commit`, `--reasoning-effort`. Regression guard: `flag_value_errors_have_error_kind_and_hint_756` — invalid `--reasoning-effort HIGH` → `invalid_flag_value` + hint with valid values; missing `--model` → `missing_flag_value` + non-null hint. Source: gaebal-gajae dogfood on `0e8a449e`, 2026-05-26.
|
||||||
|
|
||||||
757. **`--permission-mode bogus` and `--allowedTools` (no value) returned `error_kind:"unknown"` + `hint:null`** — dogfooded 2026-05-26 on `4df14618`. `parse_permission_mode_arg()` error format had no prefix and no `\n`; `--allowedTools` missing-value string was plain. Fix: prefix `parse_permission_mode_arg` error with `invalid_flag_value:` + `\n` valid-values hint (both call sites); prefix `--allowedTools` missing-value with `missing_flag_value:` + `\n` usage hint. Both now classified by existing `missing_flag_value`/`invalid_flag_value` arms added in #756. Source: Jobdori dogfood on `4df14618`, 2026-05-26.
|
757. **`--permission-mode bogus` and `--allowedTools` (no value) returned `error_kind:"unknown"` + `hint:null`** — dogfooded 2026-05-26 on `4df14618`. `parse_permission_mode_arg()` error format had no prefix and no `\n`; `--allowedTools` missing-value string was plain. Fix: prefix `parse_permission_mode_arg` error with `invalid_flag_value:` + `\n` valid-values hint (both call sites); prefix `--allowedTools` missing-value with `missing_flag_value:` + `\n` usage hint. Both now classified by existing `missing_flag_value`/`invalid_flag_value` arms added in #756. Source: Jobdori dogfood on `4df14618`, 2026-05-26.
|
||||||
|
|
||||||
|
758. **Three remaining `missing value for --X` strings in `parse_init_args` were still untyped** — dogfooded 2026-05-26 on `02d77ae1`. `--cwd`, `--date`, `--session` missing-value errors in the init-args parser used the old plain-string form with no `missing_flag_value:` prefix and no `\n` hint, unlike the main `parse_args` flags fixed in #756/#757. Fix: applied `missing_flag_value:` prefix + `\n` usage hint to all three. `grep '"missing value for --'` now returns zero results outside of test assertions. Source: Jobdori dogfood sweep on `02d77ae1`, 2026-05-26.
|
||||||
|
|||||||
@ -1949,16 +1949,17 @@ fn parse_system_prompt_args(
|
|||||||
while index < args.len() {
|
while index < args.len() {
|
||||||
match args[index].as_str() {
|
match args[index].as_str() {
|
||||||
"--cwd" => {
|
"--cwd" => {
|
||||||
let value = args
|
let value = args.get(index + 1).ok_or_else(|| {
|
||||||
.get(index + 1)
|
"missing_flag_value: missing value for --cwd.\nUsage: --cwd <path>".to_string()
|
||||||
.ok_or_else(|| "missing value for --cwd".to_string())?;
|
})?;
|
||||||
cwd = PathBuf::from(value);
|
cwd = PathBuf::from(value);
|
||||||
index += 2;
|
index += 2;
|
||||||
}
|
}
|
||||||
"--date" => {
|
"--date" => {
|
||||||
let value = args
|
let value = args.get(index + 1).ok_or_else(|| {
|
||||||
.get(index + 1)
|
"missing_flag_value: missing value for --date.\nUsage: --date <YYYY-MM-DD>"
|
||||||
.ok_or_else(|| "missing value for --date".to_string())?;
|
.to_string()
|
||||||
|
})?;
|
||||||
date.clone_from(value);
|
date.clone_from(value);
|
||||||
index += 2;
|
index += 2;
|
||||||
}
|
}
|
||||||
@ -1991,7 +1992,7 @@ fn parse_export_args(args: &[String], output_format: CliOutputFormat) -> Result<
|
|||||||
"--session" => {
|
"--session" => {
|
||||||
let value = args
|
let value = args
|
||||||
.get(index + 1)
|
.get(index + 1)
|
||||||
.ok_or_else(|| "missing value for --session".to_string())?;
|
.ok_or_else(|| "missing_flag_value: missing value for --session.\nUsage: --session <session-id>".to_string())?;
|
||||||
session_reference.clone_from(value);
|
session_reference.clone_from(value);
|
||||||
index += 2;
|
index += 2;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user