Skip to content

A pod session asks when its budget is spent, as a laptop session does, unless its terms set a turn or wall-clock limit; the platform's switches and approvals are not limits

Decision 1010 · accepted · 2026-11-16 · issue #986 · supersedes 660

Amends the pod paragraph of Decision 660 and nothing else of it: a spent budget is still a question, full_send still never asks, a subagent still never asks, and a limit somebody wrote into a session's terms is still a contract that stops.

The rule. contract/1 decides from the limit keys, max_turns and wall_clock_ms (the plane's wall_clock_seconds), not from the list's length:

  • Terms that set neither leave budget_asks at its default, true. The session asks the person attached exactly as on a laptop: budget_ask_started, the owner or anyone with control answers, input queues as input_queued meanwhile. :terms is still set, to no caps, which is what tells the question it runs on the platform (no workspace scope).
  • Terms that set either keep 660's contract: budget_asks: false, and the session stops at whichever of its limits is reached first, agent_done budget_exhausted as before. The caps still ride along as :terms, so nothing an answer did could raise past them (699).
  • approvals: deny is not a limit. A session under it asks, and the questions server's unattended mode answers no on the spot, so it ends budget_exhausted with the question and the no in its log, as 660 said for an unattended session.
  • full_send is unchanged: it never asks.
  • budget_micros is the plane's ledger, not the agent's budget, and is not touched.

The managed switches stay where they are, appended to the terms by with_managed/2: contract/1 no longer counts them, and a second channel for "configuration this session did not choose" would be one more thing to keep in step.

Nobody attached. The question waits in Troupe.Session.Questions, the agent waiting, as on a laptop whose client went away. The worker's idle timer used to treat a waiting agent as busy, so a pod with nobody there would have stayed awake on the question for good. It now sleeps on the usual schedule as an idle one does: nothing runs until somebody answers, the question is in the log, and the agent that wakes asks it again under the same id (660's fold), so the first client to attach finds it.

Not chosen. A term of its own (budget: ask | stop) that the plane would send, as D32 suggested: it adds a field to the wire, the trigger form and the console for a choice the limit keys already make. A trigger that wants a hard stop writes a limit; one that does not has nobody to stop for.

Governs: apps/troupe_worker/lib/troupe/worker/session/restore.ex, apps/troupe_worker/lib/troupe/worker/session/manager.ex, apps/troupe_core/lib/troupe/config/schema.ex