multica-ai/multica · error

agent_timeout must be a Go duration (e.g. 10m, 0s to disable

Error message

agent_timeout must be a Go duration (e.g. 10m, 0s to disable): %w

What it means

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'.

Source

Thrown at server/cmd/multica/cmd_config.go:224

		}
		cfg.PollInterval = value
	case "heartbeat_interval":
		if err := assignPositiveDuration(&cfg.HeartbeatInterval, key, value); err != nil {
			return err
		}
	case "agent_timeout":
		// agent_timeout is the one duration knob where "0s" is a
		// meaningful persisted value (it explicitly disables the
		// wall-clock cap; see cli.CLIConfig.AgentTimeout). Store the raw
		// string via a pointer so we can distinguish "not set" (nil)
		// from "disabled" (non-nil, "0s") and any positive value.
		if value == "" {
			cfg.AgentTimeout = nil
			return nil
		}
		d, err := time.ParseDuration(value)
		if err != nil {
			return fmt.Errorf("agent_timeout must be a Go duration (e.g. 10m, 0s to disable): %w", err)
		}
		if d < 0 {
			return fmt.Errorf("agent_timeout must be >= 0 (got %s); use 0s to disable the cap or \"\" to clear the persisted value", d)
		}
		s := value
		cfg.AgentTimeout = &s
	case "codex_semantic_inactivity_timeout":
		if err := assignPositiveDuration(&cfg.CodexSemanticInactivityTimeout, key, value); err != nil {
			return err
		}
	case "codex_handshake_timeout":
		if err := assignPositiveDuration(&cfg.CodexHandshakeTimeout, key, value); err != nil {
			return err
		}
	case "disable_auto_update":
		if err := assignBool(&cfg.DisableAutoUpdate, key, value); err != nil {
			return err
		}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Use Go duration syntax: `multica config set agent_timeout 10m`.
  2. To disable the wall-clock cap: `multica config set agent_timeout 0s`.
  3. To clear the persisted value: `multica config set agent_timeout ""`.

Example fix

# before
multica config set agent_timeout 10
# after
multica config set agent_timeout 10m
Defensive patterns

Strategy: validation

Validate before calling

# validate duration syntax (0s allowed) before config set
[[ "$VAL" =~ ^[0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h)+$ ]] || { echo "bad duration: $VAL" >&2; exit 2; }
multica config set agent_timeout "$VAL"

Prevention

When it happens

Trigger: `multica config set agent_timeout 10` (no unit), `... 10 minutes`, `... 1h30` (incomplete compound duration).

Common situations: Same duration-syntax pitfalls as poll_interval: bare numbers and human-readable units ('10m' works, '10 min' does not).

Understand the failure class

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/301ec64e787613b2. Report an issue: GitHub.