← Catalog

pi-interrupt-me

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

Extension

Install

Install with PiG

pig install npm:pi-interrupt-me

Install with Pi

pi install npm:pi-interrupt-me
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.2 (README.md). PiG does not review it.

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