Expand description
Limit heartbeat: the only way the node reads provider limits on purpose.
One light service PTY per signed-in provider account (claude, codex), outside the node’s
managed sessions: never shown in HQ, no record, no m4a account, no workspace. It runs the
provider CLI in its own scratch folder and, every interval (env
HATCHERY_LIMIT_HEARTBEAT_SECS, default 45, 15..=3600; 0 turns it off), types the
provider’s own local limit screen (/usage for claude, /status for codex), reads it off
the screen into crate::provider_limits (source heartbeat) and closes it with Escape.
Only slash commands are typed: no prompt, no model turn. A CLI that is not signed in
(none) gets no heartbeat. Tokens, OAuth and credential files are never touched.
A first start in the scratch folder may ask whether to trust it; the heartbeat answers the default (“yes”) for its own folder only.
Constants§
- PROVIDERS
- RELAUNCH_
MIN - A CLI start may itself cost the account (start-up requests), so the PTY is kept for the life of the node and a new one is started at most this often; the readings in between are slash commands into the same CLI.
Functions§
- command_
for - The slash command that shows
provider’s limits. - interval_
from - The heartbeat interval:
Nonewhen off. - relaunch_
after - Wait before the next start after a session that lived
lived. - scratch_
base - start
state_dir: the folder of the node state file.- trust_
keys - Keys that answer a start-up question about trusting the heartbeat’s own scratch folder
with “yes”: Enter when the selected option already says yes, else Down then Enter (claude
selects “No, exit” first).
Nonewhen the screen asks nothing of the kind.