{"record":{"id":"f5727a52c49023a5","repo":"HKUDS/Vibe-Trading","slug":"swarm-worker-retry-max-delay-s-must-be-greater-tha","errorCode":null,"errorMessage":"SWARM_WORKER_RETRY_MAX_DELAY_S must be greater than or equal to SWARM_WORKER_RETRY_BASE_DELAY_S","messagePattern":"SWARM_WORKER_RETRY_MAX_DELAY_S must be greater than or equal to SWARM_WORKER_RETRY_BASE_DELAY_S","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/config/env_schema.py","lineNumber":359,"sourceCode":"\n    swarm_worker_timeout: int = Field(alias=\"SWARM_WORKER_TIMEOUT\", default=300)\n    swarm_worker_max_iter: int = Field(alias=\"SWARM_WORKER_MAX_ITER\", default=50)\n    swarm_max_workers: int = Field(alias=\"SWARM_MAX_WORKERS\", default=4)\n    swarm_timeout: int = Field(alias=\"SWARM_TIMEOUT\", default=1800)\n    swarm_heartbeat_interval_s: float = Field(alias=\"SWARM_HEARTBEAT_INTERVAL_S\", default=3.0)\n    swarm_stream_retry_delay_s: float = Field(alias=\"SWARM_STREAM_RETRY_DELAY_S\", default=1.0)\n    swarm_worker_retry_base_delay_s: float = Field(\n        alias=\"SWARM_WORKER_RETRY_BASE_DELAY_S\", default=1.0, ge=0\n    )\n    swarm_worker_retry_max_delay_s: float = Field(\n        alias=\"SWARM_WORKER_RETRY_MAX_DELAY_S\", default=30.0, ge=0\n    )\n    swarm_grounding_max_symbols: int = Field(alias=\"SWARM_GROUNDING_MAX_SYMBOLS\", default=8)\n\n    @model_validator(mode=\"after\")\n    def _validate_worker_retry_delays(self) -> SwarmConfig:\n        if self.swarm_worker_retry_max_delay_s < self.swarm_worker_retry_base_delay_s:\n            raise ValueError(\n                \"SWARM_WORKER_RETRY_MAX_DELAY_S must be greater than or equal to \"\n                \"SWARM_WORKER_RETRY_BASE_DELAY_S\"\n            )\n        return self\n\n\n# ---------------------------------------------------------------------------\n# Agent Tuning\n# ---------------------------------------------------------------------------\n\n\nclass AgentTuningConfig(_EnvBase):\n    \"\"\"Agent loop tuning, content-filter, scheduler, and feature flags.\n\n    Sources: ``src/agent/loop.py``, ``src/providers/content_filter.py``,\n    ``src/scheduled_research/executor.py``, ``src/live/order_guard.py``,\n    ``src/factors/_backend.py``, ``src/factors/bench_runner.py``,\n    ``src/tools/web_search_tool.py``, ``api_server.py``.","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/config/env_schema.py#L341-L377","documentation":"Raised by the SwarmConfig model_validator when SWARM_WORKER_RETRY_MAX_DELAY_S is strictly less than SWARM_WORKER_RETRY_BASE_DELAY_S. Since exponential backoff starts at the base delay and caps at the max, a max below base is nonsensical, so config parsing fails at validation time.","triggerScenarios":"Setting SWARM_WORKER_RETRY_MAX_DELAY_S to a smaller value than SWARM_WORKER_RETRY_BASE_DELAY_S via environment or config file, then constructing SwarmConfig.","commonSituations":"Copy-paste env files where units are confused (seconds vs ms); lowering max delay to speed up tests without adjusting base; typos in one of the two variables.","solutions":["Set SWARM_WORKER_RETRY_MAX_DELAY_S >= SWARM_WORKER_RETRY_BASE_DELAY_S (e.g. base=1, max=30).","If you intended fast retries, lower SWARM_WORKER_RETRY_BASE_DELAY_S instead.","Search .env / compose files for both variables and align them."],"exampleFix":"# before\nSWARM_WORKER_RETRY_BASE_DELAY_S=10\nSWARM_WORKER_RETRY_MAX_DELAY_S=5\n\n# after\nSWARM_WORKER_RETRY_BASE_DELAY_S=1\nSWARM_WORKER_RETRY_MAX_DELAY_S=30","handlingStrategy":"validation","validationCode":"def retry_delays_valid(base: float, mx: float) -> bool:\n    return base > 0 and mx >= base","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document both env vars side by side in .env.example with sane defaults","Add a config linter step in CI that checks max >= base","Use a single source of truth (config file) instead of scattered env overrides"],"tags":["config","env-var","retry","validation","swarm"],"backgroundTag":"config-validation-failed","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}