Skip to content

feat(session): DaMeng Session Storage#827

Open
liuxh613 wants to merge 2 commits intoagentscope-ai:mainfrom
liuxh613:dameng
Open

feat(session): DaMeng Session Storage#827
liuxh613 wants to merge 2 commits intoagentscope-ai:mainfrom
liuxh613:dameng

Conversation

@liuxh613
Copy link

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.9, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

[Please describe the background, purpose, changes made, and how to test this PR]

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@liuxh613 liuxh613 requested a review from a team February 26, 2026 02:55
@cla-assistant
Copy link

cla-assistant bot commented Feb 26, 2026

CLA assistant check
All committers have signed the CLA.

@gemini-code-assist
Copy link

Summary of Changes

Hello @liuxh613, 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 support for DaMeng database as a persistent storage solution for AgentScope-Java conversation sessions. This enhancement allows agents to maintain and resume conversations across application restarts, providing a more robust and stateful interaction experience. The changes include a dedicated module for DaMeng session management, necessary dependency updates, and a comprehensive example to guide users on its implementation.

Highlights

  • New DaMeng Session Storage Module: A new Maven module, agentscope-extensions-session-dameng, has been introduced to provide persistent conversation session storage using the DaMeng database.
  • DaMengSession Implementation: The DaMengSession class has been implemented, offering robust session management with features like automatic schema/table creation, type-safe state serialization, incremental list storage, and SQL injection prevention.
  • DaMeng JDBC Driver Integration: The DaMeng JDBC driver (DmJdbcDriver18) has been added as a dependency, allowing AgentScope-Java to connect and interact with DaMeng databases.
  • Example for DaMeng Session Usage: A new example, DaMengSessionExample.java, has been added to demonstrate how to configure and use DaMengSession for persistent agent conversations, including integration with HikariCP for connection pooling.
Changelog
  • agentscope-dependencies-bom/pom.xml
    • Added dameng.version property to manage the DaMeng JDBC driver version.
    • Included the DaMeng JDBC driver (DmJdbcDriver18) as a managed dependency.
  • agentscope-distribution/agentscope-bom/pom.xml
    • Added agentscope-extensions-session-dameng to the Bill of Materials (BOM) for consistent version management.
  • agentscope-examples/quickstart/pom.xml
    • Added agentscope-extensions-session-dameng dependency for the DaMeng session example.
    • Included HikariCP dependency for efficient database connection pooling in the example.
  • agentscope-examples/quickstart/src/main/java/io/agentscope/examples/quickstart/DaMengSessionExample.java
    • Added a new example class demonstrating persistent conversation sessions using DaMeng database and HikariCP.
  • agentscope-extensions/agentscope-extensions-session-dameng/pom.xml
    • Added a new Maven module for the DaMeng session extension, defining its dependencies including agentscope-core and the DaMeng JDBC driver.
  • agentscope-extensions/agentscope-extensions-session-dameng/src/main/java/io/agentscope/core/session/dameng/DaMengSession.java
    • Added the DaMengSession class, implementing the Session interface for DaMeng database-backed session storage.
    • Implemented methods for saving and retrieving single and list states, including logic for incremental list updates and full rewrites.
    • Included functionality for automatic schema and table creation, and robust identifier validation to prevent SQL injection.
  • agentscope-extensions/agentscope-extensions-session-dameng/src/test/java/io/agentscope/core/session/dameng/DaMengSessionTest.java
    • Added comprehensive unit tests for the DaMengSession class, covering constructor behavior, state persistence, session existence checks, deletion, listing session keys, and SQL injection prevention.
  • agentscope-extensions/pom.xml
    • Added agentscope-extensions-session-dameng as a new module to the parent agentscope-extensions POM.
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

@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 adds support for DaMeng database as a session storage backend. The changes include a new DaMengSession implementation, comprehensive unit tests, an example application, and the necessary updates to the project's POM files. The overall implementation is well-done, featuring automatic schema creation and safeguards against SQL injection. I have identified a few areas for improvement, including a hardcoded dependency version, a potential security vulnerability in the example code, and minor enhancements to the DaMengSession implementation for better adherence to best practices.

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 74.21603% with 74 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../agentscope/core/session/dameng/DaMengSession.java 74.21% 56 Missing and 18 partials ⚠️

📢 Thoughts on this report? Let us know!

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