@signalridge/pi-goal1.7.0
Pi extension for autonomous /goal completion with stable, opt-in ordered queues.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-goal — goal mode for the Pi coding agent
@signalridge/pi-goal is a native Pi coding agent extension that adds session-scoped /goal commands, a goal_complete({ goal_id, summary }) completion tool, and a strict goal_blocked({ goal_id, reason, evidence, repeated_turns }) impasse tool for autonomous, verifiable task completion. A stable, opt-in ordered queue extends the same command and tool namespace. Queue execution remains off by default.
Goal mode uses Codex-like persistence instructions and sends guarded continuation messages from Pi's fully settled idle boundary until the agent completes the goal, the user pauses or clears it, a safety circuit breaker trips, a true blocker or provider usage limit stops it, or an optional token budget is reached. With ordered goals enabled, the same lifecycle advances through queued objectives one at a time.
Install
The current tested host is Pi 1.4.0. Host-provided dependencies use "*" peers to identify module ownership, not to guarantee compatibility with every Pi version. See the compatibility guide for verification details. The agent_settled lifecycle event this extension depends on landed in 0.80.6.
pi install npm:@signalridge/pi-goal
Use from this checkout
From the repository root:
pi -e ./packages/pi-goal
Quick start
/goal --tokens 100k fix the failing test and verify it
/goal status
/goal pause
/goal resume
Bare /goal opens a state-aware TUI manager; RPC reports status. Print/JSON status commands reject observably. A reached automatic-work limit offers Review and continue without losing objective, usage, active time or queue.
Commands
| Command | Action |
|---|---|
/goal <objective> / --tokens <budget> |
Start or confirm replacement; budgets accept 100k, 1.5m |
/goal status |
Current state and accounting |
/goal edit [--tokens <budget>] <objective> |
Preserve usage; an exhausted budget reactivates only if raised above usage |
/goal pause / resume |
Stop / explicitly restart with a fresh guard ID and safety epoch |
/goal clear |
Remove current goal/queue and pending intent, not unrelated work |
/goal add / prioritize |
Queue append / urgent head, each accepting --tokens |
/goal drop-last / skip |
Remove tail / head; activate successors only when settled |
Objectives are limited to 4,000 characters; reference a file for longer instructions. Queue commands require opt-in; hidden aliases are push/unshift/pop/shift. Disabled queue words stay ordinary objective text (/goal add docs starts “add docs”). Direct destructive routes remain immediate for compatibility; menu actions preview and confirm. Full commands, failure rollback and manager controls.
Configuration
Optional global ~/.pi/agent/pi-goal.json; absent files are not created until an explicit Settings save.
| Key | Default | Meaning |
|---|---|---|
toolVisibility |
after-first-goal |
Hide terminal tools until activation/unfinished restore; always keeps the baseline schema |
experimental.goals |
false |
Stable ordered queue, OFF until explicitly enabled |
experimental.notices |
true |
Once-per-session queue announcement only; failures still warn |
rpc.enabled |
false |
Trusted sibling cooperation, not authentication/sandboxing |
continuationLimits.automaticTurns |
25 |
Positive safe integer; explicit null means Unlimited |
continuationLimits.noProgressTurns |
3 |
Positive safe integer; null disables the repeat heuristic |
The legacy experimental namespace and both booleans remain fully supported, not deprecated or migrated. Menu writes apply immediately; external edits need reload. Invalid files remain untouched and Settings becomes read-only. Unlimited mode requires confirmation and can consume uncapped provider cost. Complete validation, visibility and persistence rules.
Ordered queue stability and compatibility
The queue contract is stable but remains opt-in and OFF by default. Commands, legacy readers, canonical-clear precedence, settled activation, freeze/re-enable, IDs and per-item accounting remain supported. All five readiness criteria, pinned source/test/version evidence and bounded host qualifications.
Completion, waiting and recovery
- Goal-owned continuation waits for fully settled idle, after retries, compaction and queued input. A 25-response automatic epoch or three empty/normalized-identical tool-free runs pauses by default; an ordinary notification does not reset/resume a safety pause.
goal_complete({ goal_id, summary })needs the exact current ID and requirement-by-requirement evidence. Plain prose is not completion; prompts are guardrails, not independent verification of external work.goal_blocked({ goal_id, reason, evidence, repeated_turns })needs concrete external-action evidence and the same blocker for at least three consecutive goal turns; resume starts a fresh audit. Not for ordinary clarification or recoverable failures.goal_wait({ goal_id, reason, resume_after_ms? })is only for an external wait. It pauses until accepted real input or the deadline; under 10 seconds is clamped. Call all terminal tools directly and alone, never through scripts or nestedctx.executeTool()calls; direct model declarations remain available with codemodeonoronly. Why direct calls are required.- Tools missing under restrictive policy pause Goal rather than widening policy. Token budgets can overshoot by a model call and are not dollar caps. Context overflow blocks automatic continuation: compact or start a new session, then explicitly resume.
- State is branch/session-owned and survives compaction/reload; new sessions do not inherit it. Disabled retained queues freeze without losing items. Lifecycle, waits, accounting and interruption.
Managed run RPC
Default-off rpc.enabled exposes pi-goal:start, pi-goal:cancel and pi-goal:event:${runId} for fully privileged trusted extensions. Only complete is success; cancellation is exact-run scoped, and manual/restored Goals are not adopted. Removed pi-goal:rpc:start/pi-goal:rpc:pause and global pi-goal:state have no aliases. Complete payloads, errors and ownership.
src/index.ts is the extension entrypoint, forwarding to goal.ts; other modules are internal.
License
MIT. See LICENSE.
Reference
Detailed contracts and legacy section links: