Skip to content

fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant and increase value to 30#1471

Open
cyrus2281 wants to merge 3 commits intomainfrom
cyrus/DATAGO-132685/stack-count
Open

fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant and increase value to 30#1471
cyrus2281 wants to merge 3 commits intomainfrom
cyrus/DATAGO-132685/stack-count

Conversation

@cyrus2281
Copy link
Copy Markdown
Collaborator

What is the purpose of this change?

Replace hardcoded max LLM calls per task value with a constant to improve code consistency and maintainability.

How was this change implemented?

- Added a new constant DEFAULT_MAX_LLM_CALLS_PER_TASK in the common/constants.py file
- Replaced all hardcoded instances of the value "20" with the new constant across multiple files:
  - fix: replace hardcoded max_llm_calls_per_task with constant DEFAULT_MAX_LLM_CALLS_PER_TASK

Key Design Decisions (optional - delete if not applicable)

Using a constant makes the code more maintainable by centralizing the configuration value in one place, making future changes easier and reducing the risk of inconsistency.

How was this change tested?

  • Manual testing: Verified agent behavior remains unchanged with the constant
  • Unit tests: Not applicable - constant replacement only
  • Integration tests: Not applicable
  • Known limitations: None - direct value replacement with no functional changes

Is there anything the reviewers should focus on/be aware of?

Ensure all instances of the hardcoded value have been replaced correctly.

@cyrus2281 cyrus2281 self-assigned this Apr 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

✅ FOSSA Guard: Licensing (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (1.22.0) • 0 new, 9 total (9 in base)

Scan Report | View Details in FOSSA

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

✅ FOSSA Guard: Vulnerability (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (1.22.0) • 0 new, 8 total (8 in base)

Scan Report | View Details in FOSSA

@cyrus2281 cyrus2281 changed the title fix(DATAGO-132685): replace hardcoded max_llm_calls_per_task with constant fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant Apr 28, 2026
Copy link
Copy Markdown
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 aims to improve maintainability by centralizing the default “max LLM calls per task” value into a shared constant and using it as the fallback where the runtime config is read.

Changes:

  • Added DEFAULT_MAX_LLM_CALLS_PER_TASK = 20 to common/constants.py.
  • Replaced hardcoded 20 fallbacks for max_llm_calls_per_task with DEFAULT_MAX_LLM_CALLS_PER_TASK in agent execution paths (SAC component, structured invocation handler, and A2A request handling).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/solace_agent_mesh/common/constants.py Introduces the centralized default constant for max LLM calls per task.
src/solace_agent_mesh/agent/sac/structured_invocation/handler.py Uses the shared constant as the get_config fallback when building RunConfig.
src/solace_agent_mesh/agent/sac/component.py Uses the shared constant as the get_config fallback when re-triggering runs.
src/solace_agent_mesh/agent/protocol/event_handlers.py Uses the shared constant as the get_config fallback for A2A task execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/solace_agent_mesh/common/constants.py
@cyrus2281 cyrus2281 changed the title fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant and increase to 30 Apr 28, 2026
@cyrus2281 cyrus2281 changed the title fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant and increase to 30 fix(DATAGO-134114): replace hardcoded max_llm_calls_per_task with constant and increase value to 30 Apr 28, 2026
@sonarqube-solacecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@enavitan enavitan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, wonder if we log the failures and at least try to understand where things went south, and perhaps have a follow up task to tweak prompts to reduce these failures case per case basis

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