Skip to main content

Module cold_hold

Module cold_hold 

Source
Expand description

Holding a routine message for an agent whose session has gone cold (SPEC_JEKT_HOLD_FOR_COLD_SESSIONS_2026_10_25.md). Holding a routine message for an agent whose session has gone cold (SPEC_JEKT_HOLD_FOR_COLD_SESSIONS_2026_10_25.md). A Claude session that has been quiet past the prompt cache’s lifetime pays for its whole context again on its next turn, so a message that could wait should not be what starts that turn. This module is the rules; server/jekt_cold.rs applies them and server/jekt_held.rs replays what was held.

Constants§

DEFAULT_COLD_MINUTES
A little under the prompt cache’s one hour, so a session is held before its cache has actually lapsed.
FILED_WINDOW_MS
How far back a task the sender filed for the target keeps its messages urgent.
REASON_IDLE
held_reason in the answer, and the held row’s reason.
REASON_QUOTA
The reason of a routine message kept back by quota mode (backend::quota_mode): it goes when the agent next writes output, or when the mode is off.
SETTING_COLD_MINUTES
The setting: minutes of quiet after which a session counts as cold. 0 turns the hold off.

Functions§

asks_to_wake
The sender asked for it to be delivered now (urgent: true, or a priority of urgent or high).
block_is_cold
Whether the agent in block_id is a cold Claude session now, by the setting’s limit.
cold_after_ms
How long a session must be quiet to be cold, or None when the hold is off.
is_cold
A session is cold when it last wrote output more than after_ms ago. One that has written nothing since it started is not cold: it has no cache to lose, and a message may be what it is waiting for.
is_routine
A message that may wait, from a sender proven on this machine (why_not_routine).
note_or_wait_if_cold
srv’s own [AgentMux] note text for the agent in block_id (target), for a note that asks nothing urgent of it: delivered now, which starts a turn, to a warm session; kept under key for the agent’s next turn, never starting one, when the session has gone cold.
session_activity
Whether a turn is in flight in the agent of block_id (a message joins it without a new context read), and when it last wrote output. None when nothing here can say: no controller, or one that tracks no turns (a shell or SSH pane), which is delivered to as before.
session_last_output
When the Claude session of block_id last wrote output, or None when it is not one to hold for: another provider (its cache works differently), no controller, or a turn in flight (it is working, whatever it last wrote).
task_numbers
The task numbers a message names (“#812”), at most [MAX_TASK_NUMBERS].
why_not_routine
Why a message may not wait, or None when it may: a sender proven on this machine (or, with proven_peer, one proven by the LAN or WAN checks), an ordinary tier, no files, and nothing the receiver’s rules would treat as sensitive. Anything else is delivered as before, and the reason is what the log says.