chenhg5/cc-connect · error

config: %s.reset_on_idle_mins must be >= 0

Error message

config: %s.reset_on_idle_mins must be >= 0

What it means

The optional per-project reset_on_idle_mins setting controls how long an idle session may persist before reset; negative values are meaningless and rejected. The validator only checks it when the pointer is non-nil, i.e. when the key is present in config.

Source

Thrown at config/config.go:1051

		}
		if len(proj.Platforms) == 0 && !permissive {
			return fmt.Errorf("config: %s needs at least one [[projects.platforms]]", prefix)
		}
		for j, p := range proj.Platforms {
			if p.Type == "" {
				return fmt.Errorf("config: %s.platforms[%d].type is required", prefix, j)
			}
		}
		if proj.Mode == "multi-workspace" {
			if proj.BaseDir == "" {
				return fmt.Errorf("project %q: multi-workspace mode requires base_dir", proj.Name)
			}
			if _, ok := proj.Agent.Options["work_dir"]; ok {
				return fmt.Errorf("project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)", proj.Name)
			}
		}
		if proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {
			return fmt.Errorf("config: %s.reset_on_idle_mins must be >= 0", prefix)
		}
		if proj.AgentSessionIdleTimeoutMins != nil && *proj.AgentSessionIdleTimeoutMins < 0 {
			return fmt.Errorf("config: %s.agent_session_idle_timeout_mins must be >= 0", prefix)
		}
		if err := validateRunAsUser(prefix, proj.RunAsUser); err != nil {
			return err
		}
		if err := validateRunAsEnv(prefix, proj.RunAsEnv); err != nil {
			return err
		}
		if err := validateReferenceConfig(prefix, proj.References); err != nil {
			return err
		}
		if err := validateUsersConfig(prefix, proj.Users); err != nil {
			return err
		}
		if err := validateDisplayConfig(prefix+".display", proj.Display); err != nil {
			return err

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Change the value to a non-negative integer (minutes), e.g. reset_on_idle_mins = 30
  2. Remove the reset_on_idle_mins key entirely to accept the default behavior
  3. Check upstream config generators for negative sentinel defaults

Example fix

// before
[[projects]]
name = "my-app"
reset_on_idle_mins = -1
// after
[[projects]]
name = "my-app"
reset_on_idle_mins = 30
Defensive patterns

Strategy: validation

Validate before calling

if proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {
    return fmt.Errorf("reset_on_idle_mins must be >= 0")
}

Prevention

When it happens

Trigger: Setting a negative number like reset_on_idle_mins = -5 (or -1) on a [[projects]] entry, causing *proj.ResetOnIdleMins < 0 during validation.

Common situations: Typing -1 intending 'disable reset' or 'infinite'; sign typo while editing; scripting config generation with an uninitialized/default -1 sentinel value.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/aa900bdd2738451b. Report an issue: GitHub.