Skip to content

Make max tool-calling round trips configurable via AppConfig and Advanced Settings #541

Description

@haiphucnguyen

Summary

The maximum number of tool-calling round trips is currently hardcoded to 10 in AiServiceBuilder.kt:

builder.toolProvider(toolProvider).maxToolCallingRoundTrips(10)

This should be user-configurable so that power users running agentic/multi-step workflows can raise the limit, while conservative users can lower it to reduce cost and latency.

Changes Required

  1. AppConfig.kt — add config field
    Add to the models config section:
val maxToolCallingRoundTrips: Int = 10
  1. AiServiceBuilder.kt — read from config

// Before:
builder.toolProvider(toolProvider).maxToolCallingRoundTrips(10)

// After:
builder.toolProvider(toolProvider)
.maxToolCallingRoundTrips(AppConfig.models.maxToolCallingRoundTrips)

  1. AdvancedSettingsSection.kt — add UI control
    Add a numeric input in the Advanced Settings panel:
    Label: Max tool-calling round trips
    Description: Maximum number of tool calls the AI can make in a single response. Higher values allow more complex agent tasks but increase latency and cost.

Default: 10
Range: 1 – 50

Using google translate to translate all texts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions