{"record":{"id":"cabdd57b4e16ec4e","repo":"coder/code-server","slug":"idle-timeout-seconds-must-be-greater-than-60-sec","errorCode":null,"errorMessage":"--idle-timeout-seconds must be greater than 60 seconds.","messagePattern":"--idle-timeout-seconds must be greater than 60 seconds\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/node/cli.ts","lineNumber":452,"sourceCode":"        ;(args[key] as boolean) = true\n        continue\n      }\n\n      // Might already have a value if it was the --long=value format.\n      if (typeof value === \"undefined\") {\n        // A value is only valid if it doesn't look like an option.\n        value = argv[i + 1] && !argv[i + 1].startsWith(\"-\") ? argv[++i] : undefined\n      }\n\n      if (!value && option.type === OptionalString) {\n        ;(args[key] as OptionalString) = new OptionalString(value)\n        continue\n      } else if (!value) {\n        throw error(`--${key} requires a value`)\n      }\n\n      if (key === \"idle-timeout-seconds\" && Number(value) <= 60) {\n        throw new Error(\"--idle-timeout-seconds must be greater than 60 seconds.\")\n      }\n\n      if (option.type === OptionalString && value === \"false\") {\n        continue\n      }\n\n      if (option.path) {\n        value = path.resolve(value)\n      }\n\n      switch (option.type) {\n        case \"string\":\n          ;(args[key] as string) = value\n          break\n        case \"string[]\":\n          if (!args[key]) {\n            ;(args[key] as string[]) = []\n          }","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/coder/code-server/blob/8a7bf87a4d66914e328d97815e2faa9f25097866/src/node/cli.ts#L434-L470","documentation":"The CLI enforces that --idle-timeout-seconds be strictly greater than 60 (cli.ts:419). A timeout of 60 seconds or fewer would disconnect idle sessions so aggressively that legitimate pauses (compiling, reading) would drop the connection, so it is rejected at parse time.","triggerScenarios":"Calling `code-server --idle-timeout-seconds=30` (or any numeric value <= 60), or `--idle-timeout-seconds=60` (the boundary, also rejected).","commonSituations":"Operators trying to tighten resource usage by setting a very short idle disconnect; typos dropping a digit (e.g. `600` -> `60`).","solutions":["Set a value greater than 60, e.g. `--idle-timeout-seconds=900` (15 minutes)","To disable idle disconnect entirely, omit the flag (the default is 0/disabled)","Double-check the intended value if you copied it from a runbook"],"exampleFix":"# before\ncode-server --idle-timeout-seconds=30\n\n# after\ncode-server --idle-timeout-seconds=900","handlingStrategy":"validation","validationCode":"function validateIdleTimeout(seconds: number): void {\n  if (!Number.isFinite(seconds)) throw new Error(\"idle-timeout-seconds must be a number\")\n  if (seconds !== 0 && seconds <= 60) {\n    throw new Error(`idle-timeout-seconds must be > 60 (got ${seconds}); use 0 or omit to disable`)\n  }\n}\n// call before passing args to code-server\nvalidateIdleTimeout(Number(args[\"idle-timeout-seconds\"] ?? 0))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat 0/omitted as 'disabled' and any positive value as needing > 60","Centralize timeout validation in a config helper so all entry points share it","Document the lower bound in your deployment runbook"],"tags":["cli","validation","configuration","session"],"backgroundTag":null,"analyzedSha":"8a7bf87a4d66914e328d97815e2faa9f25097866","analyzedAt":"2026-09-22T02:34:03.345Z","contentChangedAt":"2026-09-22T02:34:03.345Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}