The conversation versioning feature allows you to navigate back to previous points in your conversation history and restore the conversation to that state.
This is useful when you want to:
- Undo recent mistakes or unwanted changes
- Explore different conversation paths
- Recover from overwhelming token usage
- Return to a specific point in your conversation
Press ESC twice quickly (within 300ms) to open the message history selector.
The feature can be triggered from the chat view when:
- No approval modal is active
- No chat session is currently running (or it's idle/completed)
- You're in any agent mode (Standard, Plan, or Auto-Accept)
Once the message history selector is open:
- Browse messages: Use arrow keys (↑/↓) to navigate through your previous user messages
- Search: Press
/to enter search mode and filter messages - Select a restore point: Press
Enterto restore the conversation to the selected message - Cancel: Press
ESCto exit without making changes
Each message in the history is displayed with:
- Timestamp: Shows when the message was sent (format:
[HH:MM:SS]) - Message preview: Truncated to 50 characters with
...if longer - Index: Position in the conversation history
Example:
[14:23:45] Implement conversation versioning feature...
[14:25:12] Can you add unit tests for the ESC detection?
[14:27:30] Update the documentation with usage examples...
When you select a message to restore:
- Deletion: All messages after the selected message are permanently deleted
- Auto-save: The conversation is automatically saved with the changes
- Return to chat: You're immediately returned to the chat input
- Ready to continue: You can continue the conversation from the restore point
Important: Deletion is permanent and cannot be undone. Make sure you select the correct restore point.
The conversation versioning feature works in all agent modes:
- Standard Mode: Full interactive control
- Plan Mode: Navigate and restore during planning
- Auto-Accept Mode: Quick restore without approval prompts
The default keybinding is double ESC (esc,esc), but you can customize it:
# Change the keybinding to a different key combination
infer keybindings set navigation_go_back_in_time "ctrl+h"
# Disable the feature
infer keybindings disable navigation_go_back_in_time
# Re-enable the feature
infer keybindings enable navigation_go_back_in_time
# Reset to default (double ESC)
infer keybindings resetConfiguration can also be set in your .infer/keybindings.yaml:
---
enabled: true
bindings:
navigation_go_back_in_time:
keys:
- "esc,esc" # or your custom keybinding
description: "go back in time to previous message (double ESC)"
category: "navigation"
enabled: trueIf you trigger the feature when there are no user messages in the conversation:
- A warning is logged: "No user messages to navigate back to"
- The feature exits without opening the selector
- No view transition occurs
If there's only one user message:
- The selector will show that single message
- You can select it, but no deletion will occur (already at the start)
- This allows you to review the conversation start point
If the conversation is completely empty:
- The feature will not transition to the message history view
- An info message is logged
- You remain in the current view
During active LLM streaming or tool execution:
- Double ESC first cancels the current operation (existing behavior)
- Trigger double ESC again (after cancellation) to open message history
- This prevents accidental navigation during active work
- User messages only: Only user-initiated messages are shown in the history (not assistant responses or tool results)
- Permanent deletion: Messages deleted during restore cannot be recovered
- No undo: There's no undo for the restore operation
- Auto-save required: Changes are automatically saved; manual save is not supported
- Single conversation: Only works within the current conversation context
The feature uses timer-based detection:
- Tracks the time between ESC presses
- Triggers when two ESC presses occur within 300ms
- Resets after successful detection or timeout
- Thread-safe implementation with mutex locks
Deletion is implemented at the repository level:
- Truncates the message array at the selected index
- Keeps messages from index 0 to the selected index (inclusive)
- Triggers auto-save for persistent storage
- Updates conversation metadata (message count, tokens, etc.)
The feature uses dedicated state management:
ViewStateMessageHistory: Separate view state for the selectorMessageHistoryState: Stores user message snapshots- Clean transitions between chat and history views
- State is cleared after restore or cancellation
You've made several changes that you want to undo:
- Press ESC twice quickly
- Navigate to the message before your mistakes
- Press Enter to restore
- Continue from that point
You want to try a different approach:
- Press ESC twice to open history
- Select an earlier message where you want to branch
- Press Enter to restore
- Ask a different question to explore an alternative path
Your conversation has grown too large:
- Press ESC twice to view history
- Select a message from earlier in the conversation
- Press Enter to trim the conversation
- Continue with a lighter context
Q: Can I restore deleted messages? A: No, deletion is permanent. Always double-check your selection before pressing Enter.
Q: What happens to tool execution results after restoration? A: All messages after the restore point are deleted, including tool results and assistant responses.
Q: Can I see assistant messages in the history? A: No, only user messages are shown. This is intentional to keep the interface focused on user-initiated conversation points.
Q: Will this affect my saved conversations? A: Yes, if auto-save is enabled (which it is by default), the changes are persisted immediately.
Q: Can I use this feature during tool execution? A: Not directly. First cancel the tool execution (single ESC), then trigger the feature (double ESC).
Q: How many messages can I see in the history? A: All user messages from the current conversation are available, with pagination for long histories.