pi-interrupt-me

Keep interrupted replies (partial reasoning, text, unfinished tool calls) visible to the model after you press Esc in pi.

Packages

Package details

extension

Install pi-interrupt-me from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-interrupt-me
Package
pi-interrupt-me
Version
0.1.2
Published
Oct 23, 2026
Downloads
513/mo · 513/wk
Author
ifiht
License
MIT
Types
extension
Size
6.7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-interrupt-me

npm version License: MIT Platform

When you press Esc mid-reply in pi, pi drops the interrupted assistant message from every later request. The model never sees what it was thinking, so your next message reads as if you replied to yourself.

This extension keeps that message in the outgoing context as a finished reply:

  • Thinking block: the last 300 characters of the interrupted reasoning (prefixed […] when cut), replayed in the model's normal reasoning slot.

  • Text block:

    [Interrupted by the user before this reply finished.]
    
    Partial answer:
    any text it had started
    
    Unfinished tool call (not executed): read

Only what is sent to the model changes. The session file is untouched, and messages with no content are still dropped as before.

Install

pi install npm:pi-interrupt-me

Then restart pi.

Notes

  • Why 300 characters, from the end: an interrupt usually means the reasoning was going wrong, and failed attempts left in context raise later error rates (arXiv 2605.08563). 300 is CliffCompaction's cap on old thoughts (arXiv 2609.26779), about one paragraph: enough for your correction to have something to refer to. The end is kept because it is what you reacted to. Change MAX_REASONING_CHARS in index.ts to adjust.
  • Unfinished tool calls are listed by name and never executed or replayed, since their arguments are incomplete.
  • The rewrite happens in pi's context event, before provider-specific conversion.

Test

node test.ts