Skip to content

Job priority queue: high-priority email tasks shouldn't wait behind background autoresearch #13

@FrederikHandberg

Description

@FrederikHandberg

Problem

An email from Frederik competes equally with a background autoresearch loop that's been running for 45+ minutes. Both slots can be filled with long low-priority work, and critical tasks wait in retry queue with no ETA.

No priority field exists in JobRequest. No preemption mechanism.

Fix

  1. Add priority: high | normal | low field to JobRequest schema in listen server
  2. Email agent sets priority: high for emails from frederik@tutoria.ac
  3. Scheduled background tasks (autoresearch, morning report) set priority: low
  4. Worker processes high-priority jobs first when deciding which queued job to start next
  5. Stretch: if high-priority job arrives and both slots are low/normal, pause the lowest-priority job at next safe checkpoint (after YAML write)

Acceptance Criteria

  • priority field in JobRequest schema
  • Email agent sets correct priority based on sender
  • Worker respects priority order when picking next job from queue
  • Dashboard shows priority in job list
  • High-priority job starts within 60 seconds even when queue has lower-priority jobs

Context

From Jensen limitation audit (2026-03-22). Workstream: WS-001.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions