@indexyz/pi-continue

Resume interrupted or failed pi agent work with the currently selected model

Packages

Package details

extension

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

$ pi install npm:@indexyz/pi-continue
Package
@indexyz/pi-continue
Version
0.2.0
Published
Nov 9, 2026
Downloads
828/mo · 422/wk
Author
indexyz
License
MIT
Types
extension
Size
13.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

@indexyz/pi-continue

A pi extension that adds /continue for resuming the most recently interrupted or failed turn with the currently selected model.

Install

pi install npm:@indexyz/pi-continue

Releases are published to npm as @indexyz/pi-continue; each release is tagged @indexyz/pi-continue@<version>.

To try a repository checkout (after npm install at the repository root):

pi -e ./pi-continue/index.ts

Usage

  1. Interrupt a running turn (for example, with Escape), or let a provider request fail.
  2. Optionally select another model with /model.
  3. Run /continue.
/continue

The same retry is bound to F5 and Alt+R, the keys omp (oh-my-pi) uses for its app.retry action. Pi assigns neither key to a built-in action; both come from this extension and run the command's retry path, so they need no /continue prefix.

The command and the keys behave identically. During a running turn they report that the agent is busy and do nothing, so interrupting that turn afterwards stays interrupted. While an interrupt or a compaction is finishing, they wait for it and then retry.

/continue takes no arguments. In particular, no --model provider/model option is needed: pi retries the turn using whichever model is selected when the command executes. It does not append a synthetic user prompt.

The command verifies that the current branch ends in an aborted or failed assistant turn, and directly retries from the preceding user message or tool result. A hidden control message starts the turn but is removed, together with the failed assistant response, from every model context. This is a request-level retry rather than a token-level continuation of partial assistant output. Model and thinking-level changes recorded after the interruption or failure do not hide that turn. This includes provider errors such as HTTP 429 rate limits. If no model is selected, /continue reports an error and starts no turn.

中断或遇到 provider 错误后,可以先用 /model 切换模型,再运行 /continue 或按 F5 / Alt+R;失败的 assistant 响应会从模型上下文中移除,并由当前选中的模型直接重试,不会新增 user prompt。这是重新执行失败请求,不是从 assistant 的半截输出继续生成 token。

Development

Verified against Pi 1.5.0.

npm install
npm run check --workspace @indexyz/pi-continue

License

MIT