Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/agentex/lib/cli/handlers/run_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ def create_agent_environment(manifest: AgentManifest) -> dict[str, str]:
env_vars["WORKFLOW_NAME"] = temporal_config.name
env_vars["WORKFLOW_TASK_QUEUE"] = temporal_config.queue_name

# Set health check port from temporal config
if manifest.agent.temporal and manifest.agent.temporal.health_check_port is not None:
env_vars["HEALTH_CHECK_PORT"] = str(manifest.agent.temporal.health_check_port)

if agent_config.env:
for key, value in agent_config.env.items():
env_vars[key] = value
Expand Down
4 changes: 4 additions & 0 deletions src/agentex/lib/cli/templates/temporal/manifest.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ agent:
# Convention: <agent_name>_task_queue
queue_name: {{ queue_name }}

# Optional: Health check port for temporal worker
# Defaults to 80 if not specified
# health_check_port: 80

# Optional: Credentials mapping
# Maps Kubernetes secrets to environment variables
# Common credentials include:
Expand Down
2 changes: 1 addition & 1 deletion src/agentex/lib/core/temporal/workers/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __init__(
task_queue,
max_workers: int = 10,
max_concurrent_activities: int = 10,
health_check_port: int = 80,
health_check_port: int = int(os.environ.get("HEALTH_CHECK_PORT")),
plugins: list = [],
):
self.task_queue = task_queue
Expand Down
5 changes: 5 additions & 0 deletions src/agentex/lib/environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class EnvVarKeys(str, Enum):
# Workflow Configuration
WORKFLOW_NAME = "WORKFLOW_NAME"
WORKFLOW_TASK_QUEUE = "WORKFLOW_TASK_QUEUE"
# Temporal Worker Configuration
HEALTH_CHECK_PORT = "HEALTH_CHECK_PORT"
# Auth Configuration
AUTH_PRINCIPAL_B64 = "AUTH_PRINCIPAL_B64"
# Build Information
Expand Down Expand Up @@ -65,6 +67,9 @@ class EnvironmentVariables(BaseModel):
# Workflow Configuration
WORKFLOW_TASK_QUEUE: str | None = None
WORKFLOW_NAME: str | None = None
# Temporal Worker Configuration
HEALTH_CHECK_PORT: int = 80
# Auth Configuration
AUTH_PRINCIPAL_B64: str | None = None
# Build Information
BUILD_INFO_PATH: str | None = None
Expand Down
5 changes: 5 additions & 0 deletions src/agentex/lib/types/agent_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class TemporalConfig(BaseModel):
enabled: Whether this agent uses Temporal workflows
workflow: The temporal workflow configuration
workflows: The list of temporal workflow configurations
health_check_port: Port for temporal worker health check endpoint
"""

enabled: bool = Field(
Expand All @@ -58,6 +59,10 @@ class TemporalConfig(BaseModel):
default=None,
description="List of temporal workflow configurations. Used when enabled=true.",
)
health_check_port: int | None = Field(
default=None,
description="Port for temporal worker health check endpoint. Defaults to 80 if not specified.",
)

@validator("workflows")
def validate_workflows_not_empty(cls, v):
Expand Down