implemented command history#613
Merged
dgageot merged 4 commits intodocker:mainfrom Oct 29, 2025
Merged
Conversation
Contributor
Author
|
@dgageot kindly review |
Member
|
@riturajFi I'm not sure I understand the code. It seems to me that it could be simpler. Also, it seems to store the same messages twice in the history. I think it's better if we can avoid that. |
Contributor
Author
|
Thanks @dgageot , doing changes right aw3 |
c0a67b1 to
50b9206
Compare
Contributor
Author
|
Hi @dgageot, A few notes:
Let me know your thoughts or if you’d prefer a different architectural direction. |
dgageot
approved these changes
Oct 29, 2025
Member
|
Just coming back to say: Thank you! I spent the whole evening using this all the time, such a great little feature |
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
This PR implements command/message history support for the TUI chat editor.
Users can now recall and reuse previously sent messages using the ↑ / ↓ arrow keys, similar to terminal shells or chat clients like Slack.
This addition enhances usability and continuity by allowing users to:
Fixes: #606
🚀 Features Added
1. 🔁 Persistent Message History
history.Historymodule (pkg/history) into the TUI editor.~/.config/cagent/history.json).2. ⬆️⬇️ Keyboard Navigation
Implemented Up/Down arrow navigation inside the editor:
Navigation behavior:
3. 🧠 Draft Preservation
4. ⚙️ Chat Page Integration
chatPagenow initializes and shares a singleHistoryinstance with theEditor.SendMsg), the message content is appended to history before being processed by the runtime.5. 💬 UX Improvements & Reliability
🔒 Error Handling & Safety
✅ Result:
Users get a familiar and efficient workflow for recalling and reusing past commands — improving productivity and chat experience within the TUI.