{"record":{"id":"96b010cc91051813","repo":"chenhg5/cc-connect","slug":"config-s-agent-session-idle-timeout-mins-must-be","errorCode":null,"errorMessage":"config: %s.agent_session_idle_timeout_mins must be >= 0","messagePattern":"config: (.+?)\\.agent_session_idle_timeout_mins must be >= 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1054,"sourceCode":"\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\n\t\t}\n\t}\n\treturn nil","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1036-L1072","documentation":"The optional agent_session_idle_timeout_mins setting bounds how long an agent session may stay idle before being timed out; negative values are invalid. The validator checks it only when present (pointer non-nil) and rejects any negative duration.","triggerScenarios":"Setting agent_session_idle_timeout_mins = -10 on a [[projects]] entry, so the nil-check passes but *proj.AgentSessionIdleTimeoutMins < 0 triggers the error.","commonSituations":"Using -1 as a 'never timeout' sentinel that this field does not support; sign typos; templating tools emitting negative defaults for unset durations.","solutions":["Set a non-negative value in minutes, e.g. agent_session_idle_timeout_mins = 60","Remove the key to use the built-in default idle timeout","If 'never timeout' is desired, check docs for a supported sentinel or a very large value"],"exampleFix":"// before\n[[projects]]\nname = \"my-app\"\nagent_session_idle_timeout_mins = -1\n// after\n[[projects]]\nname = \"my-app\"\nagent_session_idle_timeout_mins = 60","handlingStrategy":"validation","validationCode":"if proj.AgentSessionIdleTimeoutMins != nil && *proj.AgentSessionIdleTimeoutMins < 0 {\n    return fmt.Errorf(\"agent_session_idle_timeout_mins must be >= 0\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a large positive value rather than -1 for effectively-never timeout","Omit the key to use defaults","Validate config after scripted 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"}