{"record":{"id":"aa900bdd2738451b","repo":"chenhg5/cc-connect","slug":"config-s-reset-on-idle-mins-must-be-0","errorCode":null,"errorMessage":"config: %s.reset_on_idle_mins must be >= 0","messagePattern":"config: (.+?)\\.reset_on_idle_mins must be >= 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1051,"sourceCode":"\t\t}\n\t\tif len(proj.Platforms) == 0 && !permissive {\n\t\t\treturn fmt.Errorf(\"config: %s needs at least one [[projects.platforms]]\", prefix)\n\t\t}\n\t\tfor j, p := range proj.Platforms {\n\t\t\tif p.Type == \"\" {\n\t\t\t\treturn fmt.Errorf(\"config: %s.platforms[%d].type is required\", prefix, j)\n\t\t\t}\n\t\t}\n\t\tif proj.Mode == \"multi-workspace\" {\n\t\t\tif proj.BaseDir == \"\" {\n\t\t\t\treturn fmt.Errorf(\"project %q: multi-workspace mode requires base_dir\", proj.Name)\n\t\t\t}\n\t\t\tif _, ok := proj.Agent.Options[\"work_dir\"]; ok {\n\t\t\t\treturn fmt.Errorf(\"project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)\", proj.Name)\n\t\t\t}\n\t\t}\n\t\tif proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {\n\t\t\treturn fmt.Errorf(\"config: %s.reset_on_idle_mins must be >= 0\", prefix)\n\t\t}\n\t\tif proj.AgentSessionIdleTimeoutMins != nil && *proj.AgentSessionIdleTimeoutMins < 0 {\n\t\t\treturn fmt.Errorf(\"config: %s.agent_session_idle_timeout_mins must be >= 0\", prefix)\n\t\t}\n\t\tif err := validateRunAsUser(prefix, proj.RunAsUser); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateRunAsEnv(prefix, proj.RunAsEnv); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateReferenceConfig(prefix, proj.References); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateUsersConfig(prefix, proj.Users); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateDisplayConfig(prefix+\".display\", proj.Display); err != nil {\n\t\t\treturn err","sourceCodeStart":1033,"sourceCodeEnd":1069,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1033-L1069","documentation":"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.","triggerScenarios":"Setting a negative number like reset_on_idle_mins = -5 (or -1) on a [[projects]] entry, causing *proj.ResetOnIdleMins < 0 during validation.","commonSituations":"Typing -1 intending 'disable reset' or 'infinite'; sign typo while editing; scripting config generation with an uninitialized/default -1 sentinel value.","solutions":["Change the value to a non-negative integer (minutes), e.g. reset_on_idle_mins = 30","Remove the reset_on_idle_mins key entirely to accept the default behavior","Check upstream config generators for negative sentinel defaults"],"exampleFix":"// before\n[[projects]]\nname = \"my-app\"\nreset_on_idle_mins = -1\n// after\n[[projects]]\nname = \"my-app\"\nreset_on_idle_mins = 30","handlingStrategy":"validation","validationCode":"if proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {\n    return fmt.Errorf(\"reset_on_idle_mins must be >= 0\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only non-negative minute values; there is no -1 'disabled' sentinel — omit the key instead","Check generated configs for negative defaults","Sanity-check sign of numeric fields after bulk edits"],"tags":["config","validation","go"],"backgroundTag":"value-out-of-range","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}