-
Notifications
You must be signed in to change notification settings - Fork 266
Use SEQUENTIAL mode for singleRunStrategy #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR changes the default parameter for the singleRunStrategy function from ToolCalls.SINGLE_RUN_SEQUENTIAL to ToolCalls.SEQUENTIAL. However, this is a breaking change despite the PR description claiming otherwise, as these two enum values map to different implementation strategies with different behaviors.
Key changes:
- Default parameter of
singleRunStrategy()changed fromToolCalls.SINGLE_RUN_SEQUENTIALtoToolCalls.SEQUENTIAL - This affects the default behavior when
singleRunStrategy()is called without explicit parameters
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @return An instance of AIAgentStrategy configured according to the specified single-run mode. | ||
| */ | ||
| public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SINGLE_RUN_SEQUENTIAL): AIAgentGraphStrategy<String, String> = | ||
| public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SEQUENTIAL): AIAgentGraphStrategy<String, String> = |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the default from ToolCalls.SINGLE_RUN_SEQUENTIAL to ToolCalls.SEQUENTIAL is a breaking change, as these map to different implementations:
SINGLE_RUN_SEQUENTIAL→singleRunModeStrategy()(usesnodeLLMRequest,nodeExecuteTool,nodeLLMSendToolResult)SEQUENTIAL→singleRunWithParallelAbility(false)(usesnodeLLMRequestMultiple,nodeExecuteMultipleTools,nodeLLMSendMultipleToolResults)
The behavior differs in how they handle tool calls. This contradicts the PR description stating "Breaking Changes: None". Other parts of the codebase (e.g., koog-ktor/src/commonMain/kotlin/ai/koog/ktor/Agents.kt lines 100 and 112) still use SINGLE_RUN_SEQUENTIAL as their default, which would now delegate to a different implementation when calling singleRunStrategy() without explicit parameters.
| public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SEQUENTIAL): AIAgentGraphStrategy<String, String> = | |
| public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SINGLE_RUN_SEQUENTIAL): AIAgentGraphStrategy<String, String> = |
| * - SingleRunMode.PARALLEL: Executes multiple tool calls in parallel. | ||
| * @return An instance of AIAgentStrategy configured according to the specified single-run mode. | ||
| */ |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function documentation is outdated and uses incorrect terminology. It references:
- "SingleRunMode.SINGLE", "SingleRunMode.SEQUENTIAL", "SingleRunMode.PARALLEL" but should reference
ToolCalls.SEQUENTIAL,ToolCalls.PARALLEL, andToolCalls.SINGLE_RUN_SEQUENTIAL - The descriptions don't accurately reflect the actual behavior differences between the modes
The documentation should be updated to accurately describe what each ToolCalls enum value does and use the correct enum type name.
338b272 to
33229d1
Compare
Qodana for JVM1163 new problems were found
@@ Code coverage @@
+ 72% total lines covered
16737 lines analyzed, 12141 lines covered
# Calculated according to the filters of your coverage tool☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
Update default parameter for
singleRunStrategytoToolCalls.SEQUENTIALBreaking Changes
None
Type of the changes
Checklist
developas the base branchAdditional steps for pull requests adding a new feature