Skip to content

[TASK] Refactor default MaxChatCompletionIterations from 10 to 50 #123

@edenreich

Description

@edenreich

Summary

The current default value for MaxChatCompletionIterations is set to 10, which is too low for complex agentic tasks that require multiple tool calls and reasoning steps. This frequently causes tasks to be prematurely canceled before completion.

Current behavior:

  • Default: 10 iterations
  • Complex tasks (e.g., web scraping with multiple pages, multi-step data processing) hit this limit and get canceled
  • Users must manually override via environment variable: A2A_AGENT_CLIENT_MAX_CHAT_COMPLETION_ITERATIONS=50

Proposed change:

  • Increase default from 10 to 50 iterations
  • This provides better out-of-the-box experience for agentic workloads
  • Still allows override via environment variable for specific needs

Real-world example:
Browser agent attempting to scrape blog articles hit max iterations at 10, task was canceled mid-execution. After increasing to 30, task completed successfully but could have used more iterations.

Acceptance Criteria

  • Update default value in server/config/config.go from 10 to 50
  • Update default value in server/agent_builder.go from 10 to 50
  • Update default value in server/agent.go from 10 to 50
  • Update documentation in README.md to reflect new default (10 → 50)
  • Update all test files that reference the old default value of 10
  • Ensure Config.Validate() still enforces minimum of 1 iteration
  • Verify backward compatibility: environment variable still overrides default

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