RFD 1003: Task Manager job lifecycle
Problem
AI jobs run on a remote API. The API returns a job id and completes later. The UI must poll, retry, and show progress.
Decision
Use one task lifecycle for all job types.
- Create the task locally.
- POST the job to the API.
- Poll the job status until it completes or fails.
- Store the result on the task row.
TaskManager owns HTTP and polling. TaskContext exposes the lifecycle to React. The taskStore keeps the rows in memory.
Long jobs poll with a 3 second interval. The upload path falls back from file id to base64 when the upload endpoint is unavailable.
References
- Lifecycle:
src/library/taskManager.js - React hook:
src/context/TaskContext.jsx - Store:
src/stores/taskStore.js - API docs:
docs/api/api.md