plandex-ai/plandex · warning

invalid value: %s

Error message

invalid value: %s

What it means

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.

Source

Thrown at app/cli/cmd/set_config.go:327

			var cmdArgs []string
			if len(fields) > 1 {
				cmdArgs = fields[1:]
			}
			cfgSetting.EditorSetter(&config, value, cmd, cmdArgs)
		}
	}

	return setting, &config
}

func parseBooleanArg(value string) (bool, error) {
	switch value {
	case "enabled", "true", "t", "yes", "y", "1":
		return true, nil
	case "disabled", "false", "f", "no", "n", "0":
		return false, nil
	default:
		return false, fmt.Errorf("invalid value: %s", value)
	}

}

func loadMapIfNeeded(originalConfig, updatedConfig *shared.PlanConfig) {
	if updatedConfig.AutoLoadContext && !originalConfig.AutoLoadContext {
		hasMap := false

		term.StartSpinner("")
		context, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)

		if err == nil {
			for _, c := range context {
				if c.ContextType == shared.ContextMapType {
					hasMap = true
					break
				}
			}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Use one of the accepted values: enabled/true/t/yes/y/1 or disabled/false/f/no/n/0
  2. Check the command help output for the documented value names
  3. Fix case sensitivity — the parser is exact ('True' is invalid, 'true' works)
  4. Quote values in shells so empty strings don't collapse the argument

Example fix

// before
set-config --auto-load-context on
// after
set-config --auto-load-context enabled
Defensive patterns

Strategy: validation

Validate before calling

var validBoolValues = map[string]bool{
	"enabled": true, "true": true, "t": true, "yes": true, "y": true, "1": true,
	"disabled": true, "false": true, "f": true, "no": true, "n": true, "0": true,
}
func isValidBoolArg(v string) bool { return validBoolValues[strings.ToLower(v)] == true } // note: source match is case-sensitive; normalize before comparing

Type guard

func parseBoolArg(v string) (bool, error) {
	switch v {
	case "enabled", "true", "t", "yes", "y", "1": return true, nil
	case "disabled", "false", "f", "no", "n", "0": return false, nil
	default: return false, fmt.Errorf("invalid value: %s (use true/false, yes/no, on/off equivalents: enabled/disabled)", v)
	}
}

Try / catch

enabled, err := parseBooleanArg(value)
if err != nil {
	return fmt.Errorf("%w — accepted values: enabled/true/t/yes/y/1 or disabled/false/f/no/n/0", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: Users guessing at flag values; scripts generated for a different CLI version with different accepted tokens; shell variables expanding to empty or unexpected values.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/b0d2df952be41620. Report an issue: GitHub.