@esso0428/pi-retry-command0.2.1
pi extension: /retry command using Session Tree navigation
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@esso0428/pi-retry-command
A Pi extension providing /retry and /continue commands.
How it works
/retry uses Session Tree navigation to retry the last prompt:
- Finds the last user message in the session tree
- Navigates back to its parent entry using
ctx.navigateTree() - Resubmits the original prompt via
pi.sendUserMessage()
This creates a true session branch — the failed response is preserved and you can always go back to it via /tree.
/continue stays on the current session branch and continues agent execution without replaying a user prompt. It keeps the prior conversation and triggers an additional agent turn. The command leaves only a hidden journal custom message; the context hook removes that message before the LLM sees it.
Original:
User A → Assistant A → User B → Assistant B (failed)
After /retry:
User A → Assistant A
├── User B → Assistant B (failed, preserved)
└── User B' → Assistant B' (new attempt)
Installation
pi install npm:@esso0428/pi-retry-command
Usage
Type /retry in Pi when:
- The last response was aborted (ESC) or errored
- You want to retry with the exact same prompt (including images/multimodal content)
- You want to preserve the failed branch for reference
Type /continue when you want another agent turn on the current branch without sending a new prompt:
/retry # retry the last user prompt on a new branch
/continue # continue the current branch with the existing conversation
Requirements
- Pi Coding Agent with Session Tree support
License
MIT