{"record":{"id":"7d137951887ff26d","repo":"can1357/oh-my-pi","slug":"invalid-boolean-value-rawvalue-use-true-false","errorCode":null,"errorMessage":"Invalid boolean value: ${rawValue}. Use true/false, yes/no, on/off, or 1/0","messagePattern":"Invalid boolean value: (.+?)\\. Use true/false, yes/no, on/off, or 1/0","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/config-cli.ts","lineNumber":188,"sourceCode":"\t\t\treturn \"(string)\";\n\t}\n}\n\n// =============================================================================\n// Schema-Driven Value Parsing\n// =============================================================================\n\nfunction parseAndSetValue(path: SettingPath, rawValue: string): void {\n\tconst schemaType = getType(path);\n\tlet parsedValue: unknown;\n\n\tconst trimmed = rawValue.trim();\n\tswitch (schemaType) {\n\t\tcase \"boolean\": {\n\t\t\tconst lower = trimmed.toLowerCase();\n\t\t\tif ([\"true\", \"1\", \"yes\", \"on\"].includes(lower)) parsedValue = true;\n\t\t\telse if ([\"false\", \"0\", \"no\", \"off\"].includes(lower)) parsedValue = false;\n\t\t\telse throw new Error(`Invalid boolean value: ${rawValue}. Use true/false, yes/no, on/off, or 1/0`);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"number\":\n\t\t\tparsedValue = Number(trimmed);\n\t\t\tif (!Number.isFinite(parsedValue)) throw new Error(`Invalid number: ${rawValue}`);\n\t\t\tbreak;\n\t\tcase \"enum\": {\n\t\t\tconst valid = getEnumValues(path);\n\t\t\tif (valid && !valid.includes(trimmed)) {\n\t\t\t\tthrow new Error(`Invalid value: ${rawValue}. Valid values: ${valid.join(\", \")}`);\n\t\t\t}\n\t\t\tparsedValue = trimmed;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"array\": {\n\t\t\tlet parsed: unknown;\n\t\t\ttry {\n\t\t\t\tparsed = JSON.parse(trimmed);","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/config-cli.ts#L170-L206","documentation":"`omp config set` validates boolean settings against an accepted token list (true/1/yes/on, false/0/no/off, case-insensitive). If the raw value string doesn't match any token, parseAndSetValue throws this error telling the user the accepted forms. Nothing is written to settings.json on failure.","triggerScenarios":"Running `omp config set <boolean-key> <value>` where <value> is not one of the accepted truthy/falsy tokens — e.g. `true ` with quotes, `enabled`, `True!`, `y`, or an empty string.","commonSituations":"Users passing words like `enable`/`yes!`/`y` out of habit; shell quoting mishaps leaving stray quotes in the value; copy-pasting values with trailing whitespace or invisible characters.","solutions":["Re-run with an accepted token: `omp config set <key> true` (or false/1/0/yes/no/on/off).","Check for stray shell quotes: use `omp config set theme dark` not `omp config set theme \"'dark'\"`-style quoting mistakes for booleans.","Run `omp config get <key>` first to confirm the key is actually a boolean setting.","Run `omp config list` to see valid keys and their types."],"exampleFix":"// before\n$ omp config set autocommit enabled\n// after\n$ omp config set autocommit true","handlingStrategy":"validation","validationCode":"const BOOL_TOKENS = new Set([\"true\", \"false\", \"1\", \"0\", \"yes\", \"no\", \"on\", \"off\"]);\nfunction setBool(key: string, raw: string) {\n  if (!BOOL_TOKENS.has(raw.trim().toLowerCase())) throw new Error(`Use true/false, yes/no, on/off, or 1/0 for ${key}`);\n  return Bun.$`omp config set ${key} ${raw.trim().toLowerCase()}`;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use canonical `true`/`false` for booleans instead of yes/no variants","Quote values in the shell to avoid stray characters and trailing whitespace","Run `omp config list` to check a key's type before setting it"],"tags":["cli","config","validation","boolean"],"backgroundTag":"invalid-config-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}