Skip to content

Conversation

@devcrocod
Copy link
Contributor

Update default parameter for singleRunStrategy to ToolCalls.SEQUENTIAL

Breaking Changes

None


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

Copy link
Contributor

Copilot AI left a 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 from ToolCalls.SINGLE_RUN_SEQUENTIAL to ToolCalls.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> =
Copy link

Copilot AI Nov 27, 2025

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_SEQUENTIALsingleRunModeStrategy() (uses nodeLLMRequest, nodeExecuteTool, nodeLLMSendToolResult)
  • SEQUENTIALsingleRunWithParallelAbility(false) (uses nodeLLMRequestMultiple, 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.

Suggested change
public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SEQUENTIAL): AIAgentGraphStrategy<String, String> =
public fun singleRunStrategy(runMode: ToolCalls = ToolCalls.SINGLE_RUN_SEQUENTIAL): AIAgentGraphStrategy<String, String> =

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 32
* - SingleRunMode.PARALLEL: Executes multiple tool calls in parallel.
* @return An instance of AIAgentStrategy configured according to the specified single-run mode.
*/
Copy link

Copilot AI Nov 27, 2025

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, and ToolCalls.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.

Copilot uses AI. Check for mistakes.
@devcrocod devcrocod force-pushed the devcrocod/default-run-mode-strategy branch from 338b272 to 33229d1 Compare December 1, 2025 11:47
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Qodana for JVM

1163 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 1152
Missing KDoc for public API declaration 🔶 Warning 11
@@ 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 team

Contact us at [email protected]

@devcrocod devcrocod merged commit 923d150 into develop Dec 1, 2025
11 checks passed
@devcrocod devcrocod deleted the devcrocod/default-run-mode-strategy branch December 1, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants