fix: configure timeout for A2A agents#3377
Open
TannyXie wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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_secondspersistence 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation