Skip to content

feat: implement SDK session ID handling for conversation continuity#90

Merged
webdevcody merged 6 commits intomainfrom
fix-agent-runner
Dec 14, 2025
Merged

feat: implement SDK session ID handling for conversation continuity#90
webdevcody merged 6 commits intomainfrom
fix-agent-runner

Conversation

@SuperComboGamer
Copy link
Collaborator

  • Added support for resuming conversations using the Claude SDK session ID.
  • Updated the ClaudeProvider to conditionally resume sessions based on the presence of a session ID and conversation history.
  • Enhanced the AgentService to capture and store the SDK session ID from incoming messages, ensuring continuity in conversations.

- Added support for resuming conversations using the Claude SDK session ID.
- Updated the ClaudeProvider to conditionally resume sessions based on the presence of a session ID and conversation history.
- Enhanced the AgentService to capture and store the SDK session ID from incoming messages, ensuring continuity in conversations.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SuperComboGamer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant feature for conversation continuity by integrating Claude SDK session ID handling. The changes allow the system to maintain the state of a conversation across multiple turns, providing a more seamless and coherent user experience. This is achieved by passing and capturing session IDs between the service layer and the Claude provider.

Highlights

  • SDK Session ID Support: Added support for resuming conversations using the Claude SDK session ID, enabling continuity across interactions.
  • ClaudeProvider Update: The ClaudeProvider now conditionally resumes SDK sessions by passing the sdkSessionId when both a session ID and conversation history are available.
  • AgentService Enhancement: The AgentService has been enhanced to capture and store the SDK session ID from incoming messages, ensuring that subsequent turns in a conversation can leverage the same session.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for conversation continuity using the Claude SDK's session ID, which is a great enhancement. The changes correctly plumb the sdkSessionId from the agent service to the Claude provider and simplify the provider logic by removing manual history management in favor of the SDK's resume feature. However, I've found a critical issue where the captured sdkSessionId is not persisted. This means conversation continuity will be lost on a server restart, defeating the main purpose of this change. My review includes a comment with a suggested fix and explanation of the necessary changes to ensure the session ID is stored and reloaded correctly.

webdevcody and others added 5 commits December 14, 2025 11:10
- Renamed test case to clarify that it handles conversation history with sdkSessionId using the resume option.
- Updated assertions to verify that the sdk.query method is called with the correct options when a session ID is provided.
The test "should reuse existing session if already started" expected fs.readFile to be called 1 time, but startConversation calls it 2 times on first call (loadSession + loadMetadata). The second call correctly reuses the in-memory session.

Co-authored-by: GTheMachine <156854865+GTheMachine@users.noreply.github.com>
Fix test expectation for fs.readFile call count in agent-service.test.ts
@webdevcody webdevcody merged commit 4a3a98b into main Dec 14, 2025
2 checks passed
@webdevcody webdevcody deleted the fix-agent-runner branch December 14, 2025 22:49
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.

4 participants