From aca728e3a8b0a4d7ff7eba816eba24a6bd10d7c2 Mon Sep 17 00:00:00 2001 From: SWE Destroyer Date: Tue, 24 Feb 2026 13:54:50 +0000 Subject: [PATCH 1/3] Migrate default ports to non-standard values and centralize port configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port migration: - AgentEx API: 5003 → 5718 - ACP Server: 8000 → 8718 - Health Check: 80 → 8080 - Multi-agent example: 8000-8003 → 8718-8721 Centralized all port defaults in src/agentex/lib/constants/ports.py. All ports remain configurable via env vars (AGENTEX_BASE_URL, ACP_PORT, HEALTH_CHECK_PORT) and manifest configuration. Updated ~150 files: core SDK, CLI templates, 22+ Dockerfiles, 21+ manifests, test files, notebooks, and documentation. Note: .github/workflows/*.yml changes excluded (requires workflow scope token). Closes AGX1-98 Co-Authored-By: Claude Opus 4.6 --- examples/demos/procurement_agent/Dockerfile | 2 +- examples/demos/procurement_agent/README.md | 4 +- examples/demos/procurement_agent/dev.ipynb | 2 +- .../demos/procurement_agent/evals/conftest.py | 2 +- .../demos/procurement_agent/manifest.yaml | 6 +- .../project/scripts/happy_path.py | 2 +- .../project/scripts/human_in_the_loop.py | 2 +- .../project/scripts/out_of_order.py | 2 +- .../project/scripts/send_test_events.py | 2 +- .../project/scripts/send_test_events_lite.py | 2 +- examples/launch-tutorials.sh | 4 +- .../00_sync/000_hello_acp/Dockerfile | 2 +- .../tutorials/00_sync/000_hello_acp/dev.ipynb | 2 +- .../00_sync/000_hello_acp/manifest.yaml | 2 +- .../00_sync/000_hello_acp/tests/test_agent.py | 4 +- .../00_sync/010_multiturn/Dockerfile | 2 +- .../tutorials/00_sync/010_multiturn/dev.ipynb | 2 +- .../00_sync/010_multiturn/manifest.yaml | 2 +- .../00_sync/010_multiturn/tests/test_agent.py | 4 +- .../00_sync/020_streaming/Dockerfile | 2 +- .../tutorials/00_sync/020_streaming/dev.ipynb | 2 +- .../00_sync/020_streaming/manifest.yaml | 2 +- .../00_sync/020_streaming/tests/test_agent.py | 4 +- .../00_sync/030_langgraph/Dockerfile | 2 +- .../00_sync/030_langgraph/manifest.yaml | 2 +- .../00_sync/030_langgraph/tests/test_agent.py | 4 +- .../10_async/00_base/000_hello_acp/Dockerfile | 2 +- .../10_async/00_base/000_hello_acp/dev.ipynb | 2 +- .../00_base/000_hello_acp/manifest.yaml | 2 +- .../00_base/000_hello_acp/tests/test_agent.py | 4 +- .../10_async/00_base/010_multiturn/Dockerfile | 2 +- .../10_async/00_base/010_multiturn/dev.ipynb | 2 +- .../00_base/010_multiturn/manifest.yaml | 2 +- .../00_base/010_multiturn/tests/test_agent.py | 4 +- .../10_async/00_base/020_streaming/Dockerfile | 2 +- .../10_async/00_base/020_streaming/dev.ipynb | 2 +- .../00_base/020_streaming/manifest.yaml | 2 +- .../00_base/020_streaming/tests/test_agent.py | 4 +- .../10_async/00_base/030_tracing/Dockerfile | 2 +- .../10_async/00_base/030_tracing/dev.ipynb | 2 +- .../00_base/030_tracing/manifest.yaml | 2 +- .../00_base/030_tracing/tests/test_agent.py | 4 +- .../00_base/040_other_sdks/Dockerfile | 2 +- .../10_async/00_base/040_other_sdks/dev.ipynb | 2 +- .../00_base/040_other_sdks/manifest.yaml | 2 +- .../040_other_sdks/tests/test_agent.py | 4 +- .../00_base/080_batch_events/Dockerfile | 2 +- .../00_base/080_batch_events/dev.ipynb | 2 +- .../00_base/080_batch_events/manifest.yaml | 2 +- .../080_batch_events/test_batch_events.py | 2 +- .../080_batch_events/tests/test_agent.py | 4 +- .../090_multi_agent_non_temporal/Dockerfile | 2 +- .../090_multi_agent_non_temporal/README.md | 12 +-- .../090_multi_agent_non_temporal/creator.yaml | 4 +- .../090_multi_agent_non_temporal/critic.yaml | 4 +- .../formatter.yaml | 4 +- .../orchestrator.yaml | 4 +- .../start-agents.sh | 26 ++--- .../tests/test_agent.py | 4 +- .../10_async/00_base/100_langgraph/Dockerfile | 2 +- .../00_base/100_langgraph/manifest.yaml | 2 +- .../00_base/100_langgraph/tests/test_agent.py | 4 +- .../10_temporal/000_hello_acp/Dockerfile | 2 +- .../10_temporal/000_hello_acp/dev.ipynb | 2 +- .../10_temporal/000_hello_acp/manifest.yaml | 2 +- .../000_hello_acp/tests/test_agent.py | 4 +- .../10_temporal/010_agent_chat/Dockerfile | 2 +- .../10_temporal/010_agent_chat/dev.ipynb | 2 +- .../10_temporal/010_agent_chat/manifest.yaml | 2 +- .../010_agent_chat/tests/test_agent.py | 4 +- .../10_temporal/020_state_machine/Dockerfile | 2 +- .../10_temporal/020_state_machine/dev.ipynb | 2 +- .../020_state_machine/manifest.yaml | 2 +- .../020_state_machine/tests/test_agent.py | 4 +- .../030_custom_activities/Dockerfile | 2 +- .../030_custom_activities/dev.ipynb | 2 +- .../030_custom_activities/manifest.yaml | 2 +- .../030_custom_activities/tests/test_agent.py | 4 +- .../050_agent_chat_guardrails/Dockerfile | 2 +- .../050_agent_chat_guardrails/dev.ipynb | 2 +- .../050_agent_chat_guardrails/manifest.yaml | 2 +- .../tests/test_agent.py | 4 +- .../Dockerfile | 2 +- .../dev.ipynb | 2 +- .../manifest.yaml | 2 +- .../tests/test_agent.py | 4 +- .../070_open_ai_agents_sdk_tools/Dockerfile | 2 +- .../070_open_ai_agents_sdk_tools/dev.ipynb | 2 +- .../manifest.yaml | 2 +- .../tests/test_agent.py | 4 +- .../Dockerfile | 2 +- .../dev.ipynb | 2 +- .../manifest.yaml | 2 +- .../tests/test_agent.py | 4 +- .../090_claude_agents_sdk_mvp/Dockerfile | 2 +- .../090_claude_agents_sdk_mvp/manifest.yaml | 2 +- .../tests/test_agent.py | 2 +- .../10_temporal/100_gemini_litellm/Dockerfile | 2 +- examples/tutorials/TEST_RUNNER_README.md | 10 +- src/agentex/_client.py | 4 +- .../default-langgraph/Dockerfile-uv.j2 | 2 +- .../templates/default-langgraph/Dockerfile.j2 | 2 +- .../templates/default-langgraph/dev.ipynb.j2 | 2 +- .../default-langgraph/manifest.yaml.j2 | 2 +- .../default-langgraph/test_agent.py.j2 | 4 +- .../cli/templates/default/Dockerfile-uv.j2 | 2 +- .../lib/cli/templates/default/Dockerfile.j2 | 2 +- .../lib/cli/templates/default/README.md.j2 | 2 +- .../lib/cli/templates/default/dev.ipynb.j2 | 2 +- .../cli/templates/default/manifest.yaml.j2 | 2 +- .../cli/templates/default/test_agent.py.j2 | 4 +- .../templates/sync-langgraph/Dockerfile-uv.j2 | 2 +- .../templates/sync-langgraph/Dockerfile.j2 | 2 +- .../cli/templates/sync-langgraph/dev.ipynb.j2 | 2 +- .../templates/sync-langgraph/manifest.yaml.j2 | 2 +- .../templates/sync-langgraph/test_agent.py.j2 | 4 +- .../sync-openai-agents/Dockerfile-uv.j2 | 2 +- .../sync-openai-agents/Dockerfile.j2 | 2 +- .../templates/sync-openai-agents/README.md.j2 | 8 +- .../templates/sync-openai-agents/dev.ipynb.j2 | 2 +- .../sync-openai-agents/manifest.yaml.j2 | 2 +- .../sync-openai-agents/test_agent.py.j2 | 4 +- .../lib/cli/templates/sync/Dockerfile-uv.j2 | 2 +- .../lib/cli/templates/sync/Dockerfile.j2 | 2 +- .../lib/cli/templates/sync/README.md.j2 | 8 +- .../lib/cli/templates/sync/dev.ipynb.j2 | 2 +- .../lib/cli/templates/sync/manifest.yaml.j2 | 2 +- .../lib/cli/templates/sync/test_agent.py.j2 | 4 +- .../temporal-openai-agents/Dockerfile-uv.j2 | 2 +- .../temporal-openai-agents/Dockerfile.j2 | 2 +- .../temporal-openai-agents/README.md.j2 | 4 +- .../temporal-openai-agents/dev.ipynb.j2 | 2 +- .../temporal-openai-agents/manifest.yaml.j2 | 6 +- .../temporal-openai-agents/test_agent.py.j2 | 4 +- .../cli/templates/temporal/Dockerfile-uv.j2 | 2 +- .../lib/cli/templates/temporal/Dockerfile.j2 | 2 +- .../lib/cli/templates/temporal/README.md.j2 | 8 +- .../lib/cli/templates/temporal/dev.ipynb.j2 | 2 +- .../cli/templates/temporal/manifest.yaml.j2 | 6 +- .../cli/templates/temporal/test_agent.py.j2 | 4 +- src/agentex/lib/constants/__init__.py | 0 src/agentex/lib/constants/ports.py | 15 +++ .../plugins/openai_agents/tests/conftest.py | 94 +++++-------------- .../lib/sdk/fastacp/base/base_acp_server.py | 55 ++++------- src/agentex/lib/sdk/fastacp/tests/conftest.py | 68 ++++++-------- src/agentex/lib/types/agent_configs.py | 18 +--- tests/lib/test_agentex_worker.py | 8 +- tests/test_client.py | 4 +- 148 files changed, 308 insertions(+), 376 deletions(-) create mode 100644 src/agentex/lib/constants/__init__.py create mode 100644 src/agentex/lib/constants/ports.py diff --git a/examples/demos/procurement_agent/Dockerfile b/examples/demos/procurement_agent/Dockerfile index 17dd0e680..89916ceb2 100644 --- a/examples/demos/procurement_agent/Dockerfile +++ b/examples/demos/procurement_agent/Dockerfile @@ -42,7 +42,7 @@ RUN uv pip install --system . COPY procurement_agent/project /app/procurement_agent/project # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/demos/procurement_agent/README.md b/examples/demos/procurement_agent/README.md index 878c2ec31..1a17cbd2a 100644 --- a/examples/demos/procurement_agent/README.md +++ b/examples/demos/procurement_agent/README.md @@ -85,7 +85,7 @@ uv sync export ENVIRONMENT=development && uv run agentex agents run --manifest manifest.yaml ``` -The agent will start and register with the AgentEx backend on port 8000. +The agent will start and register with the AgentEx backend on port 8718. ### Step 4: Create a Task @@ -365,7 +365,7 @@ tools=[ ## Troubleshooting **Agent not appearing in UI** -- Verify agent is running on port 8000: `lsof -i :8000` +- Verify agent is running on port 8718: `lsof -i :8718` - Check `ENVIRONMENT=development` is set - Review agent logs for errors diff --git a/examples/demos/procurement_agent/dev.ipynb b/examples/demos/procurement_agent/dev.ipynb index 53b70d152..c99c07d89 100644 --- a/examples/demos/procurement_agent/dev.ipynb +++ b/examples/demos/procurement_agent/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/demos/procurement_agent/evals/conftest.py b/examples/demos/procurement_agent/evals/conftest.py index 28e299b45..5b2ed1eb0 100644 --- a/examples/demos/procurement_agent/evals/conftest.py +++ b/examples/demos/procurement_agent/evals/conftest.py @@ -21,7 +21,7 @@ # Set environment variables for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/demos/procurement_agent/manifest.yaml b/examples/demos/procurement_agent/manifest.yaml index 823a1cd72..efdf5d43c 100644 --- a/examples/demos/procurement_agent/manifest.yaml +++ b/examples/demos/procurement_agent/manifest.yaml @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) @@ -90,8 +90,8 @@ agent: queue_name: procurement_agent_queue # Optional: Health check port for temporal worker - # Defaults to 80 if not specified - # health_check_port: 80 + # Defaults to 8080 if not specified + # health_check_port: 8080 # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables diff --git a/examples/demos/procurement_agent/project/scripts/happy_path.py b/examples/demos/procurement_agent/project/scripts/happy_path.py index 44ed6247c..37b03d017 100644 --- a/examples/demos/procurement_agent/project/scripts/happy_path.py +++ b/examples/demos/procurement_agent/project/scripts/happy_path.py @@ -23,7 +23,7 @@ # Set defaults for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/demos/procurement_agent/project/scripts/human_in_the_loop.py b/examples/demos/procurement_agent/project/scripts/human_in_the_loop.py index c2e2ebc53..8810109d4 100644 --- a/examples/demos/procurement_agent/project/scripts/human_in_the_loop.py +++ b/examples/demos/procurement_agent/project/scripts/human_in_the_loop.py @@ -23,7 +23,7 @@ # Set defaults for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/demos/procurement_agent/project/scripts/out_of_order.py b/examples/demos/procurement_agent/project/scripts/out_of_order.py index 164c4a9e5..ae49c47f3 100644 --- a/examples/demos/procurement_agent/project/scripts/out_of_order.py +++ b/examples/demos/procurement_agent/project/scripts/out_of_order.py @@ -24,7 +24,7 @@ # Set defaults for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/demos/procurement_agent/project/scripts/send_test_events.py b/examples/demos/procurement_agent/project/scripts/send_test_events.py index e85b75c4d..ad46c9d5e 100644 --- a/examples/demos/procurement_agent/project/scripts/send_test_events.py +++ b/examples/demos/procurement_agent/project/scripts/send_test_events.py @@ -24,7 +24,7 @@ # Set defaults for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/demos/procurement_agent/project/scripts/send_test_events_lite.py b/examples/demos/procurement_agent/project/scripts/send_test_events_lite.py index cab515374..12f5872a9 100644 --- a/examples/demos/procurement_agent/project/scripts/send_test_events_lite.py +++ b/examples/demos/procurement_agent/project/scripts/send_test_events_lite.py @@ -24,7 +24,7 @@ # Set defaults for local development os.environ.setdefault("AGENT_NAME", "procurement-agent") -os.environ.setdefault("ACP_URL", "http://localhost:8000") +os.environ.setdefault("ACP_URL", "http://localhost:8718") os.environ.setdefault("WORKFLOW_NAME", "procurement-agent") os.environ.setdefault("WORKFLOW_TASK_QUEUE", "procurement_agent_queue") os.environ.setdefault("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/launch-tutorials.sh b/examples/launch-tutorials.sh index 024d9ac17..52d652a56 100755 --- a/examples/launch-tutorials.sh +++ b/examples/launch-tutorials.sh @@ -220,8 +220,8 @@ manual_cleanup() { fi # Check for occupied ports - print_colored $YELLOW "🔍 Checking common tutorial ports (8000-8003)..." - local port_check=$(lsof -i :8000 -i :8001 -i :8002 -i :8003 2>/dev/null || true) + print_colored $YELLOW "🔍 Checking common tutorial ports (8718-8721)..." + local port_check=$(lsof -i :8718 -i :8719 -i :8720 -i :8721 2>/dev/null || true) if [[ -n "$port_check" ]]; then found_processes=true echo "$port_check" diff --git a/examples/tutorials/00_sync/000_hello_acp/Dockerfile b/examples/tutorials/00_sync/000_hello_acp/Dockerfile index b91d13397..2bdd4e2ec 100644 --- a/examples/tutorials/00_sync/000_hello_acp/Dockerfile +++ b/examples/tutorials/00_sync/000_hello_acp/Dockerfile @@ -48,4 +48,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=000-hello-acp # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/00_sync/000_hello_acp/dev.ipynb b/examples/tutorials/00_sync/000_hello_acp/dev.ipynb index a50a29f35..74bcf6216 100644 --- a/examples/tutorials/00_sync/000_hello_acp/dev.ipynb +++ b/examples/tutorials/00_sync/000_hello_acp/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/00_sync/000_hello_acp/manifest.yaml b/examples/tutorials/00_sync/000_hello_acp/manifest.yaml index 37214b06e..6b9a7ff05 100644 --- a/examples/tutorials/00_sync/000_hello_acp/manifest.yaml +++ b/examples/tutorials/00_sync/000_hello_acp/manifest.yaml @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py b/examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py index ad82771f6..c774c14ab 100644 --- a/examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py +++ b/examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py @@ -12,7 +12,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: hello-acp) """ @@ -26,7 +26,7 @@ from agentex.types.task_message_update import StreamTaskMessageFull, StreamTaskMessageDelta # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "s000-hello-acp") diff --git a/examples/tutorials/00_sync/010_multiturn/Dockerfile b/examples/tutorials/00_sync/010_multiturn/Dockerfile index 71ccbaf53..ed5738363 100644 --- a/examples/tutorials/00_sync/010_multiturn/Dockerfile +++ b/examples/tutorials/00_sync/010_multiturn/Dockerfile @@ -48,4 +48,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=010-multiturn # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/00_sync/010_multiturn/dev.ipynb b/examples/tutorials/00_sync/010_multiturn/dev.ipynb index d82cf5775..ac866c9c3 100644 --- a/examples/tutorials/00_sync/010_multiturn/dev.ipynb +++ b/examples/tutorials/00_sync/010_multiturn/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/00_sync/010_multiturn/manifest.yaml b/examples/tutorials/00_sync/010_multiturn/manifest.yaml index c7e094aa6..2d0eaeb32 100644 --- a/examples/tutorials/00_sync/010_multiturn/manifest.yaml +++ b/examples/tutorials/00_sync/010_multiturn/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py index 510e9159d..cb497a981 100644 --- a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py +++ b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py @@ -12,7 +12,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: s010-multiturn) """ @@ -27,7 +27,7 @@ from agentex.lib.sdk.fastacp.base.base_acp_server import uuid # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "s010-multiturn") diff --git a/examples/tutorials/00_sync/020_streaming/Dockerfile b/examples/tutorials/00_sync/020_streaming/Dockerfile index 00137d7f9..64d20e602 100644 --- a/examples/tutorials/00_sync/020_streaming/Dockerfile +++ b/examples/tutorials/00_sync/020_streaming/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=020-streaming # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/examples/tutorials/00_sync/020_streaming/dev.ipynb b/examples/tutorials/00_sync/020_streaming/dev.ipynb index b4e517c3f..81afe9ac1 100644 --- a/examples/tutorials/00_sync/020_streaming/dev.ipynb +++ b/examples/tutorials/00_sync/020_streaming/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/00_sync/020_streaming/manifest.yaml b/examples/tutorials/00_sync/020_streaming/manifest.yaml index 39a04d0f8..80890f34c 100644 --- a/examples/tutorials/00_sync/020_streaming/manifest.yaml +++ b/examples/tutorials/00_sync/020_streaming/manifest.yaml @@ -42,7 +42,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/00_sync/020_streaming/tests/test_agent.py b/examples/tutorials/00_sync/020_streaming/tests/test_agent.py index b4ff65ff5..032f9de32 100644 --- a/examples/tutorials/00_sync/020_streaming/tests/test_agent.py +++ b/examples/tutorials/00_sync/020_streaming/tests/test_agent.py @@ -12,7 +12,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: s020-streaming) """ @@ -27,7 +27,7 @@ from agentex.lib.sdk.fastacp.base.base_acp_server import uuid # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "s020-streaming") diff --git a/examples/tutorials/00_sync/030_langgraph/Dockerfile b/examples/tutorials/00_sync/030_langgraph/Dockerfile index ed7172f0d..0027d5aa7 100644 --- a/examples/tutorials/00_sync/030_langgraph/Dockerfile +++ b/examples/tutorials/00_sync/030_langgraph/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=s030-langgraph # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/00_sync/030_langgraph/manifest.yaml b/examples/tutorials/00_sync/030_langgraph/manifest.yaml index bfe005626..4e14e2804 100644 --- a/examples/tutorials/00_sync/030_langgraph/manifest.yaml +++ b/examples/tutorials/00_sync/030_langgraph/manifest.yaml @@ -9,7 +9,7 @@ build: local_development: agent: - port: 8000 + port: 8718 host_address: host.docker.internal paths: acp: project/acp.py diff --git a/examples/tutorials/00_sync/030_langgraph/tests/test_agent.py b/examples/tutorials/00_sync/030_langgraph/tests/test_agent.py index 36fcf418f..a12d7fcbe 100644 --- a/examples/tutorials/00_sync/030_langgraph/tests/test_agent.py +++ b/examples/tutorials/00_sync/030_langgraph/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: s030-langgraph) """ @@ -26,7 +26,7 @@ from agentex.lib.sdk.fastacp.base.base_acp_server import uuid # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "s030-langgraph") diff --git a/examples/tutorials/10_async/00_base/000_hello_acp/Dockerfile b/examples/tutorials/10_async/00_base/000_hello_acp/Dockerfile index 8b0d20f88..f7850eb19 100644 --- a/examples/tutorials/10_async/00_base/000_hello_acp/Dockerfile +++ b/examples/tutorials/10_async/00_base/000_hello_acp/Dockerfile @@ -48,4 +48,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab000-hello-acp # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/000_hello_acp/dev.ipynb b/examples/tutorials/10_async/00_base/000_hello_acp/dev.ipynb index 2d5b8800c..5cef3b380 100644 --- a/examples/tutorials/10_async/00_base/000_hello_acp/dev.ipynb +++ b/examples/tutorials/10_async/00_base/000_hello_acp/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/000_hello_acp/manifest.yaml b/examples/tutorials/10_async/00_base/000_hello_acp/manifest.yaml index ba0c68369..23126beaa 100644 --- a/examples/tutorials/10_async/00_base/000_hello_acp/manifest.yaml +++ b/examples/tutorials/10_async/00_base/000_hello_acp/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/000_hello_acp/tests/test_agent.py b/examples/tutorials/10_async/00_base/000_hello_acp/tests/test_agent.py index c57cec448..c9b261c89 100644 --- a/examples/tutorials/10_async/00_base/000_hello_acp/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/000_hello_acp/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab000-hello-acp) """ @@ -33,7 +33,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab000-hello-acp") diff --git a/examples/tutorials/10_async/00_base/010_multiturn/Dockerfile b/examples/tutorials/10_async/00_base/010_multiturn/Dockerfile index 48969ad90..bd159cdab 100644 --- a/examples/tutorials/10_async/00_base/010_multiturn/Dockerfile +++ b/examples/tutorials/10_async/00_base/010_multiturn/Dockerfile @@ -48,4 +48,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab010-multiturn # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/010_multiturn/dev.ipynb b/examples/tutorials/10_async/00_base/010_multiturn/dev.ipynb index e174e4705..dd61f3fbf 100644 --- a/examples/tutorials/10_async/00_base/010_multiturn/dev.ipynb +++ b/examples/tutorials/10_async/00_base/010_multiturn/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/010_multiturn/manifest.yaml b/examples/tutorials/10_async/00_base/010_multiturn/manifest.yaml index 5d21e78d5..5cfe95fa9 100644 --- a/examples/tutorials/10_async/00_base/010_multiturn/manifest.yaml +++ b/examples/tutorials/10_async/00_base/010_multiturn/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/010_multiturn/tests/test_agent.py b/examples/tutorials/10_async/00_base/010_multiturn/tests/test_agent.py index 33d831858..fc8b01ae0 100644 --- a/examples/tutorials/10_async/00_base/010_multiturn/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/010_multiturn/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab010-multiturn) """ @@ -33,7 +33,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab010-multiturn") diff --git a/examples/tutorials/10_async/00_base/020_streaming/Dockerfile b/examples/tutorials/10_async/00_base/020_streaming/Dockerfile index 447ca292d..f754d814a 100644 --- a/examples/tutorials/10_async/00_base/020_streaming/Dockerfile +++ b/examples/tutorials/10_async/00_base/020_streaming/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab020-streaming # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/020_streaming/dev.ipynb b/examples/tutorials/10_async/00_base/020_streaming/dev.ipynb index f66be24df..03eaa73c4 100644 --- a/examples/tutorials/10_async/00_base/020_streaming/dev.ipynb +++ b/examples/tutorials/10_async/00_base/020_streaming/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/020_streaming/manifest.yaml b/examples/tutorials/10_async/00_base/020_streaming/manifest.yaml index bd5673a6b..807eab27e 100644 --- a/examples/tutorials/10_async/00_base/020_streaming/manifest.yaml +++ b/examples/tutorials/10_async/00_base/020_streaming/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/020_streaming/tests/test_agent.py b/examples/tutorials/10_async/00_base/020_streaming/tests/test_agent.py index c55525191..be1819507 100644 --- a/examples/tutorials/10_async/00_base/020_streaming/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/020_streaming/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab020-streaming) """ @@ -32,7 +32,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab020-streaming") diff --git a/examples/tutorials/10_async/00_base/030_tracing/Dockerfile b/examples/tutorials/10_async/00_base/030_tracing/Dockerfile index 2aee7e1dd..0e0879e17 100644 --- a/examples/tutorials/10_async/00_base/030_tracing/Dockerfile +++ b/examples/tutorials/10_async/00_base/030_tracing/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab030-tracing # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/030_tracing/dev.ipynb b/examples/tutorials/10_async/00_base/030_tracing/dev.ipynb index f667737bb..3b8c503cc 100644 --- a/examples/tutorials/10_async/00_base/030_tracing/dev.ipynb +++ b/examples/tutorials/10_async/00_base/030_tracing/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/030_tracing/manifest.yaml b/examples/tutorials/10_async/00_base/030_tracing/manifest.yaml index 3c9b2c147..c7021be41 100644 --- a/examples/tutorials/10_async/00_base/030_tracing/manifest.yaml +++ b/examples/tutorials/10_async/00_base/030_tracing/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/030_tracing/tests/test_agent.py b/examples/tutorials/10_async/00_base/030_tracing/tests/test_agent.py index 0cc65c566..ae6557bf9 100644 --- a/examples/tutorials/10_async/00_base/030_tracing/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/030_tracing/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab030-tracing) """ @@ -23,7 +23,7 @@ from agentex import AsyncAgentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab030-tracing") diff --git a/examples/tutorials/10_async/00_base/040_other_sdks/Dockerfile b/examples/tutorials/10_async/00_base/040_other_sdks/Dockerfile index 2e0ee6ef0..b9e33ae57 100644 --- a/examples/tutorials/10_async/00_base/040_other_sdks/Dockerfile +++ b/examples/tutorials/10_async/00_base/040_other_sdks/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab040-other-sdks # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/040_other_sdks/dev.ipynb b/examples/tutorials/10_async/00_base/040_other_sdks/dev.ipynb index abb1b9e73..2207c5f20 100644 --- a/examples/tutorials/10_async/00_base/040_other_sdks/dev.ipynb +++ b/examples/tutorials/10_async/00_base/040_other_sdks/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/040_other_sdks/manifest.yaml b/examples/tutorials/10_async/00_base/040_other_sdks/manifest.yaml index 8fd324c13..afdb262b2 100644 --- a/examples/tutorials/10_async/00_base/040_other_sdks/manifest.yaml +++ b/examples/tutorials/10_async/00_base/040_other_sdks/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/040_other_sdks/tests/test_agent.py b/examples/tutorials/10_async/00_base/040_other_sdks/tests/test_agent.py index 1704a2271..516f5edbf 100644 --- a/examples/tutorials/10_async/00_base/040_other_sdks/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/040_other_sdks/tests/test_agent.py @@ -22,7 +22,7 @@ 4. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab040-other-sdks) """ @@ -43,7 +43,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab040-other-sdks") diff --git a/examples/tutorials/10_async/00_base/080_batch_events/Dockerfile b/examples/tutorials/10_async/00_base/080_batch_events/Dockerfile index dbeccdfb9..ac5996840 100644 --- a/examples/tutorials/10_async/00_base/080_batch_events/Dockerfile +++ b/examples/tutorials/10_async/00_base/080_batch_events/Dockerfile @@ -48,4 +48,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab080-batch-events # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/080_batch_events/dev.ipynb b/examples/tutorials/10_async/00_base/080_batch_events/dev.ipynb index 5bb98625c..5d2dc8bb3 100644 --- a/examples/tutorials/10_async/00_base/080_batch_events/dev.ipynb +++ b/examples/tutorials/10_async/00_base/080_batch_events/dev.ipynb @@ -11,7 +11,7 @@ "\n", "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/00_base/080_batch_events/manifest.yaml b/examples/tutorials/10_async/00_base/080_batch_events/manifest.yaml index dd5f8cbdc..296118625 100644 --- a/examples/tutorials/10_async/00_base/080_batch_events/manifest.yaml +++ b/examples/tutorials/10_async/00_base/080_batch_events/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/00_base/080_batch_events/test_batch_events.py b/examples/tutorials/10_async/00_base/080_batch_events/test_batch_events.py index b7a5397d0..7c48c18a7 100644 --- a/examples/tutorials/10_async/00_base/080_batch_events/test_batch_events.py +++ b/examples/tutorials/10_async/00_base/080_batch_events/test_batch_events.py @@ -10,7 +10,7 @@ import httpx # Configuration -BASE_URL = "http://localhost:5003" +BASE_URL = "http://localhost:5718" # AGENT_ID = "b4f32d71-ff69-4ac9-84d1-eb2937fea0c7" AGENT_ID = "58e78cd0-c898-4009-b5d9-eada8ebcad83" RPC_ENDPOINT = f"{BASE_URL}/agents/{AGENT_ID}/rpc" diff --git a/examples/tutorials/10_async/00_base/080_batch_events/tests/test_agent.py b/examples/tutorials/10_async/00_base/080_batch_events/tests/test_agent.py index 1dea1300b..e1ec5abbb 100644 --- a/examples/tutorials/10_async/00_base/080_batch_events/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/080_batch_events/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab080-batch-events) """ @@ -34,7 +34,7 @@ from agentex.types.task_message_content import TextContent # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab080-batch-events") diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile index 24ecf4484..e580dc2d1 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile @@ -54,4 +54,4 @@ ENV AGENT_NAME=ab090-multi-agent-non-temporal # (ab090-creator-agent, ab090-critic-agent, ab090-formatter-agent, or ab090-orchestrator-agent) # Run the agent using uvicorn -CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8000} +CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718} diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md index d9f860e30..47d77dde4 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md @@ -81,22 +81,22 @@ The system uses a shared build configuration with type-safe interfaces: ## 🤖 Agent Responsibilities -### **Creator Agent** (Port 8001) +### **Creator Agent** (Port 8719) - Generates original content based on user requests - Revises content based on critic feedback - Maintains conversation history and iteration tracking -### **Critic Agent** (Port 8002) +### **Critic Agent** (Port 8720) - Reviews content against specified rules - Provides specific, actionable feedback - Approves content when all rules are met -### **Formatter Agent** (Port 8003) +### **Formatter Agent** (Port 8721) - Converts approved content to target formats (HTML, Markdown, JSON, etc.) - Preserves meaning while applying format-specific conventions - Supports multiple output formats -### **Orchestrator Agent** (Port 8000) +### **Orchestrator Agent** (Port 8718) - Coordinates the entire workflow using state machines - Manages inter-agent communication - Tracks progress and handles errors/retries @@ -164,14 +164,14 @@ uv run agentex agents deploy --cluster your-cluster --manifest creator.yaml ### Shared Dockerfile The Dockerfile uses build arguments to run different agents: ```dockerfile -CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8000} +CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718} ``` Manifest files specify which agent to run: ```yaml build_args: AGENT_FILE: creator.py - PORT: 8001 + PORT: 8719 ``` ### State Machine Flow diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/creator.yaml b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/creator.yaml index 9d531bbf4..a702a5288 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/creator.yaml +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/creator.yaml @@ -8,11 +8,11 @@ build: dockerfile: Dockerfile build_args: AGENT_FILE: creator.py - PORT: 8001 + PORT: 8719 local_development: agent: - port: 8001 + port: 8719 host_address: host.docker.internal paths: acp: project/creator.py diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/critic.yaml b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/critic.yaml index 0a18fc127..36d85285a 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/critic.yaml +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/critic.yaml @@ -8,11 +8,11 @@ build: dockerfile: Dockerfile build_args: AGENT_FILE: critic.py - PORT: 8002 + PORT: 8720 local_development: agent: - port: 8002 + port: 8720 host_address: host.docker.internal paths: acp: project/critic.py diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/formatter.yaml b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/formatter.yaml index 9c69b74c6..3303ed827 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/formatter.yaml +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/formatter.yaml @@ -8,11 +8,11 @@ build: dockerfile: Dockerfile build_args: AGENT_FILE: formatter.py - PORT: 8003 + PORT: 8721 local_development: agent: - port: 8003 + port: 8721 host_address: host.docker.internal paths: acp: project/formatter.py diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/orchestrator.yaml b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/orchestrator.yaml index 079329fd0..241f92d38 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/orchestrator.yaml +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/orchestrator.yaml @@ -8,11 +8,11 @@ build: dockerfile: Dockerfile build_args: AGENT_FILE: orchestrator.py - PORT: 8000 + PORT: 8718 local_development: agent: - port: 8000 + port: 8718 host_address: host.docker.internal paths: acp: project/orchestrator.py diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/start-agents.sh b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/start-agents.sh index 783463635..f2f964020 100755 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/start-agents.sh +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/start-agents.sh @@ -12,10 +12,10 @@ BLUE='\033[0;34m' NC='\033[0m' # No Color # Configuration -ORCHESTRATOR_PORT=8000 -CREATOR_PORT=8001 -CRITIC_PORT=8002 -FORMATTER_PORT=8003 +ORCHESTRATOR_PORT=8718 +CREATOR_PORT=8719 +CRITIC_PORT=8720 +FORMATTER_PORT=8721 # Base directory BASE_DIR="examples/tutorials/10_async/00_base/090_multi_agent_non_temporal" @@ -199,7 +199,7 @@ test_system() { # Check if agents are responding on their ports echo -e "${YELLOW}🔍 Testing agent connectivity...${NC}" - ports=(8000 8001 8002 8003) + ports=(8718 8719 8720 8721) agents=("orchestrator" "creator" "critic" "formatter") all_responding=true @@ -223,10 +223,10 @@ test_system() { echo " 3. Use direct HTTP calls to test individual agents" echo "" echo -e "${BLUE}🔗 Agent Endpoints:${NC}" - echo " • Orchestrator: http://localhost:8000" - echo " • Creator: http://localhost:8001" - echo " • Critic: http://localhost:8002" - echo " • Formatter: http://localhost:8003" + echo " • Orchestrator: http://localhost:8718" + echo " • Creator: http://localhost:8719" + echo " • Critic: http://localhost:8720" + echo " • Formatter: http://localhost:8721" echo "" echo -e "${BLUE}📝 Sample Request (send via AgentEx UI):${NC}" echo '{"request": "Write a brief welcome message for our new AI assistant", "rules": ["Under 100 words", "Friendly tone", "Include emoji"], "target_format": "HTML"}' @@ -262,10 +262,10 @@ case "${1:-start}" in echo " $0 stop - Stop all agents" echo "" echo -e "${BLUE}📤 Agent Endpoints:${NC}" - echo " • Orchestrator: http://localhost:8000" - echo " • Creator: http://localhost:8001" - echo " • Critic: http://localhost:8002" - echo " • Formatter: http://localhost:8003" + echo " • Orchestrator: http://localhost:8718" + echo " • Creator: http://localhost:8719" + echo " • Critic: http://localhost:8720" + echo " • Formatter: http://localhost:8721" echo "" echo -e "${BLUE}💡 To interact with agents:${NC}" echo " 1. Use the AgentEx platform to send tasks" diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/tests/test_agent.py b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/tests/test_agent.py index 8af941a81..637aab501 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab090-orchestrator-agent) """ @@ -31,7 +31,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab090-orchestrator-agent") diff --git a/examples/tutorials/10_async/00_base/100_langgraph/Dockerfile b/examples/tutorials/10_async/00_base/100_langgraph/Dockerfile index c2e4b464c..24424c526 100644 --- a/examples/tutorials/10_async/00_base/100_langgraph/Dockerfile +++ b/examples/tutorials/10_async/00_base/100_langgraph/Dockerfile @@ -47,4 +47,4 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=ab100-langgraph # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] diff --git a/examples/tutorials/10_async/00_base/100_langgraph/manifest.yaml b/examples/tutorials/10_async/00_base/100_langgraph/manifest.yaml index 1b0b5d490..66a3eea78 100644 --- a/examples/tutorials/10_async/00_base/100_langgraph/manifest.yaml +++ b/examples/tutorials/10_async/00_base/100_langgraph/manifest.yaml @@ -9,7 +9,7 @@ build: local_development: agent: - port: 8000 + port: 8718 host_address: host.docker.internal paths: acp: project/acp.py diff --git a/examples/tutorials/10_async/00_base/100_langgraph/tests/test_agent.py b/examples/tutorials/10_async/00_base/100_langgraph/tests/test_agent.py index 948db1558..0e00692ba 100644 --- a/examples/tutorials/10_async/00_base/100_langgraph/tests/test_agent.py +++ b/examples/tutorials/10_async/00_base/100_langgraph/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: ab100-langgraph) """ @@ -26,7 +26,7 @@ from agentex.lib.sdk.fastacp.base.base_acp_server import uuid # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "ab100-langgraph") diff --git a/examples/tutorials/10_async/10_temporal/000_hello_acp/Dockerfile b/examples/tutorials/10_async/10_temporal/000_hello_acp/Dockerfile index e739eb4a8..451a40c19 100644 --- a/examples/tutorials/10_async/10_temporal/000_hello_acp/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/000_hello_acp/Dockerfile @@ -53,7 +53,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at000-hello-acp # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_async/10_temporal/000_hello_acp/dev.ipynb b/examples/tutorials/10_async/10_temporal/000_hello_acp/dev.ipynb index f8a66a0ff..8d4a47490 100644 --- a/examples/tutorials/10_async/10_temporal/000_hello_acp/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/000_hello_acp/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/000_hello_acp/manifest.yaml b/examples/tutorials/10_async/10_temporal/000_hello_acp/manifest.yaml index e93fe8eca..a297b3d76 100644 --- a/examples/tutorials/10_async/10_temporal/000_hello_acp/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/000_hello_acp/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/000_hello_acp/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/000_hello_acp/tests/test_agent.py index 65204ac36..cb0608291 100644 --- a/examples/tutorials/10_async/10_temporal/000_hello_acp/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/000_hello_acp/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: at000-hello-acp) """ @@ -34,7 +34,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at000-hello-acp") diff --git a/examples/tutorials/10_async/10_temporal/010_agent_chat/Dockerfile b/examples/tutorials/10_async/10_temporal/010_agent_chat/Dockerfile index 5ecf911b0..2406edc21 100644 --- a/examples/tutorials/10_async/10_temporal/010_agent_chat/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/010_agent_chat/Dockerfile @@ -53,7 +53,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at010-agent-chat # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_async/10_temporal/010_agent_chat/dev.ipynb b/examples/tutorials/10_async/10_temporal/010_agent_chat/dev.ipynb index 3cb9b822e..e8276d2c6 100644 --- a/examples/tutorials/10_async/10_temporal/010_agent_chat/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/010_agent_chat/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/010_agent_chat/manifest.yaml b/examples/tutorials/10_async/10_temporal/010_agent_chat/manifest.yaml index 1d53a7c2b..52968507e 100644 --- a/examples/tutorials/10_async/10_temporal/010_agent_chat/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/010_agent_chat/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/010_agent_chat/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/010_agent_chat/tests/test_agent.py index acbb88754..a61cca39f 100644 --- a/examples/tutorials/10_async/10_temporal/010_agent_chat/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/010_agent_chat/tests/test_agent.py @@ -20,7 +20,7 @@ 4. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: at010-agent-chat) """ @@ -42,7 +42,7 @@ from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at010-agent-chat") diff --git a/examples/tutorials/10_async/10_temporal/020_state_machine/Dockerfile b/examples/tutorials/10_async/10_temporal/020_state_machine/Dockerfile index 59051b4b8..83ed2302d 100644 --- a/examples/tutorials/10_async/10_temporal/020_state_machine/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/020_state_machine/Dockerfile @@ -54,7 +54,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at020-state-machine # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/10_async/10_temporal/020_state_machine/dev.ipynb b/examples/tutorials/10_async/10_temporal/020_state_machine/dev.ipynb index 8f9f4dff1..4e302e470 100644 --- a/examples/tutorials/10_async/10_temporal/020_state_machine/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/020_state_machine/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/020_state_machine/manifest.yaml b/examples/tutorials/10_async/10_temporal/020_state_machine/manifest.yaml index 8b2bca147..b90ba0188 100644 --- a/examples/tutorials/10_async/10_temporal/020_state_machine/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/020_state_machine/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/020_state_machine/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/020_state_machine/tests/test_agent.py index fac8605aa..0ab9cf25b 100644 --- a/examples/tutorials/10_async/10_temporal/020_state_machine/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/020_state_machine/tests/test_agent.py @@ -20,7 +20,7 @@ 4. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: at020-state-machine) """ @@ -41,7 +41,7 @@ from agentex.types.tool_request_content import ToolRequestContent # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at020-state-machine") diff --git a/examples/tutorials/10_async/10_temporal/030_custom_activities/Dockerfile b/examples/tutorials/10_async/10_temporal/030_custom_activities/Dockerfile index 752ad8e93..1c507dc23 100644 --- a/examples/tutorials/10_async/10_temporal/030_custom_activities/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/030_custom_activities/Dockerfile @@ -53,7 +53,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at030-custom-activities # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_async/10_temporal/030_custom_activities/dev.ipynb b/examples/tutorials/10_async/10_temporal/030_custom_activities/dev.ipynb index b08063696..79afca087 100644 --- a/examples/tutorials/10_async/10_temporal/030_custom_activities/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/030_custom_activities/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/030_custom_activities/manifest.yaml b/examples/tutorials/10_async/10_temporal/030_custom_activities/manifest.yaml index 40af196f1..94d32d2b7 100644 --- a/examples/tutorials/10_async/10_temporal/030_custom_activities/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/030_custom_activities/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/030_custom_activities/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/030_custom_activities/tests/test_agent.py index b839332c7..405f72abc 100644 --- a/examples/tutorials/10_async/10_temporal/030_custom_activities/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/030_custom_activities/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: at030-custom-activities) """ @@ -23,7 +23,7 @@ from agentex import AsyncAgentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at030-custom-activities") diff --git a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/Dockerfile b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/Dockerfile index ef1ea0bf6..3da6ef361 100644 --- a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/Dockerfile @@ -53,7 +53,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at050-agent-chat-guardrails # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/dev.ipynb b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/dev.ipynb index ab87b676d..991182b94 100644 --- a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/manifest.yaml b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/manifest.yaml index 3fe94a001..54570405a 100644 --- a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/tests/test_agent.py index 1b1f7a400..99867e02a 100644 --- a/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/050_agent_chat_guardrails/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: at050-agent-chat-guardrails) """ @@ -23,7 +23,7 @@ from agentex import AsyncAgentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at050-agent-chat-guardrails") diff --git a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/Dockerfile b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/Dockerfile index d38075e55..dc61b587c 100644 --- a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/Dockerfile @@ -56,7 +56,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at060-open-ai-agents-sdk-hello-world # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/dev.ipynb b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/dev.ipynb index ae143b89f..be292293c 100644 --- a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/manifest.yaml b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/manifest.yaml index b339542d5..873d90fba 100644 --- a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/tests/test_agent.py index 73cf60db9..08efd16f0 100644 --- a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: example-tutorial) """ @@ -30,7 +30,7 @@ from agentex.types.agent_rpc_params import ParamsCreateTaskRequest # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at060-open-ai-agents-sdk-hello-world") diff --git a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/Dockerfile b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/Dockerfile index d4b343603..2ec0a2237 100644 --- a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/Dockerfile @@ -57,7 +57,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at070-open-ai-agents-sdk-tools # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/dev.ipynb b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/dev.ipynb index bcfc7182e..49bd916b5 100644 --- a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/manifest.yaml b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/manifest.yaml index d28da57b6..0dfa41098 100644 --- a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/manifest.yaml @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/tests/test_agent.py index 8bf59cafc..8ce073a5a 100644 --- a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/tests/test_agent.py @@ -11,7 +11,7 @@ 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: example-tutorial) """ @@ -30,7 +30,7 @@ from agentex.types.agent_rpc_params import ParamsCreateTaskRequest # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at070-open-ai-agents-sdk-tools") diff --git a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/Dockerfile b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/Dockerfile index cc4c06bf6..492d5b3d7 100644 --- a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/Dockerfile @@ -56,7 +56,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at080-open-ai-agents-sdk-human-in-the-loop # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/dev.ipynb b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/dev.ipynb index 3e93e183c..f6435c698 100644 --- a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/dev.ipynb +++ b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/dev.ipynb @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/manifest.yaml b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/manifest.yaml index f6fc7e9ca..d83156de0 100644 --- a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/manifest.yaml @@ -41,7 +41,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/tests/test_agent.py index 3377c1ea8..d9b62cf89 100644 --- a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/tests/test_agent.py @@ -14,7 +14,7 @@ 4. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: example-tutorial) - TEMPORAL_ADDRESS: Temporal server address (default: localhost:7233) """ @@ -38,7 +38,7 @@ from agentex.types.agent_rpc_params import ParamsCreateTaskRequest # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "at080-open-ai-agents-sdk-human-in-the-loop") TEMPORAL_ADDRESS = os.environ.get("TEMPORAL_ADDRESS", "localhost:7233") diff --git a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/Dockerfile b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/Dockerfile index 5428e814a..faee5abc9 100644 --- a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/Dockerfile @@ -56,7 +56,7 @@ ENV PYTHONPATH=/app # Set test environment variables ENV AGENT_NAME=at090-claude-agents-sdk-mvp # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/manifest.yaml b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/manifest.yaml index 2c1ce21dd..5eef58687 100644 --- a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/manifest.yaml +++ b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/manifest.yaml @@ -27,7 +27,7 @@ build: # Local Development Configuration local_development: agent: - port: 8000 + port: 8718 host_address: host.docker.internal paths: acp: project/acp.py diff --git a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/tests/test_agent.py b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/tests/test_agent.py index 9b93b1b76..0dbc7a67d 100644 --- a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/tests/test_agent.py +++ b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/tests/test_agent.py @@ -17,7 +17,7 @@ # from agentex.types.text_content_param import TextContentParam # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "claude-mvp-agent") diff --git a/examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile b/examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile index b1b52a9a7..c4729b900 100644 --- a/examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile +++ b/examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile @@ -48,7 +48,7 @@ ENV PYTHONPATH=/app ENV AGENT_NAME=at100-gemini-litellm # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] diff --git a/examples/tutorials/TEST_RUNNER_README.md b/examples/tutorials/TEST_RUNNER_README.md index de8fcf66b..01ba5d52f 100644 --- a/examples/tutorials/TEST_RUNNER_README.md +++ b/examples/tutorials/TEST_RUNNER_README.md @@ -28,14 +28,14 @@ python run_tutorial_test.py 10_async/00_base/010_multiturn python run_tutorial_test.py 10_async/00_base/020_streaming # Test with custom base URL -python run_tutorial_test.py 10_async/00_base/000_hello_acp --base-url http://localhost:5003 +python run_tutorial_test.py 10_async/00_base/000_hello_acp --base-url http://localhost:5718 ``` ## What the Script Does 1. **Validates Paths**: Checks that the tutorial directory, manifest.yaml, and tests directory exist 2. **Starts Agent**: Runs `uv run agentex agents run --manifest manifest.yaml` in the tutorial directory -3. **Health Check**: Polls the agent's health endpoint (default: http://localhost:5003/health) until it's live +3. **Health Check**: Polls the agent's health endpoint (default: http://localhost:5718/health) until it's live 4. **Runs Tests**: Executes `uv run pytest tests/ -v --tb=short` in the tutorial directory 5. **Cleanup**: Gracefully stops the agent process (or kills it if necessary) @@ -47,7 +47,7 @@ positional arguments: optional arguments: -h, --help Show help message and exit - --base-url BASE_URL Base URL for the AgentEx server (default: http://localhost:5003) + --base-url BASE_URL Base URL for the AgentEx server (default: http://localhost:5718) ``` ## Exit Codes @@ -69,7 +69,7 @@ AgentEx Tutorial Test Runner 📁 Working directory: 10_async/00_base/000_hello_acp ✅ Agent process started (PID: 12345) -🔍 Checking agent health at http://localhost:5003/health... +🔍 Checking agent health at http://localhost:5718/health... ⏳ Waiting for agent... (attempt 1/30) ⏳ Waiting for agent... (attempt 2/30) ✅ Agent is live! (attempt 3/30) @@ -99,7 +99,7 @@ AgentEx Tutorial Test Runner ### Agent doesn't become live If the health check times out: -- Check that port 5003 is not already in use +- Check that port 5718 is not already in use - Look at the agent logs to see if there are startup errors - Try increasing the timeout by modifying the `max_attempts` parameter in the script diff --git a/src/agentex/_client.py b/src/agentex/_client.py index f3eeeb819..d1f368f4e 100644 --- a/src/agentex/_client.py +++ b/src/agentex/_client.py @@ -54,8 +54,8 @@ ] ENVIRONMENTS: Dict[str, str] = { - "production": "http://localhost:5003", - "development": "http://localhost:5003", + "production": "http://localhost:5718", + "development": "http://localhost:5718", } diff --git a/src/agentex/lib/cli/templates/default-langgraph/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/default-langgraph/Dockerfile-uv.j2 index 2ac5be7d2..71b8ff692 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/Dockerfile-uv.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default-langgraph/Dockerfile.j2 b/src/agentex/lib/cli/templates/default-langgraph/Dockerfile.j2 index 0395caf74..bbfa44d85 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/Dockerfile.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default-langgraph/dev.ipynb.j2 b/src/agentex/lib/cli/templates/default-langgraph/dev.ipynb.j2 index d3a68303f..e88e88b41 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/default-langgraph/manifest.yaml.j2 b/src/agentex/lib/cli/templates/default-langgraph/manifest.yaml.j2 index a614bdcd1..d2f051abc 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/src/agentex/lib/cli/templates/default-langgraph/test_agent.py.j2 b/src/agentex/lib/cli/templates/default-langgraph/test_agent.py.j2 index ee71f177c..11c07eaa8 100644 --- a/src/agentex/lib/cli/templates/default-langgraph/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/default-langgraph/test_agent.py.j2 @@ -11,7 +11,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -34,7 +34,7 @@ from test_utils.async_utils import ( # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 index 2ac5be7d2..71b8ff692 100644 --- a/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default/Dockerfile.j2 b/src/agentex/lib/cli/templates/default/Dockerfile.j2 index 0395caf74..bbfa44d85 100644 --- a/src/agentex/lib/cli/templates/default/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/default/Dockerfile.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default/README.md.j2 b/src/agentex/lib/cli/templates/default/README.md.j2 index 0b5317dec..fcbd48d4b 100644 --- a/src/agentex/lib/cli/templates/default/README.md.j2 +++ b/src/agentex/lib/cli/templates/default/README.md.j2 @@ -19,7 +19,7 @@ This is a generic starter template for building agents with the AgentEx framewor agentex agents run --manifest manifest.yaml ``` -The agent will start on port 8000 and print messages whenever it receives any of the ACP events. +The agent will start on port 8718 and print messages whenever it receives any of the ACP events. ## What's Inside diff --git a/src/agentex/lib/cli/templates/default/dev.ipynb.j2 b/src/agentex/lib/cli/templates/default/dev.ipynb.j2 index d3a68303f..e88e88b41 100644 --- a/src/agentex/lib/cli/templates/default/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/default/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/default/manifest.yaml.j2 b/src/agentex/lib/cli/templates/default/manifest.yaml.j2 index 184060976..aca5f3c86 100644 --- a/src/agentex/lib/cli/templates/default/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/default/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/src/agentex/lib/cli/templates/default/test_agent.py.j2 b/src/agentex/lib/cli/templates/default/test_agent.py.j2 index ee71f177c..11c07eaa8 100644 --- a/src/agentex/lib/cli/templates/default/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/default/test_agent.py.j2 @@ -11,7 +11,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -34,7 +34,7 @@ from test_utils.async_utils import ( # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile-uv.j2 index 2ac5be7d2..71b8ff692 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile-uv.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile.j2 b/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile.j2 index 4d9f41d45..e65d6bfce 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/Dockerfile.j2 @@ -40,4 +40,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync-langgraph/dev.ipynb.j2 b/src/agentex/lib/cli/templates/sync-langgraph/dev.ipynb.j2 index d8c10a65a..37b6f0291 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/sync-langgraph/manifest.yaml.j2 b/src/agentex/lib/cli/templates/sync-langgraph/manifest.yaml.j2 index ae62f3033..f6476e054 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/src/agentex/lib/cli/templates/sync-langgraph/test_agent.py.j2 b/src/agentex/lib/cli/templates/sync-langgraph/test_agent.py.j2 index 7de4684f4..b3d01813a 100644 --- a/src/agentex/lib/cli/templates/sync-langgraph/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/sync-langgraph/test_agent.py.j2 @@ -12,7 +12,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -22,7 +22,7 @@ from agentex import Agentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile-uv.j2 index 2ac5be7d2..71b8ff692 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile-uv.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile.j2 index 4d9f41d45..e65d6bfce 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/Dockerfile.j2 @@ -40,4 +40,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/README.md.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/README.md.j2 index b2105705e..3ea9646d4 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/README.md.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/README.md.j2 @@ -16,7 +16,7 @@ This is a starter template for building synchronous agents with the AgentEx fram agentex agents run --manifest manifest.yaml ``` -The agent will start on port 8000 and respond immediately to any messages it receives. +The agent will start on port 8718 and respond immediately to any messages it receives. ## What's Inside @@ -289,7 +289,7 @@ pip install -r requirements.txt ### Common Issues 1. **Agent not appearing in web UI** - - Check if agent is running on port 8000 + - Check if agent is running on port 8718 - Verify `ENVIRONMENT=development` is set - Check agent logs for errors @@ -307,7 +307,7 @@ pip install -r requirements.txt {% endif %} 4. **Port conflicts** - - Check if another service is using port 8000 - - Use `lsof -i :8000` to find conflicting processes + - Check if another service is using port 8718 + - Use `lsof -i :8718` to find conflicting processes Happy building with Sync ACP! 🚀⚡ \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/dev.ipynb.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/dev.ipynb.j2 index d8c10a65a..37b6f0291 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/manifest.yaml.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/manifest.yaml.j2 index b006c6175..860fd025c 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/src/agentex/lib/cli/templates/sync-openai-agents/test_agent.py.j2 b/src/agentex/lib/cli/templates/sync-openai-agents/test_agent.py.j2 index 7de4684f4..b3d01813a 100644 --- a/src/agentex/lib/cli/templates/sync-openai-agents/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/sync-openai-agents/test_agent.py.j2 @@ -12,7 +12,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -22,7 +22,7 @@ from agentex import Agentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 index 2ac5be7d2..71b8ff692 100644 --- a/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 @@ -39,4 +39,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync/Dockerfile.j2 b/src/agentex/lib/cli/templates/sync/Dockerfile.j2 index 4d9f41d45..e65d6bfce 100644 --- a/src/agentex/lib/cli/templates/sync/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/sync/Dockerfile.j2 @@ -40,4 +40,4 @@ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_ ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync/README.md.j2 b/src/agentex/lib/cli/templates/sync/README.md.j2 index b2105705e..3ea9646d4 100644 --- a/src/agentex/lib/cli/templates/sync/README.md.j2 +++ b/src/agentex/lib/cli/templates/sync/README.md.j2 @@ -16,7 +16,7 @@ This is a starter template for building synchronous agents with the AgentEx fram agentex agents run --manifest manifest.yaml ``` -The agent will start on port 8000 and respond immediately to any messages it receives. +The agent will start on port 8718 and respond immediately to any messages it receives. ## What's Inside @@ -289,7 +289,7 @@ pip install -r requirements.txt ### Common Issues 1. **Agent not appearing in web UI** - - Check if agent is running on port 8000 + - Check if agent is running on port 8718 - Verify `ENVIRONMENT=development` is set - Check agent logs for errors @@ -307,7 +307,7 @@ pip install -r requirements.txt {% endif %} 4. **Port conflicts** - - Check if another service is using port 8000 - - Use `lsof -i :8000` to find conflicting processes + - Check if another service is using port 8718 + - Use `lsof -i :8718` to find conflicting processes Happy building with Sync ACP! 🚀⚡ \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync/dev.ipynb.j2 b/src/agentex/lib/cli/templates/sync/dev.ipynb.j2 index d8c10a65a..37b6f0291 100644 --- a/src/agentex/lib/cli/templates/sync/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/sync/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 b/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 index b006c6175..860fd025c 100644 --- a/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) diff --git a/src/agentex/lib/cli/templates/sync/test_agent.py.j2 b/src/agentex/lib/cli/templates/sync/test_agent.py.j2 index 7de4684f4..b3d01813a 100644 --- a/src/agentex/lib/cli/templates/sync/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/sync/test_agent.py.j2 @@ -12,7 +12,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -22,7 +22,7 @@ from agentex import Agentex # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile-uv.j2 index 81dd9c5b6..fc39690de 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile-uv.j2 @@ -42,7 +42,7 @@ RUN uv pip install --system . COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile.j2 index 4c1798c42..3f095ac4b 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/Dockerfile.j2 @@ -42,7 +42,7 @@ RUN uv pip install --system -r requirements.txt COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/README.md.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/README.md.j2 index 071fc24ba..c956b3509 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/README.md.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/README.md.j2 @@ -24,7 +24,7 @@ This is a starter template for building AI agents with the AgentEx framework, Te agentex agents run --manifest manifest.yaml ``` -The agent will start on port 8000 and be ready to handle conversations. +The agent will start on port 8718 and be ready to handle conversations. ## Project Structure @@ -202,7 +202,7 @@ SGP_ACCOUNT_ID=your-account-id # Optional: for tracing ### Common Issues 1. **Agent not responding** - - Check if agent is running on port 8000 + - Check if agent is running on port 8718 - Verify `ENVIRONMENT=development` is set - Check logs for errors diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/dev.ipynb.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/dev.ipynb.j2 index d3a68303f..e88e88b41 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 index a6433ce7d..dd33aca39 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) @@ -90,8 +90,8 @@ agent: queue_name: {{ queue_name }} # Optional: Health check port for temporal worker - # Defaults to 80 if not specified - # health_check_port: 80 + # Defaults to 8080 if not specified + # health_check_port: 8080 # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/test_agent.py.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/test_agent.py.j2 index ee71f177c..11c07eaa8 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/test_agent.py.j2 @@ -11,7 +11,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -34,7 +34,7 @@ from test_utils.async_utils import ( # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 index 81dd9c5b6..fc39690de 100644 --- a/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 @@ -42,7 +42,7 @@ RUN uv pip install --system . COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 b/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 index 4c1798c42..3f095ac4b 100644 --- a/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 @@ -42,7 +42,7 @@ RUN uv pip install --system -r requirements.txt COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project # Run the ACP server using uvicorn -CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8718"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal/README.md.j2 b/src/agentex/lib/cli/templates/temporal/README.md.j2 index 7dc8a7dc1..0f1a705f4 100644 --- a/src/agentex/lib/cli/templates/temporal/README.md.j2 +++ b/src/agentex/lib/cli/templates/temporal/README.md.j2 @@ -20,7 +20,7 @@ This is a starter template for building asynchronous agents with the AgentEx fra agentex agents run --manifest manifest.yaml ``` -The agent will start on port 8000 and print messages whenever it receives any of the ACP events. +The agent will start on port 8718 and print messages whenever it receives any of the ACP events. ## What's Inside @@ -315,7 +315,7 @@ pip install -r requirements.txt ### Common Issues 1. **Agent not appearing in web UI** - - Check if agent is running on port 8000 + - Check if agent is running on port 8718 - Verify `ENVIRONMENT=development` is set - Check agent logs for errors @@ -335,8 +335,8 @@ pip install -r requirements.txt {% endif %} 4. **Port conflicts** - - Check if another service is using port 8000 - - Use `lsof -i :8000` to find conflicting processes + - Check if another service is using port 8718 + - Use `lsof -i :8718` to find conflicting processes ### Temporal-Specific Troubleshooting diff --git a/src/agentex/lib/cli/templates/temporal/dev.ipynb.j2 b/src/agentex/lib/cli/templates/temporal/dev.ipynb.j2 index d3a68303f..e88e88b41 100644 --- a/src/agentex/lib/cli/templates/temporal/dev.ipynb.j2 +++ b/src/agentex/lib/cli/templates/temporal/dev.ipynb.j2 @@ -9,7 +9,7 @@ "source": [ "from agentex import Agentex\n", "\n", - "client = Agentex(base_url=\"http://localhost:5003\")" + "client = Agentex(base_url=\"http://localhost:5718\")" ] }, { diff --git a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 index a6433ce7d..dd33aca39 100644 --- a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 @@ -40,7 +40,7 @@ build: # Only used when running the agent locally local_development: agent: - port: 8000 # Port where your local ACP server is running + port: 8718 # Port where your local ACP server is running host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct) # File paths for local development (relative to this manifest.yaml) @@ -90,8 +90,8 @@ agent: queue_name: {{ queue_name }} # Optional: Health check port for temporal worker - # Defaults to 80 if not specified - # health_check_port: 80 + # Defaults to 8080 if not specified + # health_check_port: 8080 # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables diff --git a/src/agentex/lib/cli/templates/temporal/test_agent.py.j2 b/src/agentex/lib/cli/templates/temporal/test_agent.py.j2 index ee71f177c..11c07eaa8 100644 --- a/src/agentex/lib/cli/templates/temporal/test_agent.py.j2 +++ b/src/agentex/lib/cli/templates/temporal/test_agent.py.j2 @@ -11,7 +11,7 @@ To run these tests: 3. Run: pytest test_agent.py -v Configuration: -- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) +- AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5718) - AGENT_NAME: Name of the agent to test (default: {{ agent_name }}) """ @@ -34,7 +34,7 @@ from test_utils.async_utils import ( # Configuration from environment variables -AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003") +AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5718") AGENT_NAME = os.environ.get("AGENT_NAME", "{{ agent_name }}") diff --git a/src/agentex/lib/constants/__init__.py b/src/agentex/lib/constants/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/agentex/lib/constants/ports.py b/src/agentex/lib/constants/ports.py new file mode 100644 index 000000000..cc83257fe --- /dev/null +++ b/src/agentex/lib/constants/ports.py @@ -0,0 +1,15 @@ +""" +Centralized port defaults for AgentEx. + +These ports are chosen to avoid conflicts with common services (3000, 5003, 8000, 80). +All ports remain configurable via environment variables and manifest configuration. +""" + +# AgentEx API server default port (configurable via AGENTEX_BASE_URL env var) +AGENTEX_API_PORT = 5718 + +# ACP (Agent Communication Protocol) server default port (configurable via ACP_PORT env var) +ACP_SERVER_PORT = 8718 + +# Health check endpoint default port (configurable via HEALTH_CHECK_PORT env var) +HEALTH_CHECK_PORT = 8080 diff --git a/src/agentex/lib/core/temporal/plugins/openai_agents/tests/conftest.py b/src/agentex/lib/core/temporal/plugins/openai_agents/tests/conftest.py index 599cb1e36..7a4220900 100644 --- a/src/agentex/lib/core/temporal/plugins/openai_agents/tests/conftest.py +++ b/src/agentex/lib/core/temporal/plugins/openai_agents/tests/conftest.py @@ -62,7 +62,7 @@ def mock_streaming_context(): @pytest.fixture(autouse=True) def mock_adk_streaming(): """Mock the ADK streaming module""" - with patch('agentex.lib.adk.streaming') as mock_streaming: + with patch("agentex.lib.adk.streaming") as mock_streaming: mock_context = AsyncMock() mock_context.task_message = MagicMock() mock_context.stream_update = AsyncMock() @@ -77,40 +77,29 @@ def mock_adk_streaming(): @pytest.fixture def sample_function_tool(): """Sample FunctionTool for testing""" + async def mock_tool_handler(_context, _args): return {"temperature": "72F", "condition": "sunny"} return FunctionTool( name="get_weather", description="Get the current weather", - params_json_schema={ - "type": "object", - "properties": { - "location": {"type": "string"} - } - }, + params_json_schema={"type": "object", "properties": {"location": {"type": "string"}}}, on_invoke_tool=mock_tool_handler, - strict_json_schema=False + strict_json_schema=False, ) @pytest.fixture def sample_web_search_tool(): """Sample WebSearchTool for testing""" - return WebSearchTool( - user_location=None, - search_context_size="medium" - ) + return WebSearchTool(user_location=None, search_context_size="medium") @pytest.fixture def sample_file_search_tool(): """Sample FileSearchTool for testing""" - return FileSearchTool( - vector_store_ids=["vs_123"], - max_num_results=10, - include_search_results=True - ) + return FileSearchTool(vector_store_ids=["vs_123"], max_num_results=10, include_search_results=True) @pytest.fixture @@ -126,11 +115,7 @@ def sample_computer_tool(): def sample_hosted_mcp_tool(): """Sample HostedMCPTool for testing""" tool = MagicMock(spec=HostedMCPTool) - tool.tool_config = { - "type": "mcp", - "server_label": "test_server", - "name": "test_tool" - } + tool.tool_config = {"type": "mcp", "server_label": "test_server", "name": "test_tool"} return tool @@ -138,10 +123,7 @@ def sample_hosted_mcp_tool(): def sample_image_generation_tool(): """Sample ImageGenerationTool for testing""" tool = MagicMock(spec=ImageGenerationTool) - tool.tool_config = { - "type": "image_generation", - "model": "dall-e-3" - } + tool.tool_config = {"type": "image_generation", "model": "dall-e-3"} return tool @@ -149,9 +131,7 @@ def sample_image_generation_tool(): def sample_code_interpreter_tool(): """Sample CodeInterpreterTool for testing""" tool = MagicMock(spec=CodeInterpreterTool) - tool.tool_config = { - "type": "code_interpreter" - } + tool.tool_config = {"type": "code_interpreter"} return tool @@ -159,6 +139,7 @@ def sample_code_interpreter_tool(): def sample_local_shell_tool(): """Sample LocalShellTool for testing""" from agents import LocalShellExecutor + executor = MagicMock(spec=LocalShellExecutor) return LocalShellTool(executor=executor) @@ -177,60 +158,42 @@ async def mock_handoff_handler(_context, _args): tool_name="transfer_to_support", tool_description="Transfer to support agent", input_json_schema={"type": "object"}, - on_invoke_handoff=mock_handoff_handler + on_invoke_handoff=mock_handoff_handler, ) @pytest.fixture def basic_model_settings(): """Basic ModelSettings for testing""" - return ModelSettings( - temperature=0.7, - max_tokens=1000, - top_p=0.9 - ) + return ModelSettings(temperature=0.7, max_tokens=1000, top_p=0.9) @pytest.fixture def reasoning_model_settings(): """ModelSettings with reasoning enabled""" - return ModelSettings( - reasoning=Reasoning( - effort="medium", - generate_summary="auto" - ) - ) + return ModelSettings(reasoning=Reasoning(effort="medium", generate_summary="auto")) @pytest.fixture def mock_response_stream(): """Mock a response stream with basic events""" + async def stream_generator(): # Yield some basic events yield ResponseOutputItemAddedEvent( # type: ignore[call-arg] - type="response.output_item.added", - output_index=0, - item=MagicMock(type="message") + type="response.output_item.added", output_index=0, item=MagicMock(type="message") ) yield ResponseTextDeltaEvent( # type: ignore[call-arg] - type="response.text.delta", - delta="Hello ", - output_index=0 + type="response.text.delta", delta="Hello ", output_index=0 ) yield ResponseTextDeltaEvent( # type: ignore[call-arg] - type="response.text.delta", - delta="world!", - output_index=0 + type="response.text.delta", delta="world!", output_index=0 ) yield ResponseCompletedEvent( # type: ignore[call-arg] - type="response.completed", - response=MagicMock( - output=[], - usage=MagicMock() - ) + type="response.completed", response=MagicMock(output=[], usage=MagicMock()) ) return stream_generator() @@ -239,28 +202,21 @@ async def stream_generator(): @pytest.fixture def mock_reasoning_stream(): """Mock a response stream with reasoning events""" + async def stream_generator(): # Start reasoning yield ResponseOutputItemAddedEvent( # type: ignore[call-arg] - type="response.output_item.added", - output_index=0, - item=MagicMock(type="reasoning") + type="response.output_item.added", output_index=0, item=MagicMock(type="reasoning") ) # Reasoning deltas yield ResponseReasoningSummaryTextDeltaEvent( # type: ignore[call-arg] - type="response.reasoning_summary_text.delta", - delta="Let me think about this...", - summary_index=0 + type="response.reasoning_summary_text.delta", delta="Let me think about this...", summary_index=0 ) # Complete yield ResponseCompletedEvent( # type: ignore[call-arg] - type="response.completed", - response=MagicMock( - output=[], - usage=MagicMock() - ) + type="response.completed", response=MagicMock(output=[], usage=MagicMock()) ) return stream_generator() @@ -279,7 +235,7 @@ async def streaming_model(): yield model # Cleanup after each test - if hasattr(model.client, 'close'): + if hasattr(model.client, "close"): await model.client.close() @@ -290,8 +246,8 @@ def mock_env_vars(): env_vars = { "OPENAI_API_KEY": "test-key-123", "AGENT_NAME": "test-agent", - "ACP_URL": "http://localhost:8000", + "ACP_URL": "http://localhost:8718", } with patch.dict("os.environ", env_vars): - yield env_vars \ No newline at end of file + yield env_vars diff --git a/src/agentex/lib/sdk/fastacp/base/base_acp_server.py b/src/agentex/lib/sdk/fastacp/base/base_acp_server.py index b625eaa1c..f126da79f 100644 --- a/src/agentex/lib/sdk/fastacp/base/base_acp_server.py +++ b/src/agentex/lib/sdk/fastacp/base/base_acp_server.py @@ -139,7 +139,6 @@ async def _handle_jsonrpc(self, request: Request): error=JSONRPCError(code=-32601, message="Unauthorized"), ) - # Check if method is valid first try: method = RPCMethod(rpc_request.method) @@ -147,18 +146,14 @@ async def _handle_jsonrpc(self, request: Request): logger.error(f"Method {rpc_request.method} was invalid") return JSONRPCResponse( id=rpc_request.id, - error=JSONRPCError( - code=-32601, message=f"Method {rpc_request.method} not found" - ), + error=JSONRPCError(code=-32601, message=f"Method {rpc_request.method} not found"), ) if method not in self._handlers or self._handlers[method] is None: logger.error(f"Method {method} not found on existing ACP server") return JSONRPCResponse( id=rpc_request.id, - error=JSONRPCError( - code=-32601, message=f"Method {method} not found" - ), + error=JSONRPCError(code=-32601, message=f"Method {method} not found"), ) # Extract application headers using allowlist approach (only x-* headers) @@ -171,11 +166,11 @@ async def _handle_jsonrpc(self, request: Request): and key.lower() not in FASTACP_HEADER_SKIP_EXACT and not any(key.lower().startswith(p) for p in FASTACP_HEADER_SKIP_PREFIXES) } - + # Parse params into appropriate model based on method and include headers params_model = PARAMS_MODEL_BY_METHOD[method] params_data = dict(rpc_request.params) if rpc_request.params else {} - + # Add custom headers to the request structure if any headers were provided # Gateway sends filtered headers via HTTP, SDK extracts and populates params.request if custom_headers: @@ -191,12 +186,8 @@ async def _handle_jsonrpc(self, request: Request): return None else: # Handle streaming vs non-streaming for MESSAGE_SEND - if method == RPCMethod.MESSAGE_SEND and isinstance( - result, AsyncGenerator - ): - return await self._handle_streaming_response( - rpc_request.id, result - ) + if method == RPCMethod.MESSAGE_SEND and isinstance(result, AsyncGenerator): + return await self._handle_streaming_response(rpc_request.id, result) else: if isinstance(result, BaseModel): result = result.model_dump() @@ -208,14 +199,10 @@ async def _handle_jsonrpc(self, request: Request): return JSONRPCResponse(id=None) # For regular requests, start processing in background but return immediately - asyncio.create_task( - self._process_request(rpc_request.id, method, params) - ) + asyncio.create_task(self._process_request(rpc_request.id, method, params)) # Return immediate acknowledgment - return JSONRPCResponse( - id=rpc_request.id, result={"status": "processing"} - ) + return JSONRPCResponse(id=rpc_request.id, result={"status": "processing"}) except Exception as e: logger.error(f"Error handling JSON-RPC request: {e}", exc_info=True) @@ -227,9 +214,7 @@ async def _handle_jsonrpc(self, request: Request): error=JSONRPCError(code=-32603, message=str(e)).model_dump(), ) - async def _handle_streaming_response( - self, request_id: int | str, async_gen: AsyncGenerator - ): + async def _handle_streaming_response(self, request_id: int | str, async_gen: AsyncGenerator): """Handle streaming response by formatting TaskMessageUpdate objects as JSON-RPC stream""" async def generate_json_rpc_stream(): @@ -239,9 +224,7 @@ async def generate_json_rpc_stream(): # Validate using Pydantic's TypeAdapter to ensure it's a proper TaskMessageUpdate try: # This will validate that chunk conforms to the TaskMessageUpdate union type - validated_chunk = task_message_update_adapter.validate_python( - chunk - ) + validated_chunk = task_message_update_adapter.validate_python(chunk) # Use mode="json" to properly serialize datetime objects chunk_data = validated_chunk.model_dump(mode="json") except ValidationError as e: @@ -284,18 +267,14 @@ async def _process_notification(self, method: RPCMethod, params: Any): except Exception as e: logger.error(f"Error processing notification {method}: {e}", exc_info=True) - async def _process_request( - self, request_id: int | str, method: RPCMethod, params: Any - ): + async def _process_request(self, request_id: int | str, method: RPCMethod, params: Any): """Process a request in the background""" try: handler = self._handlers[method] await handler(params) # Note: In a real implementation, you might want to store the result somewhere # or notify the client through a different mechanism - logger.info( - f"Successfully processed request {request_id} for method {method}" - ) + logger.info(f"Successfully processed request {request_id} for method {method}") except Exception as e: logger.error( f"Error processing request {request_id} for method {method}: {e}", @@ -368,7 +347,7 @@ async def message_send_wrapper(params: SendMessageParams): # Check if the function is an async generator function # Regardless of whether the Agent developer implemented an Async generator or not, we will always turn the function into an async generator and yield SSE events back tot he Agentex server so there is only one way for it to process the response. Then, based on the client's desire to stream or not, the Agentex server will either yield back the async generator objects directly (if streaming) or aggregate the content into a list of TaskMessageContents and to dispatch to the client. This basically gives the Agentex server the flexibility to handle both cases itself. - + if inspect.isasyncgenfunction(fn): # The client wants streaming, an async generator already streams the content, so just return it return fn(params) @@ -380,7 +359,9 @@ async def message_send_wrapper(params: SendMessageParams): task_message_content_list = [] elif isinstance(task_message_content_response, list): # Filter out None values from lists - task_message_content_list = [content for content in task_message_content_response if content is not None] + task_message_content_list = [ + content for content in task_message_content_response if content is not None + ] else: task_message_content_list = [task_message_content_response] @@ -401,8 +382,6 @@ async def async_generator(task_message_content_list: list[TaskMessageContent]): ACP Server Lifecycle Methods """ - def run(self, host: str = "0.0.0.0", port: int = 8000, **kwargs): + def run(self, host: str = "0.0.0.0", port: int = 8718, **kwargs): """Start the Uvicorn server for async handlers.""" uvicorn.run(self, host=host, port=port, **kwargs) - - diff --git a/src/agentex/lib/sdk/fastacp/tests/conftest.py b/src/agentex/lib/sdk/fastacp/tests/conftest.py index 8941f16eb..56f1423d9 100644 --- a/src/agentex/lib/sdk/fastacp/tests/conftest.py +++ b/src/agentex/lib/sdk/fastacp/tests/conftest.py @@ -48,9 +48,7 @@ def free_port() -> int: @pytest.fixture def sample_task() -> Task: """Fixture that provides a sample Task object""" - return Task( - id="test-task-123", status="RUNNING" - ) + return Task(id="test-task-123", status="RUNNING") @pytest.fixture @@ -64,9 +62,7 @@ def sample_message_content() -> TaskMessageContent: @pytest.fixture -def sample_send_message_params( - sample_task: Task, sample_message_content: TaskMessageContent -) -> SendMessageParams: +def sample_send_message_params(sample_task: Task, sample_message_content: TaskMessageContent) -> SendMessageParams: """Fixture that provides sample SendMessageParams""" return SendMessageParams( agent=Agent( @@ -87,7 +83,14 @@ def sample_send_message_params( def sample_cancel_task_params() -> CancelTaskParams: """Fixture that provides sample CancelTaskParams""" return CancelTaskParams( - agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync", created_at="2023-01-01T00:00:00Z", updated_at="2023-01-01T00:00:00Z"), + agent=Agent( + id="test-agent-456", + name="test-agent", + description="test-agent", + acp_type="sync", + created_at="2023-01-01T00:00:00Z", + updated_at="2023-01-01T00:00:00Z", + ), task=Task(id="test-task-123", status="RUNNING"), ) @@ -96,7 +99,14 @@ def sample_cancel_task_params() -> CancelTaskParams: def sample_create_task_params(sample_task: Task) -> CreateTaskParams: """Fixture that provides sample CreateTaskParams""" return CreateTaskParams( - agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync", created_at="2023-01-01T00:00:00Z", updated_at="2023-01-01T00:00:00Z"), + agent=Agent( + id="test-agent-456", + name="test-agent", + description="test-agent", + acp_type="sync", + created_at="2023-01-01T00:00:00Z", + updated_at="2023-01-01T00:00:00Z", + ), task=sample_task, params={}, ) @@ -173,9 +183,7 @@ def create_runner(app: BaseACPServer, port: int) -> TestServerRunner: @pytest.fixture def base_acp_server(): """Fixture that provides a BaseACPServer instance for sync tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = BaseACPServer() return server @@ -183,9 +191,7 @@ def base_acp_server(): @pytest_asyncio.fixture async def async_base_acp_server(): """Fixture that provides a BaseACPServer instance for async tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = BaseACPServer.create() return server @@ -193,9 +199,7 @@ async def async_base_acp_server(): @pytest.fixture def sync_acp_server(): """Fixture that provides a SyncACP instance for sync tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = SyncACP() return server @@ -203,9 +207,7 @@ def sync_acp_server(): @pytest_asyncio.fixture async def async_sync_acp_server(): """Fixture that provides a SyncACP instance for async tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = SyncACP.create() return server @@ -213,9 +215,7 @@ async def async_sync_acp_server(): @pytest.fixture def agentic_base_acp_server(): """Fixture that provides an AgenticBaseACP instance for sync tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = AsyncBaseACP() return server @@ -223,9 +223,7 @@ def agentic_base_acp_server(): @pytest_asyncio.fixture async def async_agentic_base_acp_server(): """Fixture that provides an AsyncBaseACP instance for async tests""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration server = AsyncBaseACP.create() return server @@ -233,15 +231,9 @@ async def async_agentic_base_acp_server(): @pytest_asyncio.fixture async def mock_temporal_acp_server(): """Fixture that provides a mocked TemporalACP instance""" - with patch.dict( - "os.environ", {"AGENTEX_BASE_URL": ""} - ): # Disable agent registration - with patch( - "agentex.sdk.fastacp.impl.temporal_acp.TemporalClient" - ) as mock_temporal_client: - with patch( - "agentex.sdk.fastacp.impl.temporal_acp.AsyncAgentexClient" - ) as mock_agentex_client: + with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}): # Disable agent registration + with patch("agentex.sdk.fastacp.impl.temporal_acp.TemporalClient") as mock_temporal_client: + with patch("agentex.sdk.fastacp.impl.temporal_acp.AsyncAgentexClient") as mock_agentex_client: # Mock the temporal client creation mock_temporal_client.create.return_value = AsyncMock() mock_agentex_client.return_value = AsyncMock() @@ -270,9 +262,7 @@ async def call_method( ) return response.json() - async def send_notification( - self, method: str, params: dict[str, Any] - ) -> dict[str, Any]: + async def send_notification(self, method: str, params: dict[str, Any]) -> dict[str, Any]: """Send a JSON-RPC notification (no ID)""" return await self.call_method(method, params, request_id=None) @@ -302,7 +292,7 @@ def mock_env_vars(): "AGENT_NAME": "test-agent", "AGENT_DESCRIPTION": "Test agent description", "ACP_URL": "http://localhost", - "ACP_PORT": "8000", + "ACP_PORT": "8718", "WORKFLOW_NAME": "test-workflow", "WORKFLOW_TASK_QUEUE": "test-queue", } diff --git a/src/agentex/lib/types/agent_configs.py b/src/agentex/lib/types/agent_configs.py index 7a3a0f091..1fbb4902e 100644 --- a/src/agentex/lib/types/agent_configs.py +++ b/src/agentex/lib/types/agent_configs.py @@ -12,12 +12,8 @@ class TemporalWorkflowConfig(BaseModel): queue_name: The name of the temporal queue to send tasks to. """ - name: str = Field( - ..., description="The name of the temporal workflow that defines the agent." - ) - queue_name: str = Field( - ..., description="The name of the temporal queue to send tasks to." - ) + name: str = Field(..., description="The name of the temporal workflow that defines the agent.") + queue_name: str = Field(..., description="The name of the temporal queue to send tasks to.") # TODO: Remove this class when we remove the agentex agents create @@ -30,9 +26,7 @@ class TemporalWorkerConfig(BaseModel): workflow: The temporal workflow configuration """ - image: str | None = Field( - default=None, description="Image to use for the temporal worker" - ) + image: str | None = Field(default=None, description="Image to use for the temporal worker") workflow: TemporalWorkflowConfig | None = Field( default=None, description="Configuration for the temporal workflow that defines the agent. Only required for agents that leverage Temporal.", @@ -50,9 +44,7 @@ class TemporalConfig(BaseModel): health_check_port: Port for temporal worker health check endpoint """ - enabled: bool = Field( - default=False, description="Whether this agent uses Temporal workflows" - ) + enabled: bool = Field(default=False, description="Whether this agent uses Temporal workflows") workflow: TemporalWorkflowConfig | None = Field( default=None, description="Temporal workflow configuration. Required when enabled=True. (deprecated: use workflows instead)", @@ -63,7 +55,7 @@ class TemporalConfig(BaseModel): ) health_check_port: int | None = Field( default=None, - description="Port for temporal worker health check endpoint. Defaults to 80 if not specified.", + description="Port for temporal worker health check endpoint. Defaults to 8080 if not specified.", ) @validator("workflows") diff --git a/tests/lib/test_agentex_worker.py b/tests/lib/test_agentex_worker.py index 76347f0d5..820a6d8c4 100644 --- a/tests/lib/test_agentex_worker.py +++ b/tests/lib/test_agentex_worker.py @@ -15,7 +15,7 @@ def cleanup_env(self): os.environ.pop("HEALTH_CHECK_PORT", None) def test_worker_init_uses_default_health_check_port(self): - """Test that worker uses default health_check_port of 80 when not provided.""" + """Test that worker uses default health_check_port of 8080 when not provided.""" from agentex.lib.core.temporal.workers.worker import AgentexWorker # Ensure HEALTH_CHECK_PORT is not in environment @@ -24,11 +24,11 @@ def test_worker_init_uses_default_health_check_port(self): # Mock EnvironmentVariables.refresh to avoid loading .env files with patch("agentex.lib.core.temporal.workers.worker.EnvironmentVariables") as mock_env_vars: mock_instance = mock_env_vars.refresh.return_value - mock_instance.HEALTH_CHECK_PORT = 80 + mock_instance.HEALTH_CHECK_PORT = 8080 worker = AgentexWorker(task_queue="test-queue") - assert worker.health_check_port == 80, "Worker should use default health_check_port of 80" + assert worker.health_check_port == 8080, "Worker should use default health_check_port of 8080" def test_worker_init_with_explicit_health_check_port(self): """Test that worker uses explicit health_check_port parameter when provided.""" @@ -52,7 +52,7 @@ def test_worker_init_explicit_port_overrides_environment(self): @pytest.mark.parametrize( "env_port,expected_port", [ - (None, 80), # No env var, should use default + (None, 8080), # No env var, should use default ("8080", 8080), # Env var set, should use it ("443", 443), # Different port ], diff --git a/tests/test_client.py b/tests/test_client.py index 6e709e654..a596f973f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -695,7 +695,7 @@ def test_base_url_env(self) -> None: Agentex(api_key=api_key, _strict_response_validation=True, environment="production") client = Agentex(base_url=None, api_key=api_key, _strict_response_validation=True, environment="production") - assert str(client.base_url).startswith("http://localhost:5003") + assert str(client.base_url).startswith("http://localhost:5718") client.close() @@ -1596,7 +1596,7 @@ async def test_base_url_env(self) -> None: client = AsyncAgentex( base_url=None, api_key=api_key, _strict_response_validation=True, environment="production" ) - assert str(client.base_url).startswith("http://localhost:5003") + assert str(client.base_url).startswith("http://localhost:5718") await client.close() From 450128b6e92ca769e4446363c62eca628e783ee3 Mon Sep 17 00:00:00 2001 From: SWE Destroyer Date: Tue, 24 Feb 2026 15:31:45 +0000 Subject: [PATCH 2/3] Change health check port from 8080 to 5720 and centralize all port constants - Change HEALTH_CHECK_PORT from generic 8080 to non-standard 5720 - Add DEBUG_PORT, TEMPORAL_ADDRESS, REDIS_URL, AGENTEX_API_BASE_URL to centralized ports.py - Update base_acp_server.py run() to reference ACP_SERVER_PORT constant - Update debug_config.py, debug.py, agents.py CLI to use centralized DEBUG_PORT - Update run_handlers.py to use TEMPORAL_ADDRESS and REDIS_URL from constants - Update tests to reflect new health check port default Co-Authored-By: Claude Opus 4.6 --- src/agentex/lib/cli/commands/agents.py | 5 +- src/agentex/lib/cli/debug/debug_config.py | 54 +++++++-------- src/agentex/lib/cli/handlers/run_handlers.py | 66 +++++++++++-------- src/agentex/lib/constants/ports.py | 14 +++- .../lib/sdk/fastacp/base/base_acp_server.py | 6 +- src/agentex/lib/types/agent_configs.py | 2 +- src/agentex/lib/utils/debug.py | 19 +++--- tests/lib/test_agentex_worker.py | 8 +-- 8 files changed, 102 insertions(+), 72 deletions(-) diff --git a/src/agentex/lib/cli/commands/agents.py b/src/agentex/lib/cli/commands/agents.py index 05e613a99..51c79f45f 100644 --- a/src/agentex/lib/cli/commands/agents.py +++ b/src/agentex/lib/cli/commands/agents.py @@ -12,6 +12,7 @@ from agentex import Agentex from agentex.lib.cli.debug import DebugMode, DebugConfig from agentex.lib.utils.logging import make_logger +from agentex.lib.constants.ports import DEBUG_PORT as _DEFAULT_DEBUG_PORT from agentex.lib.cli.utils.cli_utils import handle_questionary_cancellation from agentex.lib.sdk.config.validation import ( EnvironmentsValidationError, @@ -269,7 +270,9 @@ def run( debug: bool = typer.Option(False, help="Enable debug mode for both worker and ACP (disables auto-reload)"), debug_worker: bool = typer.Option(False, help="Enable debug mode for temporal worker only"), debug_acp: bool = typer.Option(False, help="Enable debug mode for ACP server only"), - debug_port: int = typer.Option(5678, help="Port for remote debugging (worker uses this, ACP uses port+1)"), + debug_port: int = typer.Option( + _DEFAULT_DEBUG_PORT, help="Port for remote debugging (worker uses this, ACP uses port+1)" + ), wait_for_debugger: bool = typer.Option(False, help="Wait for debugger to attach before starting"), ) -> None: """ diff --git a/src/agentex/lib/cli/debug/debug_config.py b/src/agentex/lib/cli/debug/debug_config.py index 3b30e68e2..91138203e 100644 --- a/src/agentex/lib/cli/debug/debug_config.py +++ b/src/agentex/lib/cli/debug/debug_config.py @@ -5,11 +5,13 @@ import socket from enum import Enum +from agentex.lib.constants.ports import DEBUG_PORT as _DEFAULT_DEBUG_PORT from agentex.lib.utils.model_utils import BaseModel class DebugMode(str, Enum): """Debug mode options""" + WORKER = "worker" ACP = "acp" BOTH = "both" @@ -18,19 +20,19 @@ class DebugMode(str, Enum): class DebugConfig(BaseModel): """Configuration for debug mode""" - + enabled: bool = False mode: DebugMode = DebugMode.NONE - port: int = 5678 + port: int = _DEFAULT_DEBUG_PORT wait_for_attach: bool = False auto_port: bool = True # Automatically find available port if specified port is busy - + @classmethod def create_worker_debug( - cls, - port: int = 5678, + cls, + port: int = _DEFAULT_DEBUG_PORT, wait_for_attach: bool = False, - auto_port: bool = True + auto_port: bool = True, ) -> "DebugConfig": """Create debug config for worker debugging""" return cls( @@ -38,15 +40,15 @@ def create_worker_debug( mode=DebugMode.WORKER, port=port, wait_for_attach=wait_for_attach, - auto_port=auto_port + auto_port=auto_port, ) - + @classmethod def create_acp_debug( - cls, - port: int = 5679, + cls, + port: int = _DEFAULT_DEBUG_PORT + 1, wait_for_attach: bool = False, - auto_port: bool = True + auto_port: bool = True, ) -> "DebugConfig": """Create debug config for ACP debugging""" return cls( @@ -54,16 +56,16 @@ def create_acp_debug( mode=DebugMode.ACP, port=port, wait_for_attach=wait_for_attach, - auto_port=auto_port + auto_port=auto_port, ) - + @classmethod def create_both_debug( - cls, - worker_port: int = 5678, - _acp_port: int = 5679, + cls, + worker_port: int = _DEFAULT_DEBUG_PORT, + _acp_port: int = _DEFAULT_DEBUG_PORT + 1, wait_for_attach: bool = False, - auto_port: bool = True + auto_port: bool = True, ) -> "DebugConfig": """Create debug config for both worker and ACP debugging""" return cls( @@ -71,21 +73,21 @@ def create_both_debug( mode=DebugMode.BOTH, port=worker_port, # Primary port for worker wait_for_attach=wait_for_attach, - auto_port=auto_port + auto_port=auto_port, ) - + def should_debug_worker(self) -> bool: """Check if worker should be debugged""" return self.enabled and self.mode in (DebugMode.WORKER, DebugMode.BOTH) - + def should_debug_acp(self) -> bool: """Check if ACP should be debugged""" return self.enabled and self.mode in (DebugMode.ACP, DebugMode.BOTH) - + def get_worker_port(self) -> int: """Get port for worker debugging""" return self.port - + def get_acp_port(self) -> int: """Get port for ACP debugging""" if self.mode == DebugMode.BOTH: @@ -93,16 +95,16 @@ def get_acp_port(self) -> int: return self.port -def find_available_port(start_port: int = 5678, max_attempts: int = 10) -> int: +def find_available_port(start_port: int = _DEFAULT_DEBUG_PORT, max_attempts: int = 10) -> int: """Find an available port starting from start_port""" for port in range(start_port, start_port + max_attempts): try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - s.bind(('localhost', port)) + s.bind(("localhost", port)) return port except OSError: continue - + # If we can't find an available port, just return the start port # and let the debug server handle the error return start_port @@ -112,4 +114,4 @@ def resolve_debug_port(config: DebugConfig, target_port: int) -> int: """Resolve the actual port to use for debugging""" if config.auto_port: return find_available_port(target_port) - return target_port \ No newline at end of file + return target_port diff --git a/src/agentex/lib/cli/handlers/run_handlers.py b/src/agentex/lib/cli/handlers/run_handlers.py index adf44a197..aa3998c41 100644 --- a/src/agentex/lib/cli/handlers/run_handlers.py +++ b/src/agentex/lib/cli/handlers/run_handlers.py @@ -11,6 +11,10 @@ # Import debug functionality from agentex.lib.cli.debug import DebugConfig, start_acp_server_debug, start_temporal_worker_debug from agentex.lib.utils.logging import make_logger +from agentex.lib.constants.ports import ( + REDIS_URL as _DEFAULT_REDIS_URL, + TEMPORAL_ADDRESS as _DEFAULT_TEMPORAL_ADDRESS, +) from agentex.lib.cli.utils.path_utils import ( get_file_paths, calculate_uvicorn_target_for_local, @@ -94,16 +98,16 @@ async def start_temporal_worker_with_reload( worker_process = await start_temporal_worker(worker_path, env, manifest_dir) process_manager.add_process(worker_process) return asyncio.create_task(stream_process_output(worker_process, "WORKER")) - + async def worker_runner() -> None: current_process: asyncio.subprocess.Process | None = None output_task: asyncio.Task[None] | None = None - + console.print(f"[blue]Starting Temporal worker with auto-reload from {worker_path}...[/blue]") - + async def start_worker() -> asyncio.subprocess.Process: nonlocal current_process, output_task - + # PRE-RESTART CLEANUP - NEW! if current_process is not None: # Extract agent name from worker path for cleanup @@ -112,7 +116,7 @@ async def start_worker() -> asyncio.subprocess.Process: console.print(f"FOUND AGENT_NAME FROM ENV VARS: {agent_name} {agent_name is None}") if agent_name is None: agent_name = worker_path.parent.parent.name - + # Perform cleanup if configured if should_cleanup_on_restart(): console.print("[yellow]Cleaning up workflows before worker restart...[/yellow]") @@ -121,7 +125,7 @@ async def start_worker() -> asyncio.subprocess.Process: except Exception as e: logger.warning(f"Cleanup failed: {e}") console.print(f"[yellow]⚠ Cleanup failed: {str(e)}[/yellow]") - + # Clean up previous process if current_process and current_process.returncode is None: current_process.terminate() @@ -130,7 +134,7 @@ async def start_worker() -> asyncio.subprocess.Process: except asyncio.TimeoutError: current_process.kill() await current_process.wait() - + # Cancel previous output task if output_task: output_task.cancel() @@ -138,33 +142,33 @@ async def start_worker() -> asyncio.subprocess.Process: await output_task except asyncio.CancelledError: pass - + current_process = await start_temporal_worker(worker_path, env, manifest_dir) process_manager.add_process(current_process) console.print("[green]Temporal worker started[/green]") return current_process - + try: # Start initial worker current_process = await start_worker() if current_process: output_task = asyncio.create_task(stream_process_output(current_process, "WORKER")) - + # Watch for file changes async for changes in awatch(manifest_dir, recursive=True): # Filter for Python files - py_changes = [(change, path) for change, path in changes if str(path).endswith('.py')] - + py_changes = [(change, path) for change, path in changes if str(path).endswith(".py")] + if py_changes: changed_files = [str(Path(path).relative_to(worker_path.parent)) for _, path in py_changes] console.print(f"[yellow]File changes detected: {changed_files}[/yellow]") console.print("[yellow]Restarting Temporal worker...[/yellow]") - + # Restart worker (with cleanup handled in start_worker) await start_worker() if current_process: output_task = asyncio.create_task(stream_process_output(current_process, "WORKER")) - + except asyncio.CancelledError: # Clean shutdown if output_task: @@ -173,7 +177,7 @@ async def start_worker() -> asyncio.subprocess.Process: await output_task except asyncio.CancelledError: pass - + if current_process and current_process.returncode is None: current_process.terminate() try: @@ -182,7 +186,7 @@ async def start_worker() -> asyncio.subprocess.Process: current_process.kill() await current_process.wait() raise - + return asyncio.create_task(worker_runner()) @@ -192,7 +196,7 @@ async def start_acp_server( """Start the ACP server process""" # Use file path relative to manifest directory if possible uvicorn_target = calculate_uvicorn_target_for_local(acp_path, manifest_dir) - + cmd = [ sys.executable, "-m", @@ -296,11 +300,17 @@ async def run_agent(manifest_path: str, debug_config: "DebugConfig | None" = Non manifest_dir = Path(manifest_path).parent if debug_config and debug_config.should_debug_acp(): acp_process = await start_acp_server_debug( - file_paths["acp"], manifest.local_development.agent.port, agent_env, debug_config # type: ignore[union-attr] + file_paths["acp"], + manifest.local_development.agent.port, + agent_env, + debug_config, # type: ignore[union-attr] ) else: acp_process = await start_acp_server( - file_paths["acp"], manifest.local_development.agent.port, agent_env, manifest_dir # type: ignore[union-attr] + file_paths["acp"], + manifest.local_development.agent.port, + agent_env, + manifest_dir, # type: ignore[union-attr] ) process_manager.add_process(acp_process) @@ -313,14 +323,14 @@ async def run_agent(manifest_path: str, debug_config: "DebugConfig | None" = Non if is_temporal_agent(manifest) and file_paths["worker"]: if debug_config and debug_config.should_debug_worker(): # In debug mode, start worker without auto-reload to prevent conflicts - worker_process = await start_temporal_worker_debug( - file_paths["worker"], agent_env, debug_config - ) + worker_process = await start_temporal_worker_debug(file_paths["worker"], agent_env, debug_config) process_manager.add_process(worker_process) worker_task = asyncio.create_task(stream_process_output(worker_process, "WORKER")) else: # Normal mode with auto-reload - worker_task = await start_temporal_worker_with_reload(file_paths["worker"], agent_env, process_manager, manifest_dir) + worker_task = await start_temporal_worker_with_reload( + file_paths["worker"], agent_env, process_manager, manifest_dir + ) tasks.append(worker_task) console.print( @@ -333,7 +343,7 @@ async def run_agent(manifest_path: str, debug_config: "DebugConfig | None" = Non await process_manager.wait_for_shutdown() except KeyboardInterrupt: console.print("\n[yellow]Received shutdown signal...[/yellow]") - + # Cancel output streaming tasks for task in tasks: task.cancel() @@ -351,9 +361,6 @@ async def run_agent(manifest_path: str, debug_config: "DebugConfig | None" = Non await process_manager.cleanup_processes() - - - def create_agent_environment(manifest: AgentManifest) -> dict[str, str]: """Create environment variables for agent processes without modifying os.environ""" # Start with current environment @@ -364,8 +371,8 @@ def create_agent_environment(manifest: AgentManifest) -> dict[str, str]: # TODO: Combine this logic with the deploy_handlers so that we can reuse the env vars env_vars = { "ENVIRONMENT": "development", - "TEMPORAL_ADDRESS": "localhost:7233", - "REDIS_URL": "redis://localhost:6379", + "TEMPORAL_ADDRESS": _DEFAULT_TEMPORAL_ADDRESS, + "REDIS_URL": _DEFAULT_REDIS_URL, "AGENT_NAME": manifest.agent.name, "ACP_TYPE": manifest.agent.acp_type, "ACP_URL": f"http://{manifest.local_development.agent.host_address}", # type: ignore[union-attr] @@ -377,6 +384,7 @@ def create_agent_environment(manifest: AgentManifest) -> dict[str, str]: # Add authorization principal if set - for local development, auth is optional from agentex.lib.cli.utils.auth_utils import _encode_principal_context + encoded_principal = _encode_principal_context(manifest) if encoded_principal: env_vars[EnvVarKeys.AUTH_PRINCIPAL_B64] = encoded_principal diff --git a/src/agentex/lib/constants/ports.py b/src/agentex/lib/constants/ports.py index cc83257fe..1b4bf7069 100644 --- a/src/agentex/lib/constants/ports.py +++ b/src/agentex/lib/constants/ports.py @@ -12,4 +12,16 @@ ACP_SERVER_PORT = 8718 # Health check endpoint default port (configurable via HEALTH_CHECK_PORT env var) -HEALTH_CHECK_PORT = 8080 +HEALTH_CHECK_PORT = 5720 + +# Debug server default port (configurable via AGENTEX_DEBUG_PORT env var) +DEBUG_PORT = 5678 + +# Temporal server default address (configurable via TEMPORAL_ADDRESS env var) +TEMPORAL_ADDRESS = "localhost:7233" + +# Default Redis URL (configurable via REDIS_URL env var) +REDIS_URL = "redis://localhost:6379" + +# AgentEx API base URL (configurable via AGENTEX_BASE_URL env var) +AGENTEX_API_BASE_URL = f"http://localhost:{AGENTEX_API_PORT}" diff --git a/src/agentex/lib/sdk/fastacp/base/base_acp_server.py b/src/agentex/lib/sdk/fastacp/base/base_acp_server.py index f126da79f..64ee11bef 100644 --- a/src/agentex/lib/sdk/fastacp/base/base_acp_server.py +++ b/src/agentex/lib/sdk/fastacp/base/base_acp_server.py @@ -382,6 +382,10 @@ async def async_generator(task_message_content_list: list[TaskMessageContent]): ACP Server Lifecycle Methods """ - def run(self, host: str = "0.0.0.0", port: int = 8718, **kwargs): + def run(self, host: str = "0.0.0.0", port: int | None = None, **kwargs): """Start the Uvicorn server for async handlers.""" + from agentex.lib.constants.ports import ACP_SERVER_PORT + + if port is None: + port = ACP_SERVER_PORT uvicorn.run(self, host=host, port=port, **kwargs) diff --git a/src/agentex/lib/types/agent_configs.py b/src/agentex/lib/types/agent_configs.py index 1fbb4902e..c5924612e 100644 --- a/src/agentex/lib/types/agent_configs.py +++ b/src/agentex/lib/types/agent_configs.py @@ -55,7 +55,7 @@ class TemporalConfig(BaseModel): ) health_check_port: int | None = Field( default=None, - description="Port for temporal worker health check endpoint. Defaults to 8080 if not specified.", + description="Port for temporal worker health check endpoint. Defaults to HEALTH_CHECK_PORT (5720) if not specified.", ) @validator("workflows") diff --git a/src/agentex/lib/utils/debug.py b/src/agentex/lib/utils/debug.py index 69cbf6b19..c636a9052 100644 --- a/src/agentex/lib/utils/debug.py +++ b/src/agentex/lib/utils/debug.py @@ -9,6 +9,7 @@ import debugpy # type: ignore from agentex.lib.utils.logging import make_logger +from agentex.lib.constants.ports import DEBUG_PORT as _DEFAULT_DEBUG_PORT logger = make_logger(__name__) @@ -16,28 +17,28 @@ def setup_debug_if_enabled() -> None: """ Setup debugpy if debug mode is enabled via environment variables. - + This function checks for AgentEx debug environment variables and configures debugpy accordingly. It's designed to be called early in worker startup. - + Environment Variables: AGENTEX_DEBUG_ENABLED: Set to "true" to enable debug mode AGENTEX_DEBUG_PORT: Port for debug server (default: 5678) AGENTEX_DEBUG_TYPE: Type identifier for logging (default: "worker") AGENTEX_DEBUG_WAIT_FOR_ATTACH: Set to "true" to wait for debugger attachment - + Raises: Any exception from debugpy setup (will bubble up naturally) """ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5678")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", str(_DEFAULT_DEBUG_PORT))) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "worker") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" - + # Configure debugpy debugpy.configure(subProcess=False) debugpy.listen(debug_port) - + logger.info(f"🐛 [{debug_type.upper()}] Debug server listening on port {debug_port}") if wait_for_attach: @@ -51,7 +52,7 @@ def setup_debug_if_enabled() -> None: def is_debug_enabled() -> bool: """ Check if debug mode is currently enabled. - + Returns: bool: True if AGENTEX_DEBUG_ENABLED is set to "true" """ @@ -61,8 +62,8 @@ def is_debug_enabled() -> bool: def get_debug_port() -> int: """ Get the debug port from environment variables. - + Returns: int: Debug port (default: 5678) """ - return int(os.getenv("AGENTEX_DEBUG_PORT", "5678")) + return int(os.getenv("AGENTEX_DEBUG_PORT", str(_DEFAULT_DEBUG_PORT))) diff --git a/tests/lib/test_agentex_worker.py b/tests/lib/test_agentex_worker.py index 820a6d8c4..ca1b3034b 100644 --- a/tests/lib/test_agentex_worker.py +++ b/tests/lib/test_agentex_worker.py @@ -15,7 +15,7 @@ def cleanup_env(self): os.environ.pop("HEALTH_CHECK_PORT", None) def test_worker_init_uses_default_health_check_port(self): - """Test that worker uses default health_check_port of 8080 when not provided.""" + """Test that worker uses default health_check_port of 5720 when not provided.""" from agentex.lib.core.temporal.workers.worker import AgentexWorker # Ensure HEALTH_CHECK_PORT is not in environment @@ -24,11 +24,11 @@ def test_worker_init_uses_default_health_check_port(self): # Mock EnvironmentVariables.refresh to avoid loading .env files with patch("agentex.lib.core.temporal.workers.worker.EnvironmentVariables") as mock_env_vars: mock_instance = mock_env_vars.refresh.return_value - mock_instance.HEALTH_CHECK_PORT = 8080 + mock_instance.HEALTH_CHECK_PORT = 5720 worker = AgentexWorker(task_queue="test-queue") - assert worker.health_check_port == 8080, "Worker should use default health_check_port of 8080" + assert worker.health_check_port == 5720, "Worker should use default health_check_port of 5720" def test_worker_init_with_explicit_health_check_port(self): """Test that worker uses explicit health_check_port parameter when provided.""" @@ -52,7 +52,7 @@ def test_worker_init_explicit_port_overrides_environment(self): @pytest.mark.parametrize( "env_port,expected_port", [ - (None, 8080), # No env var, should use default + (None, 5720), # No env var, should use default ("8080", 8080), # Env var set, should use it ("443", 443), # Different port ], From c2acf5c7faf7667afb856cfec8dce62fb1f265da Mon Sep 17 00:00:00 2001 From: SWE Destroyer Date: Tue, 24 Feb 2026 16:06:25 +0000 Subject: [PATCH 3/3] Migrate debug ports to non-standard values and fix review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Migrate debug worker port from 5678 to 9678 across all files - Migrate debug ACP port from 5679 to 9679 in templates and examples - Fix health check port comment in temporal manifest templates (8080 → 5720) - Update README, CLAUDE.md, and cursor rules with new debug ports - Fix multi-agent Dockerfile CMD to use exec form for proper signal handling Co-Authored-By: Claude Opus 4.6 --- .cursor/rules/30_cli_and_commands.mdc | 2 +- CLAUDE.md | 2 +- README.md | 6 +- .../demos/procurement_agent/project/acp.py | 8 +- .../090_multi_agent_non_temporal/Dockerfile | 2 +- .../090_multi_agent_non_temporal/README.md | 2 +- .../030_custom_activities/project/acp.py | 17 ++-- .../project/acp.py | 17 ++-- .../project/acp.py | 9 +- .../project/acp.py | 15 +-- .../090_claude_agents_sdk_mvp/project/acp.py | 3 +- .../100_gemini_litellm/project/acp.py | 19 ++-- src/agentex/lib/cli/debug/debug_handlers.py | 93 ++++++++++--------- .../temporal-openai-agents/manifest.yaml.j2 | 4 +- .../temporal-openai-agents/project/acp.py.j2 | 2 +- .../cli/templates/temporal/manifest.yaml.j2 | 4 +- .../cli/templates/temporal/project/acp.py.j2 | 2 +- src/agentex/lib/constants/ports.py | 2 +- src/agentex/lib/utils/debug.py | 4 +- 19 files changed, 110 insertions(+), 103 deletions(-) diff --git a/.cursor/rules/30_cli_and_commands.mdc b/.cursor/rules/30_cli_and_commands.mdc index f39442341..211971db9 100644 --- a/.cursor/rules/30_cli_and_commands.mdc +++ b/.cursor/rules/30_cli_and_commands.mdc @@ -15,4 +15,4 @@ The `agentex` CLI exposes: Development tips: - For agent development, use `agentex agents run --manifest manifest.yaml` -- For debugging, append `--debug-worker` and optionally `--debug-port 5679` +- For debugging, append `--debug-worker` and optionally `--debug-port 9679` diff --git a/CLAUDE.md b/CLAUDE.md index ffb1e50f6..e31b33bd1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,7 +38,7 @@ The package provides the `agentex` CLI with these main commands: ### Agent Development - Run agents: `agentex agents run --manifest manifest.yaml` - Debug agents: `agentex agents run --manifest manifest.yaml --debug-worker` -- Debug with custom port: `agentex agents run --manifest manifest.yaml --debug-worker --debug-port 5679` +- Debug with custom port: `agentex agents run --manifest manifest.yaml --debug-worker --debug-port 9679` ## Architecture Overview diff --git a/README.md b/README.md index 5941deffa..dc3d0ee7c 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ uv run agentex agents run --manifest manifest.yaml --debug-worker uv run agentex agents run --manifest manifest.yaml --debug-worker --wait-for-debugger # Custom debug port -uv run agentex agents run --manifest manifest.yaml --debug-worker --debug-port 5679 +uv run agentex agents run --manifest manifest.yaml --debug-worker --debug-port 9679 ``` For **VS Code**, add this configuration to `.vscode/launch.json`: @@ -90,14 +90,14 @@ For **VS Code**, add this configuration to `.vscode/launch.json`: "name": "Attach to AgentEx Worker", "type": "debugpy", "request": "attach", - "connect": { "host": "localhost", "port": 5678 }, + "connect": { "host": "localhost", "port": 9678 }, "pathMappings": [{ "localRoot": "${workspaceFolder}", "remoteRoot": "." }], "justMyCode": false, "console": "integratedTerminal" } ``` -The debug server automatically finds an available port starting from 5678 and prints connection details when starting. +The debug server automatically finds an available port starting from 9678 and prints connection details when starting. ### With aiohttp diff --git a/examples/demos/procurement_agent/project/acp.py b/examples/demos/procurement_agent/project/acp.py index 54cac94a2..63c7a93cc 100644 --- a/examples/demos/procurement_agent/project/acp.py +++ b/examples/demos/procurement_agent/project/acp.py @@ -16,7 +16,7 @@ from agentex.lib.utils.logging import make_logger logger = make_logger(__name__) - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" @@ -54,6 +54,6 @@ type="temporal", temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[OpenAIAgentsPlugin(model_provider=streaming_model_provider)], - interceptors=[context_interceptor] - ) -) \ No newline at end of file + interceptors=[context_interceptor], + ), +) diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile index e580dc2d1..bcdeadee8 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/Dockerfile @@ -54,4 +54,4 @@ ENV AGENT_NAME=ab090-multi-agent-non-temporal # (ab090-creator-agent, ab090-critic-agent, ab090-formatter-agent, or ab090-orchestrator-agent) # Run the agent using uvicorn -CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718} +CMD ["sh", "-c", "exec uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718}"] diff --git a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md index 47d77dde4..a744c2c2e 100644 --- a/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md +++ b/examples/tutorials/10_async/00_base/090_multi_agent_non_temporal/README.md @@ -164,7 +164,7 @@ uv run agentex agents deploy --cluster your-cluster --manifest creator.yaml ### Shared Dockerfile The Dockerfile uses build arguments to run different agents: ```dockerfile -CMD uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718} +CMD ["sh", "-c", "exec uvicorn project.${AGENT_FILE%.*}:acp --host 0.0.0.0 --port ${PORT:-8718}"] ``` Manifest files specify which agent to run: diff --git a/examples/tutorials/10_async/10_temporal/030_custom_activities/project/acp.py b/examples/tutorials/10_async/10_temporal/030_custom_activities/project/acp.py index 819b119ce..1b73ebbe0 100644 --- a/examples/tutorials/10_async/10_temporal/030_custom_activities/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/030_custom_activities/project/acp.py @@ -5,23 +5,24 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" - + # Configure debugpy debugpy.configure(subProcess=False) debugpy.listen(debug_port) - + print(f"🐛 [{debug_type.upper()}] Debug server listening on port {debug_port}") - + if wait_for_attach: print(f"⏳ [{debug_type.upper()}] Waiting for debugger to attach...") debugpy.wait_for_client() print(f"✅ [{debug_type.upper()}] Debugger attached!") else: print(f"📡 [{debug_type.upper()}] Ready for debugger attachment") - + except ImportError: print("❌ debugpy not available. Install with: pip install debugpy") sys.exit(1) @@ -40,8 +41,8 @@ # When deployed to the cluster, the Temporal address will automatically be set to the cluster address # For local development, we set the address manually to talk to the local Temporal service set up via docker compose type="temporal", - temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233") - ) + temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), + ), ) @@ -57,4 +58,4 @@ # @acp.on_task_cancel # This does not need to be handled by your workflow. -# It is automatically handled by the temporal client which cancels the workflow directly \ No newline at end of file +# It is automatically handled by the temporal client which cancels the workflow directly diff --git a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/project/acp.py b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/project/acp.py index fcdbba155..ed2c0b2cf 100644 --- a/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/060_open_ai_agents_sdk_hello_world/project/acp.py @@ -7,23 +7,24 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" - + # Configure debugpy debugpy.configure(subProcess=False) debugpy.listen(debug_port) - + print(f"🐛 [{debug_type.upper()}] Debug server listening on port {debug_port}") - + if wait_for_attach: print(f"⏳ [{debug_type.upper()}] Waiting for debugger to attach...") debugpy.wait_for_client() print(f"✅ [{debug_type.upper()}] Debugger attached!") else: print(f"📡 [{debug_type.upper()}] Ready for debugger attachment") - + except ImportError: print("❌ debugpy not available. Install with: pip install debugpy") sys.exit(1) @@ -52,8 +53,8 @@ type="temporal", temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[OpenAIAgentsPlugin(model_provider=temporal_streaming_model_provider)], - interceptors=[context_interceptor] - ) + interceptors=[context_interceptor], + ), ) @@ -69,4 +70,4 @@ # @acp.on_task_cancel # This does not need to be handled by your workflow. -# It is automatically handled by the temporal client which cancels the workflow directly \ No newline at end of file +# It is automatically handled by the temporal client which cancels the workflow directly diff --git a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/project/acp.py b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/project/acp.py index 3028093b9..ed2c0b2cf 100644 --- a/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/070_open_ai_agents_sdk_tools/project/acp.py @@ -7,7 +7,8 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" @@ -52,8 +53,8 @@ type="temporal", temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[OpenAIAgentsPlugin(model_provider=temporal_streaming_model_provider)], - interceptors=[context_interceptor] - ) + interceptors=[context_interceptor], + ), ) @@ -69,4 +70,4 @@ # @acp.on_task_cancel # This does not need to be handled by your workflow. -# It is automatically handled by the temporal client which cancels the workflow directly \ No newline at end of file +# It is automatically handled by the temporal client which cancels the workflow directly diff --git a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/project/acp.py b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/project/acp.py index c05effdbe..731d253de 100644 --- a/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/080_open_ai_agents_sdk_human_in_the_loop/project/acp.py @@ -7,23 +7,24 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" - + # Configure debugpy debugpy.configure(subProcess=False) debugpy.listen(debug_port) - + print(f"🐛 [{debug_type.upper()}] Debug server listening on port {debug_port}") - + if wait_for_attach: print(f"⏳ [{debug_type.upper()}] Waiting for debugger to attach...") debugpy.wait_for_client() print(f"✅ [{debug_type.upper()}] Debugger attached!") else: print(f"📡 [{debug_type.upper()}] Ready for debugger attachment") - + except ImportError: print("❌ debugpy not available. Install with: pip install debugpy") sys.exit(1) @@ -76,7 +77,7 @@ temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[OpenAIAgentsPlugin(model_provider=temporal_streaming_model_provider)], interceptors=[context_interceptor], - ) + ), ) @@ -92,4 +93,4 @@ # @acp.on_task_cancel # This does not need to be handled by your workflow. -# It is automatically handled by the temporal client which cancels the workflow directly \ No newline at end of file +# It is automatically handled by the temporal client which cancels the workflow directly diff --git a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/project/acp.py b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/project/acp.py index fdb08ded8..078e419f0 100644 --- a/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/090_claude_agents_sdk_mvp/project/acp.py @@ -9,7 +9,7 @@ try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" @@ -72,4 +72,3 @@ # @acp.on_task_cancel # This does not need to be handled by your workflow. # It is automatically handled by the temporal client which cancels the workflow directly - diff --git a/examples/tutorials/10_async/10_temporal/100_gemini_litellm/project/acp.py b/examples/tutorials/10_async/10_temporal/100_gemini_litellm/project/acp.py index 9d2afdc37..6089e4076 100644 --- a/examples/tutorials/10_async/10_temporal/100_gemini_litellm/project/acp.py +++ b/examples/tutorials/10_async/10_temporal/100_gemini_litellm/project/acp.py @@ -7,7 +7,8 @@ # === DEBUG SETUP (AgentEx CLI Debug Support) === if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debugpy.configure(subProcess=False) debugpy.listen(debug_port) if os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true": @@ -34,14 +35,14 @@ # route to different model providers (like Gemini) while keeping all that infrastructure. type="temporal", temporal_address=os.getenv("TEMPORAL_ADDRESS", "localhost:7233"), - plugins=[OpenAIAgentsPlugin( - model_params=ModelActivityParameters( - start_to_close_timeout=timedelta(days=1) - ), - model_provider=LitellmProvider(), - )], - interceptors=[context_interceptor] - ) + plugins=[ + OpenAIAgentsPlugin( + model_params=ModelActivityParameters(start_to_close_timeout=timedelta(days=1)), + model_provider=LitellmProvider(), + ) + ], + interceptors=[context_interceptor], + ), ) diff --git a/src/agentex/lib/cli/debug/debug_handlers.py b/src/agentex/lib/cli/debug/debug_handlers.py index 98746387f..f3df859c5 100644 --- a/src/agentex/lib/cli/debug/debug_handlers.py +++ b/src/agentex/lib/cli/debug/debug_handlers.py @@ -23,43 +23,41 @@ console = Console() -async def start_temporal_worker_debug( - worker_path: Path, - env: Dict[str, str], - debug_config: DebugConfig -): +async def start_temporal_worker_debug(worker_path: Path, env: Dict[str, str], debug_config: DebugConfig): """Start temporal worker with debug support""" - + if not debug_config.should_debug_worker(): raise ValueError("Debug config is not configured for worker debugging") - + # Resolve the actual debug port debug_port = resolve_debug_port(debug_config, debug_config.get_worker_port()) - + # Add debug environment variables debug_env = env.copy() - debug_env.update({ - "AGENTEX_DEBUG_ENABLED": "true", - "AGENTEX_DEBUG_PORT": str(debug_port), - "AGENTEX_DEBUG_WAIT_FOR_ATTACH": str(debug_config.wait_for_attach).lower(), - "AGENTEX_DEBUG_TYPE": "worker" - }) - + debug_env.update( + { + "AGENTEX_DEBUG_ENABLED": "true", + "AGENTEX_DEBUG_PORT": str(debug_port), + "AGENTEX_DEBUG_WAIT_FOR_ATTACH": str(debug_config.wait_for_attach).lower(), + "AGENTEX_DEBUG_TYPE": "worker", + } + ) + # Start the worker process # For debugging, use absolute path to run_worker.py to run from workspace root worker_script = worker_path.parent / "run_worker.py" cmd = [sys.executable, str(worker_script)] - + console.print(f"[blue]🐛 Starting Temporal worker in debug mode[/blue]") console.print(f"[yellow]📡 Debug server will listen on port {debug_port}[/yellow]") console.print(f"[green]✓ VS Code should connect to: localhost:{debug_port}[/green]") - + if debug_config.wait_for_attach: console.print(f"[yellow]⏳ Worker will wait for debugger to attach[/yellow]") - + console.print(f"[dim]💡 In your IDE: Attach to localhost:{debug_port}[/dim]") console.print(f"[dim]🔧 If connection fails, check that VS Code launch.json uses port {debug_port}[/dim]") - + return await asyncio.create_subprocess_exec( *cmd, cwd=Path.cwd(), # Run from current working directory (workspace root) @@ -69,29 +67,26 @@ async def start_temporal_worker_debug( ) -async def start_acp_server_debug( - acp_path: Path, - port: int, - env: Dict[str, str], - debug_config: DebugConfig -): +async def start_acp_server_debug(acp_path: Path, port: int, env: Dict[str, str], debug_config: DebugConfig): """Start ACP server with debug support""" - + if not debug_config.should_debug_acp(): raise ValueError("Debug config is not configured for ACP debugging") - + # Resolve the actual debug port debug_port = resolve_debug_port(debug_config, debug_config.get_acp_port()) - + # Add debug environment variables debug_env = env.copy() - debug_env.update({ - "AGENTEX_DEBUG_ENABLED": "true", - "AGENTEX_DEBUG_PORT": str(debug_port), - "AGENTEX_DEBUG_WAIT_FOR_ATTACH": str(debug_config.wait_for_attach).lower(), - "AGENTEX_DEBUG_TYPE": "acp" - }) - + debug_env.update( + { + "AGENTEX_DEBUG_ENABLED": "true", + "AGENTEX_DEBUG_PORT": str(debug_port), + "AGENTEX_DEBUG_WAIT_FOR_ATTACH": str(debug_config.wait_for_attach).lower(), + "AGENTEX_DEBUG_TYPE": "acp", + } + ) + # Disable uvicorn auto-reload in debug mode to prevent conflicts cmd = [ sys.executable, @@ -107,10 +102,10 @@ async def start_acp_server_debug( console.print(f"[blue]🐛 Starting ACP server in debug mode[/blue]") console.print(f"[yellow]📡 Debug server will listen on port {debug_port}[/yellow]") - + if debug_config.wait_for_attach: console.print(f"[yellow]⏳ ACP server will wait for debugger to attach[/yellow]") - + console.print(f"[dim]💡 In your IDE: Attach to localhost:{debug_port}[/dim]") return await asyncio.create_subprocess_exec( @@ -124,7 +119,7 @@ async def start_acp_server_debug( def create_debug_startup_script() -> str: """Create a Python script snippet for debug initialization""" - return ''' + return """ import os import sys @@ -132,7 +127,7 @@ def create_debug_startup_script() -> str: if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": try: import debugpy - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5678")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9678")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "unknown") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" @@ -155,22 +150,30 @@ def create_debug_startup_script() -> str: except Exception as e: print(f"❌ Debug setup failed: {e}") sys.exit(1) -''' +""" def inject_debug_code_to_worker_template() -> str: """Generate debug code to inject into worker template""" - return """ + return ( + """ # === DEBUG SETUP (Auto-generated by AgentEx CLI) === -""" + create_debug_startup_script() + """ +""" + + create_debug_startup_script() + + """ # === END DEBUG SETUP === """ + ) def inject_debug_code_to_acp_template() -> str: """Generate debug code to inject into ACP template""" - return """ + return ( + """ # === DEBUG SETUP (Auto-generated by AgentEx CLI) === -""" + create_debug_startup_script() + """ +""" + + create_debug_startup_script() + + """ # === END DEBUG SETUP === -""" \ No newline at end of file +""" + ) diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 index dd33aca39..a972ceff9 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/manifest.yaml.j2 @@ -90,8 +90,8 @@ agent: queue_name: {{ queue_name }} # Optional: Health check port for temporal worker - # Defaults to 8080 if not specified - # health_check_port: 8080 + # Defaults to 5720 if not specified + # health_check_port: 5720 # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables diff --git a/src/agentex/lib/cli/templates/temporal-openai-agents/project/acp.py.j2 b/src/agentex/lib/cli/templates/temporal-openai-agents/project/acp.py.j2 index 87a3fdb96..3129c1091 100644 --- a/src/agentex/lib/cli/templates/temporal-openai-agents/project/acp.py.j2 +++ b/src/agentex/lib/cli/templates/temporal-openai-agents/project/acp.py.j2 @@ -14,7 +14,7 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": from agentex.lib.utils.logging import make_logger logger = make_logger(__name__) - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" diff --git a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 index dd33aca39..a972ceff9 100644 --- a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 @@ -90,8 +90,8 @@ agent: queue_name: {{ queue_name }} # Optional: Health check port for temporal worker - # Defaults to 8080 if not specified - # health_check_port: 8080 + # Defaults to 5720 if not specified + # health_check_port: 5720 # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables diff --git a/src/agentex/lib/cli/templates/temporal/project/acp.py.j2 b/src/agentex/lib/cli/templates/temporal/project/acp.py.j2 index ec06135c6..6408711ea 100644 --- a/src/agentex/lib/cli/templates/temporal/project/acp.py.j2 +++ b/src/agentex/lib/cli/templates/temporal/project/acp.py.j2 @@ -8,7 +8,7 @@ if os.getenv("AGENTEX_DEBUG_ENABLED") == "true": from agentex.lib.utils.logging import make_logger logger = make_logger(__name__) - debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5679")) + debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "9679")) debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "acp") wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true" diff --git a/src/agentex/lib/constants/ports.py b/src/agentex/lib/constants/ports.py index 1b4bf7069..5a2096525 100644 --- a/src/agentex/lib/constants/ports.py +++ b/src/agentex/lib/constants/ports.py @@ -15,7 +15,7 @@ HEALTH_CHECK_PORT = 5720 # Debug server default port (configurable via AGENTEX_DEBUG_PORT env var) -DEBUG_PORT = 5678 +DEBUG_PORT = 9678 # Temporal server default address (configurable via TEMPORAL_ADDRESS env var) TEMPORAL_ADDRESS = "localhost:7233" diff --git a/src/agentex/lib/utils/debug.py b/src/agentex/lib/utils/debug.py index c636a9052..7fde267a3 100644 --- a/src/agentex/lib/utils/debug.py +++ b/src/agentex/lib/utils/debug.py @@ -23,7 +23,7 @@ def setup_debug_if_enabled() -> None: Environment Variables: AGENTEX_DEBUG_ENABLED: Set to "true" to enable debug mode - AGENTEX_DEBUG_PORT: Port for debug server (default: 5678) + AGENTEX_DEBUG_PORT: Port for debug server (default: 9678) AGENTEX_DEBUG_TYPE: Type identifier for logging (default: "worker") AGENTEX_DEBUG_WAIT_FOR_ATTACH: Set to "true" to wait for debugger attachment @@ -64,6 +64,6 @@ def get_debug_port() -> int: Get the debug port from environment variables. Returns: - int: Debug port (default: 5678) + int: Debug port (default: 9678) """ return int(os.getenv("AGENTEX_DEBUG_PORT", str(_DEFAULT_DEBUG_PORT)))