feat(cli): /redo resubmits the most recent user prompt#210
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
f125cde to
3699355
Compare
Tiny companion to /history. When the model's response missed the mark — wrong assumption, bad decomposition, or you just want a second roll — /redo grabs the last real user prompt and feeds it back as a new turn. Aliased to /again. Skips tool_result messages and compact summaries when finding the most recent prompt, so what gets resubmitted is exactly what you typed. Echoes a one-line preview so there's no ambiguity about what's being sent.
3699355 to
d3bb173
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds `/redo` (alias `/again`) — finds the most recent user-authored prompt in this session and resubmits it as a new turn.
When the model's answer missed the mark (wrong assumption, sloppy decomposition, you want a second roll) you can now retry without retyping. Prints a one-line preview before re-submitting so you can see exactly what's going back in.
How it picks the prompt
`last_user_prompt` walks the message history backwards and returns the first `Message::User` that:
Multi-block prompts are joined with newlines so they round-trip intact.
Test plan