fix(patch): cherry-pick 1d2585d to release/v0.34.0-preview.2-pr-22255 [CONFLICTS]#22385
Conversation
…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
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 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
Changelog
Activity
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 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 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
|
There was a problem hiding this comment.
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.
| <<<<<<< 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)) |
| <<<<<<< HEAD | ||
| { config: mockConfig, messageBus: mockMessageBus }, | ||
| ======= | ||
| mockConfig, | ||
| mockMessageBus, | ||
| >>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255)) |
| <<<<<<< HEAD | ||
| { config: mockConfig, messageBus: mockMessageBus }, | ||
| ======= | ||
| mockConfig, | ||
| mockMessageBus, | ||
| >>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255)) |
| <<<<<<< HEAD | ||
| { config: mockConfig, messageBus: mockMessageBus }, | ||
| ======= | ||
| mockConfig, | ||
| mockMessageBus, | ||
| >>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255)) |
| <<<<<<< HEAD | ||
| { config: mockConfig, messageBus: mockMessageBus }, | ||
| ======= | ||
| mockConfig, | ||
| mockMessageBus, | ||
| >>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255)) |
| <<<<<<< HEAD | ||
| { config: mockConfig, messageBus: mockMessageBus }, | ||
| ======= | ||
| mockConfig, | ||
| mockMessageBus, | ||
| >>>>>>> 1d2585dba (fix(core): explicitly pass messageBus to policy engine for MCP tool saves (#22255)) |
| <<<<<<< 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)) |
| <<<<<<< 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)) |
| <<<<<<< 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)) |
There was a problem hiding this comment.
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,| <<<<<<< 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)) |
There was a problem hiding this comment.
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,
);
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.
This cherry-pick resulted in merge conflicts that need manual resolution.
🔧 Next Steps:
📋 Files with conflicts:
The commit has been created with conflict markers for easier manual resolution.
🚨 Important: