agentscope-runtime-java icon indicating copy to clipboard operation
agentscope-runtime-java copied to clipboard

fix: use the sessionId of sandbox instead of random string, so we can…

Open qijiang17 opened this issue 10 months ago • 2 comments

` // 1. Set the sessionId of sandbox BaseSandbox baseSandbox = new BaseSandbox(sandboxService, userId, sessionId);

// 2. Find mounted files by sessionId @GetMapping("/file/list/{sessionId}") public ResponseEntity<List> listDocuments(@PathVariable String sessionId) { try { Path workspacePath = Paths.get(System.getProperty("user.dir"), "sessions_mount_dir", sessionId); if (!Files.exists(workspacePath)) { return ResponseEntity.ok(List.of()); } List files = Files.list(workspacePath) .filter(Files::isRegularFile) .map(p -> p.getFileName().toString()) .collect(Collectors.toList()); return ResponseEntity.ok(files); } catch (Exception e) { return ResponseEntity.internalServerError().build(); } } `

qijiang17 avatar Jan 27 '26 11:01 qijiang17

Summary of Changes

Hello @qijiang17, I'm Gemini Code Assist[^1]! 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 refactors how session IDs are handled during the sandbox creation process. The change ensures that the sessionId used for creating and managing sandbox containers, particularly for mounting directories, is consistently derived from the sandbox object itself. This promotes better session management and predictability, aligning the container's session ID with the sandbox's established ID.

Highlights

  • Session ID Consistency: The method for generating the sessionId within SandboxService.createContainer has been updated. Instead of generating a new random string, it now retrieves the sessionId directly from the sandbox object passed as an argument, ensuring consistent identification.
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 :thumbsup: and :thumbsdown: 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.

[^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.

gemini-code-assist avatar Jan 27 '26 11:01 gemini-code-assist

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar Jan 27 '26 11:01 cla-assistant[bot]