{"record":{"id":"802c433ee9528784","repo":"multica-ai/multica","slug":"poll-interval-must-be-positive-got-s-use-conf","errorCode":null,"errorMessage":"poll_interval must be positive (got %s); use `config set poll_interval \"\"` to clear it","messagePattern":"poll_interval must be positive \\(got (.+?)\\); use `config set poll_interval \"\"` to clear it","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_config.go","lineNumber":205,"sourceCode":"\t\t}\n\t\tcfg.MaxConcurrentTasks = n\n\tcase \"poll_interval\":\n\t\tif value == \"\" {\n\t\t\tcfg.PollInterval = \"\"\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(\"poll_interval must be a Go duration (e.g. 10s, 500ms): %w\", err)\n\t\t}\n\t\t// Reject zero and negative durations. Persisting \"0s\" would look\n\t\t// configured in `config show` but be silently ignored at daemon\n\t\t// start (the resolver only substitutes strictly positive values),\n\t\t// which is exactly the trap reported in #3824's review. Empty\n\t\t// string is the one and only way to clear a previously persisted\n\t\t// value.\n\t\tif d <= 0 {\n\t\t\treturn fmt.Errorf(\"poll_interval must be positive (got %s); use `config set poll_interval \\\"\\\"` to clear it\", d)\n\t\t}\n\t\tcfg.PollInterval = value\n\tcase \"heartbeat_interval\":\n\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 {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_config.go#L187-L223","documentation":"poll_interval accepts only strictly positive durations. '0s' and negative values are rejected deliberately: the daemon's resolver only substitutes strictly positive values, so persisting '0s' would display as configured in `config show` while being silently ignored at daemon start (the trap from issue #3824's review). Empty string is the only way to clear the persisted value.","triggerScenarios":"`multica config set poll_interval 0s`, `... -5s`, or `... 0ms` intending to disable polling.","commonSituations":"Trying to 'turn off' polling by setting zero; copy-pasting a zero default from a template; sign errors in computed durations.","solutions":["To clear the override and fall back to the default: `multica config set poll_interval \"\"`.","To slow polling instead of disabling it, set a large positive value (e.g. 1h).","If you truly need polling disabled, look for a dedicated disable flag in `config show`/docs rather than zeroing the interval."],"exampleFix":"# before\nmultica config set poll_interval 0s\n# after (clear the persisted override)\nmultica config set poll_interval \"\"","handlingStrategy":"validation","validationCode":"# reject zero/negative and translate 'disable' into a clear\nif [ \"$VAL\" = \"0s\" ] || [[ \"$VAL\" == -* ]]; then VAL=\"\"; fi\nmultica config set poll_interval \"$VAL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat `config set <key> \"\"` as the canonical 'revert to default' operation.","Never encode 'disabled' as 0s for the shared duration knobs — only agent_timeout gives zero a meaning."],"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"}