Skip to content

Conversation

@HainanZhao
Copy link

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:

- 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.
Copilot AI review requested due to automatic review settings August 18, 2025 01:18
Copy link

Copilot AI left a 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
Copy link

Copilot AI Aug 18, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
connectedClients.add(ws);

ws.on('message', async (message) => {
console.log('Received message:', message.toString());
Copy link

Copilot AI Aug 18, 2025

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.

Copilot uses AI. Check for mistakes.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant