chore: prepare overnight automation 2026-03-03
Update loop scripts with rate limit handling, set plan for tonight's run, and update prompt.md with task instructions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
99cb01277a
commit
3f9f650232
@@ -104,6 +104,18 @@ Read, Glob, and Grep remain unrestricted.
|
||||
| `ITERATION_DELAY` | `600` | Seconds between iterations when `ITERATION_COUNT` > 1. |
|
||||
| `PROMPT_FILE` | `loop/prompt.md` | Prompt content for Claude. |
|
||||
| `LOG_FILE` | `loop/loop.log` | Log output (gitignored). |
|
||||
| `RATE_LIMIT_WAIT` | `3600` | Seconds to wait when rate limited (default 1 hour). |
|
||||
| `MAX_RATE_LIMIT_RETRIES` | `5` | Max rate limit retries before scheduling launchd job. |
|
||||
|
||||
## Rate Limit Handling
|
||||
|
||||
The loop script automatically detects rate limits (429, quota exceeded, etc.) and handles them:
|
||||
|
||||
1. **Inline retry** — On first rate limit hit, sleeps for `RATE_LIMIT_WAIT` seconds (default 1 hour) and retries.
|
||||
2. **Escalating retries** — Retries up to `MAX_RATE_LIMIT_RETRIES` times with the same wait.
|
||||
3. **launchd fallback** — After max retries, creates a self-cleaning launchd plist at `~/Library/LaunchAgents/com.aiui.overnight-retry.plist` that restarts the loop at the estimated reset time. The plist auto-removes after running.
|
||||
|
||||
This means you can walk away knowing the automation will survive rate limits overnight.
|
||||
|
||||
## Scheduling (Optional)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user