Problem
No way to cap total token spend for a Ralph session. MAX_CALLS_PER_HOUR limits API calls per hour but not cumulative cost.
Proposal
New config option MAX_TOTAL_TOKENS=0 in .ralphrc (0 = unlimited):
- Track cumulative tokens across all loop iterations
- When cumulative tokens exceed the budget, gracefully exit (same flow as rate limit)
- Display remaining budget in the dashboard
Depends on #127 (token tracking).
Files
ralph/ralph_loop.sh — can_make_call() (line 769)
ralph/templates/ralphrc.template
Priority
14/16 — Medium impact, 2 hours effort
Problem
No way to cap total token spend for a Ralph session.
MAX_CALLS_PER_HOURlimits API calls per hour but not cumulative cost.Proposal
New config option
MAX_TOTAL_TOKENS=0in.ralphrc(0 = unlimited):Depends on #127 (token tracking).
Files
ralph/ralph_loop.sh—can_make_call()(line 769)ralph/templates/ralphrc.templatePriority
14/16 — Medium impact, 2 hours effort