@arhen/pi-core-goal

Session-log-backed long-running /goal mode for pi: automatic continuation after agent_settled, token budget, strict completion/blocked audits, cache-stable system prefix.

Packages

Package details

extension

Install @arhen/pi-core-goal from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@arhen/pi-core-goal
Package
@arhen/pi-core-goal
Version
0.0.1
Published
Sep 2, 2026
Downloads
153/mo · 153/wk
Author
arhen
License
MIT
Types
extension
Size
34.6 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@arhen/pi-core-goal

Session-log-backed long-running objective mode for pi. One goal per thread; the agent keeps continuing automatically until the goal is complete, blocked, paused, or out of budget.

Usage

/goal <objective>     → set and start a goal
/goal                 → show current goal + usage
/goal edit            → edit the objective
/goal pause|resume    → stop/start automatic continuation
/goal clear           → remove the goal

Tools exposed to the agent: create_goal, get_goal, update_goal (complete/blocked only).

Design

  • State lives in the session log (appendEntry), reconstructed on reload/tree navigation. No external files.
  • Continuation is queued on agent_settled — after retries, compaction, and queued messages have fully drained — never mid-pipeline.
  • The system-prompt injection is static per goal (objective + rules only). Usage numbers travel in the continuation message at the end of the context, so the provider prompt-cache prefix stays stable across goal turns. Use get_goal for live numbers.
  • Optional token_budget stops automatic continuation when exhausted.
  • Strict completion and blocked audits in the continuation prompt: complete only with requirement-by-requirement evidence; blocked only after the same blocker repeats for 3 consecutive goal turns.

Test

bun test