{"agent":"claude","input":"Add retries with exponential backoff to this app's Celery tasks that call outside services, and only to those. Read every Python file, requirements.txt and the README first. For each task, say what it calls outside the worker, which exceptions that call can raise, and how the task is queued. Give no retry policy to a task that does no outside I/O, and say why. For the tasks that need one, split the exceptions into transient (connection refused or reset, timeouts, server disconnects, temporary server replies) and permanent (authentication failures, refused recipients, validation errors). Retry only the transient ones: use autoretry_for for exception classes, and bind the task and call self.retry for cases that need the error's code. Use backoff with jitter and a low max_retries. Before using an option, check that the pinned Celery version supports it; do not upgrade Celery. Do not change acks_late or other delivery settings; instead write down whether the task is safe to run twice, and compare the longest retry delay and any countdown in the code with the broker's visibility timeout. Add pytest tests that replace the outside call: transient failures followed by success, a permanent failure that must not retry, and exhaustion of max_retries. Then prove it against a real broker: install and start Redis, run a worker with the outside service pointed at a closed loopback port, queue one task, and capture the worker log showing each retry and its delay. Open a pull request with the reasoning, the tests and the log.","resources":[{"url":"https://github.com/your-org/your-app"}]}