Skip to content

fix: allow agent host to define a custom host and port #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ctorrao
Copy link

@ctorrao ctorrao commented May 7, 2025

Description

I was trying to run locally two instances of the Demo UI + Agent Host, and noticed that even when I defined a different env var "A2A_UI_PORT" to run the Demo UI in another port everything was working but the state was shared between the two UI instances, because they pointed to the same Host Agent (hardcoded to run in localhost:12000).

To solve this I propose this change in the Demo UI code, to allow to also run two instances of Agent Host, each per instance of Demo UI.

This follows the same logic that was implemented here:

A2A/demo/ui/main.py

Lines 155 to 160 in 35f51ce

# Setup the connection details, these should be set in the environment
host = os.environ.get('A2A_UI_HOST', '0.0.0.0')
port = int(os.environ.get('A2A_UI_PORT', '12000'))
# Set the client to talk to the server
host_agent_service.server_url = f'http://{host}:{port}'

@ctorrao ctorrao changed the title Allow the host_agent_service.py to run in a different host or port fix: allow agent host to define a custom host and port May 7, 2025
@holtskinner holtskinner requested a review from a team as a code owner May 16, 2025 21:31
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