{"record":{"id":"301ec64e787613b2","repo":"multica-ai/multica","slug":"agent-timeout-must-be-a-go-duration-e-g-10m-0s","errorCode":null,"errorMessage":"agent_timeout must be a Go duration (e.g. 10m, 0s to disable): %w","messagePattern":"agent_timeout must be a Go duration \\(e\\.g\\. 10m, 0s to disable\\): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_config.go","lineNumber":224,"sourceCode":"\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 {\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}","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_config.go#L206-L242","documentation":"agent_timeout is stored as a raw string via a pointer so the CLI can distinguish not-set (nil), disabled (\"0s\"), and a positive cap. The value must parse as a Go duration (unit suffix required). Empty string is handled before parsing as 'clear'.","triggerScenarios":"`multica config set agent_timeout 10` (no unit), `... 10 minutes`, `... 1h30` (incomplete compound duration).","commonSituations":"Same duration-syntax pitfalls as poll_interval: bare numbers and human-readable units ('10m' works, '10 min' does not).","solutions":["Use Go duration syntax: `multica config set agent_timeout 10m`.","To disable the wall-clock cap: `multica config set agent_timeout 0s`.","To clear the persisted value: `multica config set agent_timeout \"\"`."],"exampleFix":"# before\nmultica config set agent_timeout 10\n# after\nmultica config set agent_timeout 10m","handlingStrategy":"validation","validationCode":"# validate duration syntax (0s allowed) before config set\n[[ \"$VAL\" =~ ^[0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h)+$ ]] || { echo \"bad duration: $VAL\" >&2; exit 2; }\nmultica config set agent_timeout \"$VAL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use explicit units for agent_timeout: 10m, 30s, or 0s to disable.","Remember agent_timeout is tri-state: \"\" clears, 0s disables, positive caps."],"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"}