-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Config validation errors should show line number, bad value, and bracket notation for array indices #104854
Copy link
Copy link
Closed
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Description
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Problem
When
openclaw.jsonhas an invalid enum value (e.g.tools.profile: "none"), the error message says:Three things make this hard to debug:
vim /noneto find the offending valueinvalid_enum_valueerror already carries areceivedfield (e.g."none"), but it's silently dropped before formattingagents.list.3looks like a property path, not an array index. Should beagents.list[3]Expected
That's grep-able, tells you exactly what you set wrong, and points to the line.
Implementation sketch
formatConfigPath()insrc/config/validation.ts— use bracket notation for numeric segmentsmapZodIssueToConfigIssue()— read Zod'sreceivedfield and appendgot: ${JSON.stringify(received)}runConfigValidate()insrc/cli/config-cli.ts— walk the Zod error path against the raw file text (already available inConfigFileSnapshot.raw) to find the line numberRelated
ConfigFileSnapshotalready hasraw: string | null— the full raw file textConfigValidationIssuetype insrc/config/types.openclaw.ts— could add an optionallinefield