Skip to content

Commit 89097c0

Browse files
SWE Destroyerclaude
andcommitted
Fix reverted port defaults in environment_variables.py and deploy_handlers.py
Restore centralized port constant imports that were reverted by linter. environment_variables.py: use _DEFAULT_ACP_PORT, _DEFAULT_AGENTEX_BASE_URL, _DEFAULT_HEALTH_CHECK_PORT, _DEFAULT_TEMPORAL_ADDRESS from ports.py. deploy_handlers.py: use str(ACP_SERVER_PORT) instead of hardcoded "8000". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7162a6 commit 89097c0

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/agentex/lib/cli/handlers/deploy_handlers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from rich.console import Console
1212

1313
from agentex.lib.utils.logging import make_logger
14+
from agentex.lib.constants.ports import ACP_SERVER_PORT
1415
from agentex.lib.cli.utils.exceptions import HelmError, DeploymentError
1516
from agentex.lib.cli.utils.path_utils import PathResolutionError, calculate_docker_acp_module
1617
from agentex.lib.environment_variables import EnvVarKeys
@@ -239,12 +240,12 @@ def add_acp_command_to_helm_values(helm_values: dict[str, Any], manifest: AgentM
239240
try:
240241
docker_acp_module = calculate_docker_acp_module(manifest, manifest_path)
241242
# Create the uvicorn command with the correct module path
242-
helm_values["command"] = ["uvicorn", f"{docker_acp_module}:acp", "--host", "0.0.0.0", "--port", "8000"]
243+
helm_values["command"] = ["uvicorn", f"{docker_acp_module}:acp", "--host", "0.0.0.0", "--port", str(ACP_SERVER_PORT)]
243244
logger.info(f"Using dynamic ACP command: uvicorn {docker_acp_module}:acp")
244245
except (PathResolutionError, Exception) as e:
245246
# Fallback to default command structure
246247
logger.warning(f"Could not calculate dynamic ACP module ({e}), using default: project.acp")
247-
helm_values["command"] = ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]
248+
helm_values["command"] = ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", str(ACP_SERVER_PORT)]
248249

249250

250251
def merge_deployment_configs(

src/agentex/lib/environment_variables.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from __future__ import annotations
32

43
import os
@@ -8,6 +7,12 @@
87
from dotenv import load_dotenv
98

109
from agentex.lib.utils.logging import make_logger
10+
from agentex.lib.constants.ports import (
11+
ACP_SERVER_PORT as _DEFAULT_ACP_PORT,
12+
TEMPORAL_ADDRESS as _DEFAULT_TEMPORAL_ADDRESS,
13+
HEALTH_CHECK_PORT as _DEFAULT_HEALTH_CHECK_PORT,
14+
AGENTEX_API_BASE_URL as _DEFAULT_AGENTEX_BASE_URL,
15+
)
1116
from agentex.lib.utils.model_utils import BaseModel
1217

1318
PROJECT_ROOT = Path(__file__).resolve().parents[2]
@@ -56,9 +61,9 @@ class Environment(str, Enum):
5661

5762
class EnvironmentVariables(BaseModel):
5863
ENVIRONMENT: str = Environment.DEV
59-
TEMPORAL_ADDRESS: str | None = "localhost:7233"
64+
TEMPORAL_ADDRESS: str | None = _DEFAULT_TEMPORAL_ADDRESS
6065
REDIS_URL: str | None = None
61-
AGENTEX_BASE_URL: str | None = "http://localhost:5003"
66+
AGENTEX_BASE_URL: str | None = _DEFAULT_AGENTEX_BASE_URL
6267
# Agent Identifiers
6368
AGENT_NAME: str
6469
AGENT_DESCRIPTION: str | None = None
@@ -68,12 +73,12 @@ class EnvironmentVariables(BaseModel):
6873
AGENT_INPUT_TYPE: str | None = None
6974
# ACP Configuration
7075
ACP_URL: str
71-
ACP_PORT: int = 8000
76+
ACP_PORT: int = _DEFAULT_ACP_PORT
7277
# Workflow Configuration
7378
WORKFLOW_TASK_QUEUE: str | None = None
7479
WORKFLOW_NAME: str | None = None
7580
# Temporal Worker Configuration
76-
HEALTH_CHECK_PORT: int = 80
81+
HEALTH_CHECK_PORT: int = _DEFAULT_HEALTH_CHECK_PORT
7782
# Auth Configuration
7883
AUTH_PRINCIPAL_B64: str | None = None
7984
# Build Information

0 commit comments

Comments
 (0)