Skip to content

fix(patch): cherry-pick 1d2585d to release/v0.34.0-preview.2-pr-22255 [CONFLICTS]#22385

Closed
gemini-cli-robot wants to merge 1 commit intorelease/v0.34.0-preview.2-pr-22255from
hotfix/v0.34.0-preview.2/0.34.0-preview.3/preview/cherry-pick-1d2585d/pr-22255
Closed

fix(patch): cherry-pick 1d2585d to release/v0.34.0-preview.2-pr-22255 [CONFLICTS]#22385
gemini-cli-robot wants to merge 1 commit intorelease/v0.34.0-preview.2-pr-22255from
hotfix/v0.34.0-preview.2/0.34.0-preview.3/preview/cherry-pick-1d2585d/pr-22255

Conversation

@gemini-cli-robot
Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit 1d2585d to patch version v0.34.0-preview.2 in the preview release to create version 0.34.0-preview.3.

⚠️ 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

…aves (#22255)

# Conflicts:
#	packages/core/src/scheduler/policy.test.ts
#	packages/core/src/scheduler/policy.ts
#	packages/core/src/scheduler/scheduler.test.ts
#	packages/core/src/scheduler/scheduler.ts
@gemini-code-assist
Copy link
Copy Markdown
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 aims to deliver a patch update to the preview release by cherry-picking a specific commit. The primary purpose of the original commit was to refine the policy engine's dependency handling and improve the parsing and application of tool names within policies, particularly for Managed Compute Platform (MCP) tools. However, the automated process encountered merge conflicts, necessitating manual intervention to integrate these changes correctly into the target branch.

Highlights

  • Cherry-pick for Patch Release: This pull request is an automated cherry-pick of commit 1d2585dba6e6248d5dad14afa9cbdae443516060 to create a new patch version 0.34.0-preview.3 for the v0.34.0-preview.2 preview release.
  • Merge Conflicts Detected: The automated cherry-pick process resulted in merge conflicts that require manual resolution before this pull request can be merged.
  • Policy Engine Refactoring: The underlying changes involve refactoring the updatePolicy function signature to explicitly pass AgentLoopContext and MessageBus as separate arguments, improving clarity and dependency management.
  • MCP Tool Name Handling: Updates were made to how simple tool names are extracted from Fully Qualified Names for MCP policies, and the PolicyUpdateOptions interface was extended to include toolName.
  • Documentation Update: The policy engine documentation was updated to clarify the usage of mcpName and toolName when targeting specific tools on a server.
Changelog
  • docs/reference/policy-engine.md
    • Clarified documentation for mcpName and toolName usage in policy configuration.
  • packages/core/src/policy/config.ts
    • Updated the logic for extracting simple tool names from fully qualified names in policy rules.
  • packages/core/src/scheduler/policy.test.ts
    • Modified updatePolicy calls in tests to align with the updated function signature, explicitly passing mockConfig and mockMessageBus as separate arguments.
    • Updated a toolName expectation in a test case.
  • packages/core/src/scheduler/policy.ts
    • Refactored the updatePolicy function signature to accept AgentLoopContext and MessageBus as separate arguments.
    • Updated internal usage of config and messageBus within the updatePolicy function.
    • Updated handleMcpPolicyUpdate to use formatMcpToolName for consistency.
  • packages/core/src/scheduler/scheduler.test.ts
    • Adjusted updatePolicy calls in scheduler tests to match the new function signature.
  • packages/core/src/scheduler/scheduler.ts
    • Updated the Scheduler class to pass context and messageBus as distinct arguments to the updatePolicy function.
  • packages/core/src/tools/mcp-tool.ts
    • Extended PolicyUpdateOptions to include toolName when generating policy updates for MCP tools.
  • packages/core/src/tools/tools.ts
    • Added toolName as an optional property to the PolicyUpdateOptions interface.
Activity
  • This pull request was automatically created by gemini-cli-robot to cherry-pick a commit.
  • Merge conflicts were detected during the automated cherry-pick process, requiring manual resolution.
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
Copy Markdown
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

The pull request refactors the updatePolicy function to accept AgentLoopContext and MessageBus as explicit arguments, updating its usage across scheduler.ts, policy.test.ts, and scheduler.test.ts. It also refines the logic for extracting simple tool names from fully qualified names in config.ts and updates the wildcard pattern for MCP tools in policy.ts using a new formatMcpToolName helper, along with corresponding documentation updates. However, the review highlights a critical issue: the presence of numerous unresolved merge conflict markers in policy.test.ts, scheduler.test.ts, policy.ts, and scheduler.ts, which will prevent the application from compiling or parsing and could lead to a denial of service.

Comment on lines +435 to +448
<<<<<<< HEAD
await updatePolicy(tool, ToolConfirmationOutcome.Cancel, undefined, {
config: mockConfig,
messageBus: mockMessageBus,
});
=======
await updatePolicy(
tool,
ToolConfirmationOutcome.Cancel,
undefined,
mockConfig,
mockMessageBus,
);
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

      await updatePolicy(
        tool,
        ToolConfirmationOutcome.Cancel,
        undefined,
        mockConfig,
        mockMessageBus,
      );

Comment on lines +469 to +474
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
mockConfig,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        mockConfig,
        mockMessageBus,

Comment on lines +224 to +229
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
mockConfig,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging. Based on the signature change of updatePolicy, the version from commit 1d2585dba seems correct.

        mockConfig,
        mockMessageBus,

Comment on lines +254 to +259
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
mockConfig,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        mockConfig,
        mockMessageBus,

Comment on lines +289 to +294
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
mockConfig,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        mockConfig,
        mockMessageBus,

Comment on lines +593 to +598
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
mockConfig,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        mockConfig,
        mockMessageBus,

Comment on lines +628 to +635
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
{
config: mockConfig,
} as unknown as AgentLoopContext,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        {
          config: mockConfig,
        } as unknown as AgentLoopContext,
        mockMessageBus,

Comment on lines +662 to +669
<<<<<<< HEAD
{ config: mockConfig, messageBus: mockMessageBus },
=======
{
config: mockConfig,
} as unknown as AgentLoopContext,
mockMessageBus,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

This block contains unresolved merge conflict markers. These must be resolved before merging.

        {
          config: mockConfig,
        } as unknown as AgentLoopContext,
        mockMessageBus,

Comment on lines +113 to +123
<<<<<<< HEAD
deps: {
config: Config;
messageBus: MessageBus;
toolInvocation?: AnyToolInvocation;
},
=======
context: AgentLoopContext,
messageBus: MessageBus,
toolInvocation?: AnyToolInvocation,
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

This block contains unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>). These will cause the application to fail to parse or compile, leading to a denial of service. Based on the signature change of updatePolicy, the version from commit 1d2585dba seems correct. Please resolve these conflicts manually.

  context: AgentLoopContext,
  messageBus: MessageBus,
  toolInvocation?: AnyToolInvocation,

Comment on lines +608 to +623
<<<<<<< HEAD
await updatePolicy(toolCall.tool, outcome, lastDetails, {
config: this.config,
messageBus: this.messageBus,
toolInvocation: toolCall.invocation,
});
=======
await updatePolicy(
toolCall.tool,
outcome,
lastDetails,
this.context,
this.messageBus,
toolCall.invocation,
);
>>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

This block contains unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>). These will cause the application to fail to parse or compile, leading to a denial of service. Based on the signature change of updatePolicy, the version from commit 1d2585dba seems correct. Please resolve these conflicts manually.

      await updatePolicy(
        toolCall.tool,
        outcome,
        lastDetails,
        this.context,
        this.messageBus,
        toolCall.invocation,
      );

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 13, 2026
@galz10 galz10 closed this Mar 13, 2026
@galz10 galz10 deleted the hotfix/v0.34.0-preview.2/0.34.0-preview.3/preview/cherry-pick-1d2585d/pr-22255 branch March 13, 2026 22:40
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.

3 participants