-
Notifications
You must be signed in to change notification settings - Fork 13.1k
feat: Add /undo command to revert last conversation turn #18708
Copy link
Copy link
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/p3Backlog - a good idea but not currently a priority.Backlog - a good idea but not currently a priority.
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/p3Backlog - a good idea but not currently a priority.Backlog - a good idea but not currently a priority.
Type
Fields
Give feedbackNo fields configured for Feature.
Working with LLMs in a CLI is an iterative process of trial and error. Currently, if a model provides a
suboptimal or hallucinated response, that turn remains in the context window. This pollutes future interactions
and wastes tokens unless the user manually saves/resumes sessions or starts over.
I would like a simple /undo slash command. When executed, it removes the last response from the model, removes
the last user prompt that triggered it, and refreshes the UI to reflect the "rewound" state.
Starting a new session is sub optimal because it loses all previous valid context.
Additional context
I have already prototyped a working implementation of this feature. It involves adding removeLastTurn() to useHistoryManager, hooking it into slashCommandProcessor, and triggering refreshStatic() for the UI update.
I am ready to submit a PR if this proposal is aligned with the project's goals.