Overview
The ping budget applies only to background forks. Messages sent in the main session or interactive forks are user-initiated and never counted against the budget. When a background fork callsping_user or discord_embed, the budget
is checked first. If tokens are available, one is consumed and the
message goes through. If the budget is exhausted, the tool returns an
error to the agent (you are not notified) suggesting it use
report_updates to pass findings to the main session instead.
The budget file at
~/.ollim-bot/state/ping_budget.json is ephemeral
state — it is written atomically but never committed to git.How the bucket works
The ping budget uses a refill-on-read model. Tokens are not refilled on a timer — instead, every time the budget state is loaded, elapsed time since the last refill is used to calculate how many tokens have accumulated.| Field | Default | Description |
|---|---|---|
capacity | 5 | Maximum tokens the bucket can hold |
refill_rate_minutes | 90 | Minutes to regenerate one token |
available | 5.0 | Current token count (fractional during refill) |
daily_used | 0 | Pings consumed today (resets at midnight) |
critical_used | 0 | Critical pings today (resets at midnight) |
Critical bypass
Bothping_user and discord_embed accept a critical parameter.
When critical=True:
- The ping bypasses all three checks — per-session limit, busy
state, and ping budget. It is never blocked (unless
allow_pingisfalse). - The
critical_useddaily counter is incremented for tracking, but no budget token is consumed.
critical=True for things you
would be devastated to miss — time-sensitive deadlines, health
routines, urgent accountability nudges.
Busy state
When you are mid-conversation (the agent lock is held), background forks enter a “quiet when busy” mode:- Non-critical pings are blocked — the agent receives an error
telling it to use
report_updatesinstead - Critical pings go through regardless
- Background forks still run on schedule; only their output delivery is affected
- Per-session limit — each background fork is hard-limited to 1 ping
(
bg_ping_count() >= 1). This is enforced in code, not just advisory. - Busy check — if the user is mid-conversation, the ping is blocked.
- Budget check — if no tokens remain, the ping is blocked.
Agent awareness
At job-fire time, the background fork preamble injects the current budget status, upcoming schedule, and refill timing. This gives the agent enough context to make informed decisions about whether to ping or report. The preamble instructs the agent to:- Send at most 1 ping or embed per background fork (enforced by the per-session limit above)
- Ask “would the user regret missing this?” before pinging
- Use
report_updatesfor informational summaries and low-stakes check-ins - Save pings for time-sensitive actions, accountability nudges, and health routines
- When budget is tight, prioritize tasks you would regret missing
/ping-budget command
View or configure the ping budget from Discord.
- View status
- Configure
State format
The budget is stored as a single JSON file:~/.ollim-bot/state/ping_budget.json
Next steps
Background forks
How background forks run and when the budget applies.
MCP tools
Reference for
ping_user, discord_embed, and report_updates.Scheduling overview
How routines and reminders trigger background forks.
Real-world examples
See how routines use conditional silence and budget-aware
patterns in practice.
