omp packages

@siuver/omp-undo0.1.0

An oh-my-pi extension that adds the /undo slash command to remove the latest user prompt and its model response from the session tree.

siuver Published 2 months ago MIT ~16 downloads/mo

Built for omp

The author tagged this package oh-my-pi.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@siuver/omp-undo

An oh-my-pi extension that adds the /undo slash command to remove the latest user prompt and its model response from the current session tree.

Install

omp plugin install @siuver/omp-undo

What it does

Running /undo removes the latest completed user prompt and every session entry descended from it (the model response and any follow-up entries) from the current session tree:

  1. Finds the most recent user message on the active branch that has a following assistant response.
  2. Asks for confirmation, showing a preview of the prompt and the number of session entries that will be removed.
  3. On confirmation, prunes the session tree: the user message and all of its descendants are removed, the branch pointer is moved back to the parent entry (or reset when the prompt was the root), and the session file on disk is rewritten.
  4. Reloads the session and restores the removed prompt's text into the input box so it can be edited and resubmitted.

Behavior notes

  • Requires an interactive UI: in headless contexts /undo warns and does nothing.
  • Waits for the agent to become idle before touching the session.
  • Declining the confirmation leaves the session untouched.
  • Only the latest completed prompt (one followed by an assistant response) can be undone; an unanswered trailing prompt is left alone.

Local Development

From the repository root:

omp plugin link ./plugins/undo

Restart omp after linking.

Changelog

See CHANGELOG.md for release notes included in the npm package.