{"record":{"id":"3b8197e0e98029ab","repo":"zylon-ai/private-gpt","slug":"scheduler-tools-mode-self-scheduler-tools-mode-r","errorCode":null,"errorMessage":"scheduler.tools.mode={self.scheduler.tools.mode!r} requires scheduler.chat.mode='arq' so tool callbacks can resume shared chat state.","messagePattern":"scheduler\\.tools\\.mode=(.+?) requires scheduler\\.chat\\.mode='arq' so tool callbacks can resume shared chat state\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"private_gpt/settings/settings.py","lineNumber":1878,"sourceCode":"        description=\"Scheduler configuration for chat and tool workers.\",\n    )\n\n    @model_validator(mode=\"after\")\n    def validate_chat_scheduler_configuration(self) -> \"Settings\":\n        if self.scheduler.chat.mode not in {\"local\", \"arq\"}:\n            raise ValueError(\n                f\"Unsupported scheduler.chat.mode={self.scheduler.chat.mode!r}. \"\n                \"Supported chat scheduler modes are 'local' and 'arq'.\"\n            )\n\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\"\"\"","sourceCodeStart":1860,"sourceCodeEnd":1896,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/settings/settings.py#L1860-L1896","documentation":"Startup-time ValueError from the root Settings model_validator: choosing scheduler.tools.mode='celery' forces scheduler.chat.mode='arq'. Celery tool workers publish their results back through shared chat state that only the ARQ/Redis chat pipeline can resume, so the combination (celery tools + local chat) is rejected at boot.","triggerScenarios":"settings.yaml with scheduler: {chat: {mode: local}, tools: {mode: celery}} — typically someone enables Celery for heavy tool calls but leaves chat on the default 'local'.","commonSituations":"Incrementally adopting distributed execution: tools first, chat later; default chat mode being local so merely adding tools.mode=celery triggers it; merged overlays where one file sets chat local and another sets tools celery.","solutions":["Set scheduler.chat.mode: arq alongside scheduler.tools.mode: celery.","Or keep tools on 'local' if you are not ready to run the ARQ chat worker.","When chat mode is arq, also ensure stream.broker is redis (the sibling validator requires it).","Deploy the ARQ chat worker process before switching modes, or chat requests will queue with no consumer."],"exampleFix":"# before\nscheduler:\n  chat:\n    mode: local\n  tools:\n    mode: celery\n# after\nscheduler:\n  chat:\n    mode: arq\n  tools:\n    mode: celery","handlingStrategy":"validation","validationCode":"s = cfg.get('scheduler', {})\nchat, tools = s.get('chat', {}).get('mode'), s.get('tools', {}).get('mode')\nassert not (tools == 'celery' and chat != 'arq'), 'celery tools requires arq chat'","typeGuard":"const schedulerPairValid = (s: { chat: { mode: string }; tools: { mode: string } }): boolean =>\n  !(s.tools.mode === 'celery' && s.chat.mode !== 'arq');","tryCatchPattern":null,"preventionTips":["Treat scheduler config as one unit — change chat and tools modes together.","Provision the ARQ chat worker and Redis stream broker before enabling celery tools.","Add a config-lint rule for the coupling so it fails before boot."],"tags":["configuration","scheduler","celery","arq","startup","coupled-config"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}