{"record":{"id":"f3cff7859231d122","repo":"zylon-ai/private-gpt","slug":"scheduler-chat-mode-self-scheduler-chat-mode-r-r","errorCode":null,"errorMessage":"scheduler.chat.mode={self.scheduler.chat.mode!r} requires stream.broker=redis because API and chat worker processes must share stream state.","messagePattern":"scheduler\\.chat\\.mode=(.+?) requires stream\\.broker=redis because API and chat worker processes must share stream state\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"private_gpt/settings/settings.py","lineNumber":1888,"sourceCode":"\n        if self.scheduler.tools.mode not in {\"local\", \"celery\"}:\n            raise ValueError(\n                f\"Unsupported scheduler.tools.mode={self.scheduler.tools.mode!r}. \"\n                \"Supported tool scheduler modes are 'local' and 'celery'.\"\n            )\n\n        if self.scheduler.tools.mode == \"celery\" and self.scheduler.chat.mode != \"arq\":\n            raise ValueError(\n                f\"scheduler.tools.mode={self.scheduler.tools.mode!r} requires \"\n                \"scheduler.chat.mode='arq' so tool callbacks can resume shared \"\n                \"chat state.\"\n            )\n\n        if self.scheduler.chat.mode == \"local\":\n            return self\n\n        if self.stream.broker != \"redis\":\n            raise ValueError(\n                f\"scheduler.chat.mode={self.scheduler.chat.mode!r} requires stream.broker=redis \"\n                \"because API and chat worker processes must share stream state.\"\n            )\n\n        return self\n\n\n\"\"\"\nThis is visible just for DI or testing purposes.\n\nUse dependency injection or `settings()` method instead.\n\"\"\"\nunsafe_settings = load_active_settings()\n\n\"\"\"\nThis is visible just for DI or testing purposes.\n\nUse dependency injection or `settings()` method instead.","sourceCodeStart":1870,"sourceCodeEnd":1906,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/settings/settings.py#L1870-L1906","documentation":"Startup-time ValueError from the root Settings model_validator: any non-'local' chat scheduler mode (i.e. 'arq') requires stream.broker == 'redis'. In arq mode the API process and the chat worker are separate processes that must share streaming state, which is only possible through the Redis stream broker; the in-memory broker cannot bridge them.","triggerScenarios":"settings.yaml with scheduler.chat.mode: arq while stream.broker is left at its default (in-memory) or explicitly set to a non-redis value; enabling the arq chat worker without reconfiguring streaming.","commonSituations":"Scaling out to worker processes and forgetting the streaming dependency; per-profile YAMLs where the arq profile lacks the stream override; local dev defaults copied into a distributed deployment.","solutions":["Set stream.broker: redis when scheduler.chat.mode is arq.","Ensure Redis connection settings (host/port/credentials) are configured and reachable from both API and worker.","Or revert scheduler.chat.mode to local if you only have a single process.","Apply the change in every environment that enables arq mode, then restart API and workers together."],"exampleFix":"# before\nscheduler:\n  chat:\n    mode: arq\nstream:\n  broker: memory\n# after\nscheduler:\n  chat:\n    mode: arq\nstream:\n  broker: redis","handlingStrategy":"validation","validationCode":"chat_mode = cfg.get('scheduler', {}).get('chat', {}).get('mode')\nstream_broker = cfg.get('stream', {}).get('broker')\nassert chat_mode == 'local' or stream_broker == 'redis', 'arq chat requires redis stream broker'","typeGuard":"const arqNeedsRedis = (cfg: { scheduler: { chat: { mode: string } }; stream: { broker: string } }): boolean =>\n  cfg.scheduler.chat.mode !== 'arq' || cfg.stream.broker === 'redis';","tryCatchPattern":null,"preventionTips":["Whenever enabling scheduler.chat.mode=arq, set stream.broker=redis in the same commit.","Verify Redis reachability from both API and worker containers.","Include a smoke boot of the app in deployment pipelines."],"tags":["configuration","scheduler","arq","redis","streaming","startup"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}