Skip to content

fix(patch): cherry-pick 1b69637 to release/v0.33.0-preview.13-pr-21467 [CONFLICTS]#21930

Merged
galz10 merged 2 commits intorelease/v0.33.0-preview.13-pr-21467from
hotfix/v0.33.0-preview.13/0.33.0-preview.14/preview/cherry-pick-1b69637/pr-21467
Mar 10, 2026
Merged

fix(patch): cherry-pick 1b69637 to release/v0.33.0-preview.13-pr-21467 [CONFLICTS]#21930
galz10 merged 2 commits intorelease/v0.33.0-preview.13-pr-21467from
hotfix/v0.33.0-preview.13/0.33.0-preview.14/preview/cherry-pick-1b69637/pr-21467

Conversation

@gemini-cli-robot
Copy link
Collaborator

This PR automatically cherry-picks commit 1b69637 to patch version v0.33.0-preview.13 in the preview release to create version 0.33.0-preview.14.

⚠️ Merge Conflicts Detected

This cherry-pick resulted in merge conflicts that need manual resolution.

🔧 Next Steps:

  1. Review the conflicts: Check out this branch and review the conflict markers
  2. Resolve conflicts: Edit the affected files to resolve the conflicts
  3. Test the changes: Ensure the patch works correctly after resolution
  4. Update this PR: Push your conflict resolution

📋 Files with conflicts:

The commit has been created with conflict markers for easier manual resolution.

🚨 Important:

  • Do not merge this PR until conflicts are resolved
  • The automated patch release will trigger once this PR is merged

…21467)

Co-authored-by: Abhi <abhipatel@google.com>
Co-authored-by: Adam Weidman <adamfweidman@google.com>
# Conflicts:
#	packages/a2a-server/src/config/config.ts
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 backports a significant architectural change, transitioning the agent's tool scheduling from a traditional callback model to a more robust event-driven system. This refactoring aims to improve the responsiveness and reliability of tool execution, especially in scenarios involving user confirmations and parallel operations. The update also includes refinements to task lifecycle management and policy enforcement in 'YOLO' mode. Due to the nature of the backport, merge conflicts were encountered and require manual resolution.

Highlights

  • Event-Driven Tool Scheduler: The core change involves refactoring the tool scheduling mechanism from a callback-based approach to a new event-driven system, enhancing how tool calls are managed and confirmed.
  • Improved Task Lifecycle Management: The CoderAgentExecutor and Task classes have been updated to better handle task disposal, manage primary and secondary execution loops, and ensure proper cleanup of resources.
  • YOLO Mode Policy Enhancements: The policy engine now defaults to ALLOW for tool calls in YOLO mode when no specific rules match, while still respecting explicit DENY rules and rule priorities.
  • Merge Conflicts Detected: This cherry-pick operation resulted in merge conflicts, which require manual resolution before the pull request can be merged.
Changelog
  • packages/a2a-server/src/agent/executor.test.ts
    • Added new tests for CoderAgentExecutor to verify primary/secondary execution distinction and task eviction upon reaching a terminal state.
  • packages/a2a-server/src/agent/executor.ts
    • Modified the CoderAgentExecutor to correctly dispose of tasks and delete them from the cache when canceled.
    • Updated socket event listeners to use the 'end' event for aborting execution and improved cleanup logic.
    • Introduced logic to distinguish between primary and secondary execution loops for a given task, allowing secondary loops to return early.
  • packages/a2a-server/src/agent/task-event-driven.test.ts
    • Added a new test file to validate the functionality of the event-driven scheduler within the Task class, covering tool call updates, confirmations, YOLO mode behavior, output handling, and parallel tool execution.
  • packages/a2a-server/src/agent/task.test.ts
    • Updated auto-approval tests to assert that ToolCallConfirmationEvent is not published when autoExecute is true or approval mode is YOLO.
  • packages/a2a-server/src/agent/task.ts
    • Updated the Task class to conditionally instantiate either a Scheduler (event-driven) or CoreToolScheduler (legacy) based on configuration.
    • Introduced dispose() method to clean up message bus subscriptions for the event-driven scheduler.
    • Implemented handleEventDrivenToolCallsUpdate and handleEventDrivenToolCall to process tool call updates from the message bus, manage pending tools, and publish status updates.
    • Added checkInputRequiredState to manage task state transitions based on pending tool approvals and execution status.
    • Modified cancelPendingTools to also clear pending correlation IDs and cancel the scheduler.
    • Ensured consistent messageId for agent messages across multiple text chunks to prevent UI duplication.
    • Updated _handleToolConfirmationPart to use correlation IDs for publishing tool confirmation responses to the message bus and added support for ProceedAlwaysAndSave outcome.
    • Added processedToolCallIds and toolsAlreadyConfirmed sets to prevent reprocessing and reconfirming tool calls.
    • Pre-registered scheduled tool calls to ensure waitForPendingTools correctly tracks them before the async scheduler enqueues them.
  • packages/a2a-server/src/config/config.ts
    • Modified loadConfig to include enableEventDrivenScheduler setting, defaulting to true, and adjusted interactive and enableInteractiveShell based on headless mode.
  • packages/a2a-server/src/config/settings.ts
    • Added general.previewFeatures and experimental.enableEventDrivenScheduler to the Settings interface.
  • packages/a2a-server/src/utils/testing_utils.ts
    • Added a mock for isEventDrivenSchedulerEnabled in createMockConfig for testing purposes.
  • packages/core/src/policy/policy-engine.test.ts
    • Added tests to verify that PolicyEngine returns ALLOW by default in YOLO mode when no rules match.
    • Included tests to confirm that explicit DENY rules are not overridden in YOLO mode and that rule priority is respected.
  • packages/core/src/policy/policy-engine.ts
    • Modified check method to return PolicyDecision.ALLOW by default in YOLO mode if no specific policy rules are matched for a tool.
Activity
  • The pull request was automatically created by gemini-cli-robot to cherry-pick commit 1b69637 to the release/v0.33.0-preview.13-pr-21467 branch.
  • Merge conflicts were detected during the cherry-pick process, requiring manual resolution.
  • Instructions were provided to review conflicts, resolve them, test changes, and update the PR.
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.

@github-actions
Copy link

Size Change: +266 B (0%)

Total Size: 25.9 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.4 MB +266 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

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 cherry-picks a significant feature: the transition from a callback-based tool scheduler to an event-driven one. The changes are extensive, touching the core task execution logic in Task and CoderAgentExecutor, and introducing new tests for the event-driven flow. The refactoring appears well-executed, improving robustness in handling concurrent requests and resource management.

However, there is a critical issue: an unresolved merge conflict remains in packages/a2a-server/src/config/config.ts. This will prevent the code from compiling and must be resolved before merging.

Note: Security Review did not run due to the size of the PR.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/a2a-server/src/config/config.ts (106-114)

critical

This file contains unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>). These must be resolved before merging, as they will cause compilation errors.

It appears the intention was to use the logic from the incoming change. However, the function isHeadlessMode() is not defined or imported in this file, which will likely cause a reference error. Please resolve the conflict and ensure isHeadlessMode() is properly defined or imported.

    enableEventDrivenScheduler:
      settings.experimental?.enableEventDrivenScheduler ?? true,
    interactive: !isHeadlessMode(),
    enableInteractiveShell: !isHeadlessMode(),

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 10, 2026
@galz10 galz10 merged commit 0d27afc into release/v0.33.0-preview.13-pr-21467 Mar 10, 2026
25 checks passed
@galz10 galz10 deleted the hotfix/v0.33.0-preview.13/0.33.0-preview.14/preview/cherry-pick-1b69637/pr-21467 branch March 10, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants