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.
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.