ollama-agent-queue — Test Cases
ollama-agent-queue — Test Cases
Functional
- Enqueue valid request
- Input: full required JSON payload.
- Expect:
pendingincrements, request appears inqueue.json.
- Reject missing required fields
- Input missing
agent_id. - Expect: non-zero exit + explicit missing field error.
- Input missing
- Priority ordering
- Enqueue 3 requests: normal, urgent, high.
- Process repeatedly.
- Expect order: urgent → high → normal.
- Duplicate agent_id protection
- Enqueue same
agent_idtwice. - Expect second enqueue rejected.
- Enqueue same
- Pause/resume behavior
- Pause queue, enqueue request, run
process-once. - Expect
queue_pausedand no processing. - Resume then process; expect normal execution.
- Pause queue, enqueue request, run
Reliability
- Model timeout handling
- Process with low timeout on long prompt.
- Expect callback file with
status=timeoutand timeout error.
- Ollama failure propagation
- Use invalid model string.
- Expect
status=errorand error detail captured.
- Crash-safe queue file write
- Verify
queue.json.tmpswaps atomically toqueue.json.
- Verify
- Lock-file discipline
- Create
queue.lockmanually and runprocess-once. - Expect no new processing while lock exists.
- Create
- Offline Ollama handling
- Stop Ollama and run worker/process-once.
- Expect 3 retries with backoff, queue status
paused_ollama_offline, pending items failed with error outputs.
- Resource-overload retry behavior
- Simulate
503/out of memoryresponse. - Expect one 30s backoff retry, then fail/continue if still broken.
- Simulate
- Consecutive resource-failure pause
- Force 3 consecutive resource errors across items.
- Expect queue status becomes
pausedand direct alert emitted.
- Stale-lock recovery path
- Create lock older than 10 minutes with
current_agentset and no Ollama process active. - Expect stale lock cleared, current agent timed out to callback, queue resumes.
- Create lock older than 10 minutes with
Output contract
- Result schema completeness
- Expect fields:
agent_id,calling_skill,model,status,result/error,duration_seconds,completed_at.
- Expect fields:
- Callback path honored
- Set custom callback path.
- Expect result JSON at that exact path.
Trigger-eval phrases (skill routing)
Should trigger
- “Show me the agent queue status”
- “How many agents are queued right now”
- “Pause the agent queue”
- “Something is stuck in the queue — skip current agent”
- “Clear the agent queue, we’re starting fresh”
- Council of Advisors registers 6 agents simultaneously (automatic)
- Memory-consolidator registers 1 agent (automatic)
Should NOT trigger
- “Draft an acknowledgment for the donation that came in”
- “What’s in my approval queue?” (queue-optimizer domain)
- “Run the morning brief”
- “Check system health”
- “Post to social media”