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_reasonin 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 ofurgentorhigh). - block_
is_ cold - Whether the agent in
block_idis a cold Claude session now, by the setting’s limit. - cold_
after_ ms - How long a session must be quiet to be cold, or
Nonewhen the hold is off. - is_cold
- A session is cold when it last wrote output more than
after_msago. 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]notetextfor the agent inblock_id(target), for a note that asks nothing urgent of it: delivered now, which starts a turn, to a warm session; kept underkeyfor 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.Nonewhen 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_idlast wrote output, orNonewhen 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
Nonewhen it may: a sender proven on this machine (or, withproven_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.