Apply start_retriable to agent background tasks
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Overview
Apply the `start_retriable` pattern to agent-related background tasks as part of the Redis-based background task migration.
## Acceptance Criteria
- All agent background tasks use `start_retriable` for retry logic
- Consistent error handling and retry behavior across agent tasks
- Tests verify retry mechanism works correctly
## Technical Notes
- Review existing agent background task implementations
- Replace current retry mechanisms with `start_retriable`
- Ensure proper error handling and logging
## Implementation Structure
Follow the same structure as `src/ai/backend/storage/bgtask`:
```
src/ai/backend/agent/bgtask/
├── __init__.py
├── registry.py # BgtaskHandlerRegistryCreator - register all handlers
├── tags.py # Task tag constants (if needed)
└── tasks/ # Individual task handler modules
├── __init__.py
└── {task_name}.py # Each handler inherits BaseBackgroundTaskHandler
```
**Task Handler Pattern:**
- Define `Args` class inheriting `BaseBackgroundTaskArgs`
- Define `Handler` class inheriting `BaseBackgroundTaskHandler[ArgsType]`
- Implement `name()`, `args_type()`, `execute()` methods
- Register handlers in `registry.py`
JIRA Issue: BA-2689
Contributor guide
Assessment
This issue has not been assessed yet.