pi: add operator-configurable goal budgets and escalation #1211

Open
opened 2026-08-13 16:25:34 +00:00 by Ghost · 0 comments

Problem

A persistent Pi /goal currently stops at its bounded turn/no-progress limit, but remediation requires a launch-time environment variable and the goal-owning agent has no structured way to escalate a decision to the user or an orchestrator. /goal resume also resets the turn counter, allowing repeated autonomous budget resets.

Scope

  • Add /goal config, /goal config max-turns, and /goal config max-turns <int> for the current goal.
  • Treat max turns as an absolute, monotonic lifetime ceiling; resuming never resets consumed turns.
  • Permit limit changes only while autonomous continuation is stopped, require a ceiling above consumed turns, and retain the hard 1..500 range.
  • Keep environment settings as creation defaults only.
  • Add an agent-accessible structured escalate report that stops in a durable needs-attention state with evidence, requested action, and recommended remediation.
  • Convert max-turn and repeated-no-progress stops into durable escalation records visible to users and machine-readable by orchestrators.
  • Ensure the goal agent can recommend remediation but cannot alter limits or resume itself.
  • Preserve restoration compatibility for existing persisted goal state.
  • Update tests and user/admin/developer documentation.

Acceptance criteria

  1. An exhausted or otherwise stopped goal can be given a larger absolute ceiling with /goal config max-turns N, then resumed explicitly.
  2. Turn usage remains monotonic across pause, block, escalation, exhaustion, compaction, and resume.
  3. Configuration never resumes work and cannot be invoked through the model-facing goal report tool.
  4. Agent-requested and controller-generated escalations stop autonomous continuation, persist structured evidence/remediation data, and are shown by /goal status.
  5. Invalid, out-of-range, active-state, or non-increasing-budget changes fail closed.
  6. Existing state and lifecycle behavior remain covered by tests; no PostgreSQL access is needed.
## Problem A persistent Pi `/goal` currently stops at its bounded turn/no-progress limit, but remediation requires a launch-time environment variable and the goal-owning agent has no structured way to escalate a decision to the user or an orchestrator. `/goal resume` also resets the turn counter, allowing repeated autonomous budget resets. ## Scope - Add `/goal config`, `/goal config max-turns`, and `/goal config max-turns <int>` for the current goal. - Treat max turns as an absolute, monotonic lifetime ceiling; resuming never resets consumed turns. - Permit limit changes only while autonomous continuation is stopped, require a ceiling above consumed turns, and retain the hard `1..500` range. - Keep environment settings as creation defaults only. - Add an agent-accessible structured `escalate` report that stops in a durable `needs-attention` state with evidence, requested action, and recommended remediation. - Convert max-turn and repeated-no-progress stops into durable escalation records visible to users and machine-readable by orchestrators. - Ensure the goal agent can recommend remediation but cannot alter limits or resume itself. - Preserve restoration compatibility for existing persisted goal state. - Update tests and user/admin/developer documentation. ## Acceptance criteria 1. An exhausted or otherwise stopped goal can be given a larger absolute ceiling with `/goal config max-turns N`, then resumed explicitly. 2. Turn usage remains monotonic across pause, block, escalation, exhaustion, compaction, and resume. 3. Configuration never resumes work and cannot be invoked through the model-facing goal report tool. 4. Agent-requested and controller-generated escalations stop autonomous continuation, persist structured evidence/remediation data, and are shown by `/goal status`. 5. Invalid, out-of-range, active-state, or non-increasing-budget changes fail closed. 6. Existing state and lifecycle behavior remain covered by tests; no PostgreSQL access is needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1211