Skip to content

v0.8.6 feat: /edit — revise the last submitted message and resubmit #383

@Hmbown

Description

@Hmbown

Pitch

Codex parity. After hitting Enter you sometimes notice a typo or want to add context. `/edit` (or `Ctrl+Up` shortcut) pulls the most recent user message back into the composer, pre-filled, with the cursor at end. Submitting replaces the prior turn — the engine truncates back to the parent turn, runs again with the revised prompt.

Implementation sketch

  1. Track `last_submitted_message` on `App` (already have `input_history.last()` but it loses the cursor position).
  2. `/edit` (and `Ctrl+Up` on empty composer) → pop the last message into the composer.
  3. On submit: send a new `Op::EditLastTurn` that the engine handles by truncating `api_messages` back to the parent turn before re-running.
  4. Snapshot integration: take a snapshot before the truncation so the user can `/undo` (#new) to recover the original.

Acceptance

  • `/edit` (no args) opens the composer pre-filled with the last user message.
  • Submitting truncates the conversation to the parent turn and runs again.
  • Snapshot allows undoing the edit.
  • Documented in /help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.8.6Targeting v0.8.6

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions