Skip to content

Add functionality to extend the session indefinitely - #10

Open
Antonio171003 wants to merge 3 commits into
AlexITC:mainfrom
Antonio171003:extend-session-functionality
Open

Add functionality to extend the session indefinitely#10
Antonio171003 wants to merge 3 commits into
AlexITC:mainfrom
Antonio171003:extend-session-functionality

Conversation

@Antonio171003

Copy link
Copy Markdown
Contributor

GeminiLiveConfigBuilder

  • Add two configurations:
    • Context window compression
    • Session resumption

Gemini IO

  • Refactor session: AsyncSession -> sessionRef: Ref[IO, AsyncSession]
  • Add function to open a new session

Gemini Service

  • Implement logic to open a new session when a go away signal is received

@AlexITC
AlexITC requested a review from Copilot September 27, 2025 11:10

Copilot AI left a comment

Copy link
Copy Markdown

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 adds functionality to extend Gemini Live sessions indefinitely by implementing session resumption and automatic reconnection when "go away" signals are received. The changes enable the system to maintain conversation context across session boundaries while handling service interruptions gracefully.

  • Adds context window compression and session resumption configurations to the Gemini Live client
  • Refactors session management to use a Ref-based approach enabling dynamic session replacement
  • Implements automatic session resumption logic when receiving "go away" signals from the Gemini API

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
GeminiLiveConfigBuilder.scala Adds context window compression and session resumption configuration options
GeminiIO.scala Refactors session handling to use Ref[IO, AsyncSession] and adds session resumption functionality
GeminiService.scala Implements go-away signal handling and automatic session resumption with activity state preservation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.sessionResumption(
SessionResumptionConfig
.builder()
.handle(handle.getOrElse(""))

Copilot AI Sep 27, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using getOrElse(\"\") for the handle parameter could be problematic. Consider using handle.orNull or checking if the SessionResumptionConfig should only be set when a handle is provided, as an empty string might not be a valid handle value.

Copilot uses AI. Check for mistakes.
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.

3 participants