Add an option to set individual message history limits for user and assistant messages to optimize context retention. This would allow users to maintain longer conversation sessions without opening new threads or repeating information.
Features:
Separate sliders/inputs for maximum user messages (e.g., 10)
Separate sliders/inputs for maximum assistant messages (e.g., 5)
Allow pinning of any specific message to not count towards the limit.
Messages beyond the limit would be truncated from the context window
Useful for technical conversations where user messages contain important context but some assistant responses are less relevant
Extra nice features:
Token-based limits instead of message count
Ability to preserve context based on regex patterns
Context filters.
Benefits:
Prevents context window overflow in long sessions
Maintains essential conversation information
Reduces need to repeat setup/context in new threads
More efficient token usage by prioritizing relevant messages
1. Debugging Sessions
User provides initial error logs, code snippets, and context (messages 1-3)
Assistant suggests fixes that don't work (messages 2-4)
User tries solutions and reports results (messages 4-6)
Setting: Keep 10 user messages, 3 assistant messages
Result: Preserves all error context while removing outdated fix attempts
2. Iterative Development
User requests feature implementation
Assistant provides initial code
User reports edge cases and refinements
Setting: Keep 8 user messages, 2 assistant messages
Result: Maintains all requirements/issues while only keeping latest implementation
3. Editor mode
User pins the first message
Setting: 3-5 user messages, 0 assistant messages
Result: Context window isn't flooded with assistant responses of the same content while allowing to iteratively edit the content given.
Proposed Enhancement:
Context Management:
├── User Messages: [===|======] 10/20
└── Assistant Messages: [=|========] 3/20
Other UI elements:
Could add "Smart Truncation" that preserves code blocks and error messages
Option to exclude certain message types (e.g., "acknowledged" responses)
Option to delete messages in a conversation
Implementation:
Context Settings added near the switch assistant / web search enabled button in 'mobile' layout. Desktop layout should also have the same layout as mobile for the input box, but that's a different suggestion.