BlaiseBlaise
Documentation
Runner and PlugsExplanation

Why time belongs to Blaise

Who decides when a session is idle, paused or over, and what that costs and buys.

A runner has no timers. It has no idle timeout, no pause timeout and no session deadline, and blaise.yml has no keys for them. Blaise decides, and tells the runner with a stop directive. This page explains why, and what follows.

What Blaise decides

DecisionWhere it is set
When a session is idleThe agent's inactivity limit
Whether an idle session pauses or endsThe agent's idle policy
How long a paused session waits for a messageThe agent's paused lifetime, up to a server cap
How long a run may takeThe agent's timeout

Blaise already receives every message the runner reports, so it knows when a session was last active. It checks on a fixed interval, so a limit is met to within the length of that interval, not to the second.

What the runner does with a stop

The directive arrives on the stream that already carries prompts and cancellations. It names a reason and says whether the session may resume. The runner ends the current run with that information, pauses the plugs inside out, tears down if the session may not resume, reports and exits. The plugs are told the same facts (PauseInfo and TeardownInfo), so they can skip work that only a later resume would use.

Why not on the runner

The alternative is a timer in the runner, as there was before: an idle timeout in the process that also runs the agent. It has three weaknesses.

  • Two sources of truth. Blaise has to know when a session ended to show it, bill it and resume it. If the runner decides, Blaise learns afterwards, and the two can disagree.
  • A dead runner enforces nothing. A crashed or disconnected runner cannot stop a session. Blaise can: it times the execution out whether or not a runner answers.
  • Policy is configuration of the agent, not of a machine. Several runners may serve one agent. A limit set in each blaise.yml can differ between them, and cannot be changed without restarting them.

What it costs

  • A stop only reaches a connected runner. A run that no runner is connected to is failed by Blaise after a minute, as is one that ignores a timeout stop. When someone ends a session and no runner receives the stop, the request fails and nothing changes.
  • Policy changes apply to sessions from then on. A paused session expires at the time it was given when it paused.
  • The runner learns the idle policy once, when it starts. The startup check that refuses a plug which cannot resume uses that value. Every run therefore also reports whether its plugs can resume, and Blaise never pauses a chain that cannot, whatever the policy says now.

The settings and the states are in Session settings and states. The life of a session as a whole is in The life of a session.

On this page