An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.
Rust
fix(#757): --permission-mode invalid and --allowedTools missing now emit typed error_kind and hint
YeonGyu-Kim02d77ae1f196
diff --git a/ROADMAP.md b/ROADMAP.mdindex c1499b29..8322034a 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -7679,3 +7679,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed)755. **`claw -p hello --model sonnet` swallowed `--model sonnet` into the prompt string** — gaebal-gajae pinpoint on `e9327135` (#117 revival). `-p` used `args[index+1..].join(" ")`, consuming all remaining tokens as prompt. Fix: capture exactly one token via `args.get(index+1)`, reject flag-like tokens (`starts_with('-')`) as `missing_prompt`, support `--` sentinel for literal flag-text, then `continue` the flag loop so `--model`/`--output-format`/etc. parse normally. Dispatch via `short_p_prompt` after full flag scan. Regression guard: `short_p_flag_swallows_no_flags_755` asserts `--output-format json` is parsed (not swallowed) and `--model` as prompt-arg is rejected. Source: gaebal-gajae dogfood on `e9327135`, 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.diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rsindex 830d07cf..492c665b 100644--- a/rust/crates/rusty-claude-cli/src/main.rs+++ b/rust/crates/rusty-claude-cli/src/main.rs@@ -921,7 +921,7 @@ fn parse_args(args: &[String]) -> Result<CliAction, String> {"--allowedTools" | "--allowed-tools" => {let value = args.get(index + 1)- .ok_or_else(|| "missing value for --allowedTools".to_string())?;+ .ok_or_else(|| "missing_flag_value: missing value for --allowedTools.\nUsage: --allowedTools <tool-name> e.g. --allowedTools Bash".to_string())?;allowed_tool_values.push(value.clone());index += 2;}@@ -1851,7 +1851,7 @@ fn parse_permission_mode_arg(value: &str) -> Result<PermissionMode, String> {normalize_permission_mode(value).ok_or_else(|| {format!(- "unsupported permission mode '{value}'. Use read-only, workspace-write, or danger-full-access."+ "invalid_flag_value: unsupported permission mode '{value}'.\nUsage: --permission-mode read-only|workspace-write|danger-full-access")}).map(permission_mode_from_label)@@ -5954,7 +5954,7 @@ impl LiveCli {let normalized = normalize_permission_mode(&mode).ok_or_else(|| {format!(- "unsupported permission mode '{mode}'. Use read-only, workspace-write, or danger-full-access."+ "invalid_flag_value: unsupported permission mode '{mode}'.\nUsage: --permission-mode read-only|workspace-write|danger-full-access")})?;