Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ai.koog.agents.core.dsl.extension.onToolCall
* - SingleRunMode.PARALLEL: Executes multiple tool calls in parallel.
* @return An instance of AIAgentStrategy configured according to the specified single-run mode.
*/
Comment on lines 30 to 32
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.
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.
when (runMode) {
ToolCalls.SEQUENTIAL -> singleRunWithParallelAbility(false)
ToolCalls.PARALLEL -> singleRunWithParallelAbility(true)
Expand Down
Loading