Add background task queue controls

Merged
SL
5mo ago
+774-4

Summary\n- persist each Codex run as a task with queued, running, completed, failed, and canceled states\n- track duration, exit status, status history, run profile, and linked session/message ids\n- add task cancel and retry actions through a local task API\n- add a chat header task queue panel that reconnects by polling persisted task state after refresh\n\n## Testing\n- pnpm -C apps/codex-claw lint\n- pnpm -C apps/codex-claw build\n- pnpm -C apps/codex-claw test\n\nCloses #89


Summary by cubic

Adds a background task queue for Codex runs with persistence, cancel/retry, and a chat header panel to monitor progress. Exposes /api/tasks for listing and controlling tasks, with status, duration, exit code, and history tracking.

  • New Features
    • Persist each Codex run as a task with states (queued/running/completed/failed/canceled), events, and metadata.
    • New API: GET /api/tasks to list tasks, POST /api/tasks with { action: 'cancel' | 'retry', id }.
    • Task Queue panel in the chat header; polls to reconnect after refresh and shows counts, details, and controls.
    • Server tracks live processes, updates tasks on exit, and supports cancellation and retry using the saved snapshot/run profile.