{"record":{"id":"ff38b734d0e24860","repo":"multica-ai/multica","slug":"agent-timeout-must-be-0-got-s-use-0s-to-dis","errorCode":null,"errorMessage":"agent_timeout must be >= 0 (got %s); use 0s to disable the cap or \"\" to clear the persisted value","messagePattern":"agent_timeout must be >= 0 \\(got (.+?)\\); use 0s to disable the cap or \"\" to clear the persisted value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_config.go","lineNumber":227,"sourceCode":"\t\tif err := assignPositiveDuration(&cfg.HeartbeatInterval, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"agent_timeout\":\n\t\t// agent_timeout is the one duration knob where \"0s\" is a\n\t\t// meaningful persisted value (it explicitly disables the\n\t\t// wall-clock cap; see cli.CLIConfig.AgentTimeout). Store the raw\n\t\t// string via a pointer so we can distinguish \"not set\" (nil)\n\t\t// from \"disabled\" (non-nil, \"0s\") and any positive value.\n\t\tif value == \"\" {\n\t\t\tcfg.AgentTimeout = nil\n\t\t\treturn nil\n\t\t}\n\t\td, err := time.ParseDuration(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"agent_timeout must be a Go duration (e.g. 10m, 0s to disable): %w\", err)\n\t\t}\n\t\tif d < 0 {\n\t\t\treturn fmt.Errorf(\"agent_timeout must be >= 0 (got %s); use 0s to disable the cap or \\\"\\\" to clear the persisted value\", d)\n\t\t}\n\t\ts := value\n\t\tcfg.AgentTimeout = &s\n\tcase \"codex_semantic_inactivity_timeout\":\n\t\tif err := assignPositiveDuration(&cfg.CodexSemanticInactivityTimeout, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"codex_handshake_timeout\":\n\t\tif err := assignPositiveDuration(&cfg.CodexHandshakeTimeout, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"disable_auto_update\":\n\t\tif err := assignBool(&cfg.DisableAutoUpdate, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"auto_update_check_interval\":\n\t\tif err := assignPositiveDuration(&cfg.AutoUpdateCheckInterval, key, value); err != nil {\n\t\t\treturn err","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_config.go#L209-L245","documentation":"After parsing, agent_timeout rejects negative durations. Unlike the other duration knobs, zero ('0s') is allowed here because it explicitly disables the agent wall-clock cap; only values below zero are invalid.","triggerScenarios":"`multica config set agent_timeout -5m`, or a computed duration that underflows below zero.","commonSituations":"Scripted timeouts derived from subtraction; sign typos.","solutions":["Use a positive duration (`10m`) or `0s` to disable the cap.","Use `\"\"` to clear the persisted value and fall back to env/default."],"exampleFix":"# before\nmultica config set agent_timeout -5m\n# after\nmultica config set agent_timeout 0s","handlingStrategy":"validation","validationCode":"# normalize intent before setting\nif [[ \"$VAL\" == -* ]]; then VAL=\"0s\"; fi   # 'disable' instead of negative\nmultica config set agent_timeout \"$VAL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express 'no cap' as 0s, never as a negative duration.","Assert duration >= 0 in any wrapper that computes agent_timeout."],"tags":["cli","config","duration","validation","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}