{"record":{"id":"b0d2df952be41620","repo":"plandex-ai/plandex","slug":"invalid-value-s","errorCode":null,"errorMessage":"invalid value: %s","messagePattern":"invalid value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/cli/cmd/set_config.go","lineNumber":327,"sourceCode":"\t\t\tvar cmdArgs []string\n\t\t\tif len(fields) > 1 {\n\t\t\t\tcmdArgs = fields[1:]\n\t\t\t}\n\t\t\tcfgSetting.EditorSetter(&config, value, cmd, cmdArgs)\n\t\t}\n\t}\n\n\treturn setting, &config\n}\n\nfunc parseBooleanArg(value string) (bool, error) {\n\tswitch value {\n\tcase \"enabled\", \"true\", \"t\", \"yes\", \"y\", \"1\":\n\t\treturn true, nil\n\tcase \"disabled\", \"false\", \"f\", \"no\", \"n\", \"0\":\n\t\treturn false, nil\n\tdefault:\n\t\treturn false, fmt.Errorf(\"invalid value: %s\", value)\n\t}\n\n}\n\nfunc loadMapIfNeeded(originalConfig, updatedConfig *shared.PlanConfig) {\n\tif updatedConfig.AutoLoadContext && !originalConfig.AutoLoadContext {\n\t\thasMap := false\n\n\t\tterm.StartSpinner(\"\")\n\t\tcontext, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)\n\n\t\tif err == nil {\n\t\t\tfor _, c := range context {\n\t\t\t\tif c.ContextType == shared.ContextMapType {\n\t\t\t\t\thasMap = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/set_config.go#L309-L345","documentation":"parseBooleanArg validates string values that must represent a boolean plan-config toggle. Any value outside the accepted set (enabled/true/t/yes/y/1, disabled/false/f/no/n/0) makes it return 'invalid value: %s', and updateConfig propagates it, aborting the config update.","triggerScenarios":"Passing an unrecognized string as a boolean argument to a set_config command, e.g. `--autoload-context ON`, `Enabled` (wrong case), or an empty string. Typing values like 'off', 'enable', or '2' also triggers it.","commonSituations":"Users guessing at flag values; scripts generated for a different CLI version with different accepted tokens; shell variables expanding to empty or unexpected values.","solutions":["Use one of the accepted values: enabled/true/t/yes/y/1 or disabled/false/f/no/n/0","Check the command help output for the documented value names","Fix case sensitivity — the parser is exact ('True' is invalid, 'true' works)","Quote values in shells so empty strings don't collapse the argument"],"exampleFix":"// before\nset-config --auto-load-context on\n// after\nset-config --auto-load-context enabled","handlingStrategy":"validation","validationCode":"var validBoolValues = map[string]bool{\n\t\"enabled\": true, \"true\": true, \"t\": true, \"yes\": true, \"y\": true, \"1\": true,\n\t\"disabled\": true, \"false\": true, \"f\": true, \"no\": true, \"n\": true, \"0\": true,\n}\nfunc isValidBoolArg(v string) bool { return validBoolValues[strings.ToLower(v)] == true } // note: source match is case-sensitive; normalize before comparing","typeGuard":"func parseBoolArg(v string) (bool, error) {\n\tswitch v {\n\tcase \"enabled\", \"true\", \"t\", \"yes\", \"y\", \"1\": return true, nil\n\tcase \"disabled\", \"false\", \"f\", \"no\", \"n\", \"0\": return false, nil\n\tdefault: return false, fmt.Errorf(\"invalid value: %s (use true/false, yes/no, on/off equivalents: enabled/disabled)\", v)\n\t}\n}","tryCatchPattern":"enabled, err := parseBooleanArg(value)\nif err != nil {\n\treturn fmt.Errorf(\"%w — accepted values: enabled/true/t/yes/y/1 or disabled/false/f/no/n/0\", err)\n}","preventionTips":["Only pass values from the documented accepted list","Normalize case/whitespace in shell scripts before passing flag values","Quote arguments so empty shell variables don't produce empty strings","Check the command's help text for the exact accepted tokens"],"tags":["go","cli","validation","config"],"backgroundTag":"invalid-argument-value","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}