# Running Unattended Overnight Solves on Ollama Cloud Without Runaway Spend or Lost Work

Published: 2026-10-18 | Domain: https://agentafk.si | Setup: https://agentafk.si/setup

## Outcome first: zero runaway API bills and zero corrupted repositories

Developers hesitate to leave an autonomous agent running overnight for two reasons: fear of waking up to a $400 API invoice from an infinite retry loop, and fear of waking up to a broken working tree where an unverified edit overwrote yesterday's working code. `agentafk.si` prevents both by combining **fixed-subscription Ollama Cloud / local model bindings**, **pre-execution call reservations**, and **mandatory Git rollback bundles**.

## Four accounting quantities tracked separately

Following the Loop Engine model-accounting rule, AgentAFK never conflates capacity with spend. Every overnight run record tracks four distinct quantities:

1. **`source_backed_capacity`**: The verified rate limit or subscription allowance of the configured endpoint (for example, Ollama Cloud or local `127.0.0.1:11434`).
2. **`selected_allocation`**: The maximum calls reserved for the specific task (`max_calls = 24`).
3. **`total_authority`**: The queue-wide ceiling across all tasks scheduled for the night.
4. **`provider_reported_usage`**: Observed prompt tokens, completion tokens, and wall-clock latency returned by each completed call.

## Pre-mutation Git bundle snapshots

Before any task in the overnight queue is permitted to modify a file in its isolated worktree, the worker creates a self-contained Git bundle (`git bundle create backup-<task_id>.bundle --all`) and records its `SHA-256` digest. If a task exhausts its call allocation without passing `verifier.py`, the worktree automatically restores to the pre-task bundle and saves the failed candidate diff as a separate diagnostic patch for morning review.
