@touchfish100/pi-threshold-continue

Continue active Pi tasks after threshold compaction.

Packages

Package details

extension

Install @touchfish100/pi-threshold-continue from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@touchfish100/pi-threshold-continue
Package
@touchfish100/pi-threshold-continue
Version
0.1.1
Published
Aug 31, 2026
Downloads
87/mo · 6/wk
Author
touchfish100
License
MIT
Types
extension
Size
4.6 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions/index.ts"
  ]
}

Security note

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

README

Pi Threshold Continue

An intentionally small Pi extension for long-running tasks. After an automatic threshold compaction, it queues one hidden follow-up only when Pi is still processing an active agent run. The follow-up tells the model to continue the current task, or finish when the task is already complete.

Why

Pi rebuilds a compacted context for the next request. Normal threshold compaction does not itself retry the agent loop, so unfinished work can become idle. This extension restores one decision point without treating every compaction as proof that more work is required.

Guardrails

The extension does nothing when:

  • compaction was manual;
  • Pi is already retrying an overflow;
  • the session is idle;
  • a user or another extension already has a message queued; or
  • the same compaction event is delivered more than once.

It uses only Pi's public session_compact, isIdle, hasPendingMessages, and sendMessage APIs. It has no runtime dependencies, performs no network I/O, and does not write project files.

Install

pi install npm:@touchfish100/pi-threshold-continue

Restart Pi after installing or updating the package.

Development

npm install
npm run check
npm test
npm pack --dry-run

License

MIT. See LICENSE.