-
Couldn't load subscription status.
- Fork 113
feat: Improve conversation context management #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This change enhances the conversation context provided to the Gemini model by:
- Increasing the number of messages in the history from 10 to 50.
- Adding a system prompt to guide the model's behavior.
- Using standardized English role labels ("User:", "Assistant:") instead of Japanese.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances conversation context management for the Gemini AI model by improving context size, standardizing language, and adding debugging capabilities. The changes aim to provide better conversation continuity and clearer system prompts.
- Increased conversation history from 10 to 50 messages for better context retention
- Standardized role labels and system prompts from Japanese to English
- Enhanced WebSocket debugging and updated message type handling
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/sessionManager.js | Updated conversation context building with larger history limit and English prompts |
| server/index.js | Added debug logging and changed WebSocket message type from 'gemini-command' to 'start-gemini' |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/index.js
Outdated
| // console.log('💬 User message:', data.command || '[Continue/Resume]'); | ||
| // console.log('📁 Project:', data.options?.projectPath || 'Unknown'); | ||
| // console.log('🔄 Session:', data.options?.sessionId ? 'Resume' : 'New'); | ||
| if (data.type === 'start-gemini') { // Listen for start-gemini |
Copilot
AI
Aug 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the message type from 'gemini-command' to 'start-gemini' is a breaking change that will cause existing clients to fail. Consider maintaining backward compatibility by supporting both message types or ensuring all clients are updated simultaneously.
| if (data.type === 'start-gemini') { // Listen for start-gemini | |
| if (data.type === 'start-gemini' || data.type === 'gemini-command') { // Listen for both start-gemini and gemini-command |
| connectedClients.add(ws); | ||
|
|
||
| ws.on('message', async (message) => { | ||
| console.log('Received message:', message.toString()); |
Copilot
AI
Aug 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging the entire message content could expose sensitive user data or API keys. Consider logging only message metadata (type, timestamp, session ID) rather than the full message content.
This change enhances the conversation context provided to the Gemini model by:
- Increasing the number of messages in the history from 10 to 50.
- Adding a system prompt to guide the model's behavior.
- Using standardized English role labels ("User:", "Assistant:") instead of Japanese.
This change enhances the conversation context provided to the Gemini model by: