Skip to content

fix: configure timeout for A2A agents#3377

Open
TannyXie wants to merge 2 commits into
ModelEngine-Group:developfrom
TannyXie:hotfix/3244-a2a-timeout-config
Open

fix: configure timeout for A2A agents#3377
TannyXie wants to merge 2 commits into
ModelEngine-Group:developfrom
TannyXie:hotfix/3244-a2a-timeout-config

Conversation

@TannyXie

@TannyXie TannyXie commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • add timeout_seconds storage for external A2A agents
  • add settings API and frontend timeout input
  • use the saved timeout for normal and streaming A2A calls

Validation

  • python -m pytest test/backend/services/test_a2a_client_service.py test/backend/utils/test_a2a_http_client.py test/sdk/core/agents/test_a2a_agent_proxy.py -q
  • npm run type-check

Copilot AI review requested due to automatic review settings July 6, 2026 02:02
@TannyXie TannyXie requested review from Dallas98 and WMC001 as code owners July 6, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds per-external-agent request timeout configuration for A2A client agents, persisting the value in the backend database and exposing it through a new settings API that the frontend uses to let users edit the timeout. The stored timeout is then applied to both standard and streaming outbound A2A calls.

Changes:

  • Add timeout_seconds persistence for external A2A agents (DB migration + ORM model + DB access layer).
  • Introduce a backend settings endpoint to update per-agent call settings (currently timeout).
  • Update frontend A2A discovery UI/service layer to edit and save timeout, and apply it when calling external agents (normal + streaming), including agent config creation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/services/api.ts Adds the /settings endpoint URL builder for A2A external agents.
frontend/services/a2aService.ts Adds timeout_seconds to external agent types and a updateAgentSettings API call.
frontend/app/[locale]/agents/components/a2a/A2AAgentDiscoveryModal.tsx Adds timeout input to the agent settings popover and saves timeout via the new API.
deploy/sql/migrations/v2.3.0_0702_add_a2a_call_settings.sql Adds timeout_seconds column (default 300) to external agent table.
backend/services/a2a_client_service.py Reads stored timeout and passes it into A2AHttpClient for normal and streaming calls; adds service method to update settings.
backend/database/db_models.py Adds timeout_seconds column to A2AExternalAgent ORM model.
backend/database/a2a_agent_db.py Plumbs timeout_seconds through agent serialization and adds DB update/validation for call settings.
backend/apps/a2a_client_app.py Adds request model + PUT /agents/{id}/settings endpoint for updating call settings.
backend/agents/create_agent_info.py Uses stored timeout_seconds when building external agent config (timeout).

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

Comment on lines +51 to +56
timeout_seconds: Optional[int] = Field(
default=None,
ge=1,
le=3600,
description="Request timeout in seconds for calling the agent"
)
Comment on lines +337 to +340
if (!settingsResult.success) {
messageApi.error(settingsResult.message || t("a2a.protocol.updateFailed"));
return false;
}
Comment on lines +535 to +539
def update_external_agent_call_settings(
external_agent_id: int,
tenant_id: str,
user_id: str,
timeout_seconds: Optional[int] = None,
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.

2 participants