fix(patch): cherry-pick 1d72a12 to release/v0.41.0-preview.1-pr-26479 to patch version v0.41.0-preview.1 and create version 0.41.0-preview.2#26508
Conversation
…tus reporting (#26479) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Size Change: -4 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
Summary of ChangesHello, 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 addresses race conditions and improves status reporting for tool calls in the A2A server. It introduces schedulerId filtering for event-driven updates, maps internal validating statuses to scheduled for the client, and enhances the task state management logic to ensure accurate transitions to input-required. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a race condition by preventing premature transitions to the input-required state while tools are still validating. It introduces pendingOutcomes tracking, enforces schedulerId validation for tool call updates, and maps the internal validating status to scheduled for client consistency. Feedback highlights the need to clear the new pendingOutcomes map and existing state collections in the cancelPendingTools method to avoid memory leaks and state leakage.
| private pendingOutcomes: Map<string, ToolConfirmationOutcome | undefined> = | ||
| new Map(); // toolCallId --> outcome |
There was a problem hiding this comment.
The new pendingOutcomes map should be cleared in the cancelPendingTools method (around line 234). Additionally, the existing toolsAlreadyConfirmed and pendingToolConfirmationDetails collections also appear to be missing from the cleanup logic in that method. Failing to clear these state-tracking collections can lead to state leakage between task executions or memory leaks when tasks are cancelled or retried within the same session.
References
- Ensure instance-scoped state is properly managed and cleared to prevent memory leaks and state leakage in concurrent or session-based environments.
c6a695d
into
release/v0.41.0-preview.1-pr-26479
This PR automatically cherry-picks commit 1d72a12 to patch version v0.41.0-preview.1 in the preview release to create version 0.41.0-preview.2.