pi-websocket-auto-continue

Pi extension that automatically continues after a settled WebSocket transport error.

Packages

Package details

extension

Install pi-websocket-auto-continue from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-websocket-auto-continue
Package
pi-websocket-auto-continue
Version
0.1.2
Published
Oct 1, 2026
Downloads
227/mo · 19/wk
Author
xryul
License
MIT
Types
extension
Size
4.2 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-websocket-auto-continue

Automatically send "continue" as user input after a WebSocket error, idle timeout, or service restart (close code 1012).


It records the result at agent_end and waits for agent_settled before acting. This allows pi to finish any:

  • built-in retry
  • recovery after compaction
  • queued continuation

It checks the final assistant message. stopReason must be "error", and errorMessage must match one of:

  • Exactly WebSocket error.
  • WebSocket idle timeout after <digits>ms, for example WebSocket idle timeout after 60000ms.
  • Exactly WebSocket closed 1012 (service restart).

Aborted runs and other errors do not trigger continuation.

When a supported message matches, it sends "continue" as user input:

Install

pi install npm:pi-websocket-auto-continue