Skip to content

Commit 924f86b

Browse files
authored
Sync Agentex Private to Public (#39)
1 parent d308771 commit 924f86b

24 files changed

+1577
-18
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""add unhealthy status
2+
3+
Revision ID: a5d67f2d7356
4+
Revises: 329fbafa4ff9
5+
Create Date: 2025-11-04 19:23:22.904744
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = 'a5d67f2d7356'
16+
down_revision: Union[str, None] = '329fbafa4ff9'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
op.execute("""
24+
ALTER TYPE agentstatus ADD VALUE IF NOT EXISTS 'UNHEALTHY';
25+
""")
26+
# ### end Alembic commands ###
27+
28+
29+
def downgrade() -> None:
30+
# ### commands auto generated by Alembic - please adjust! ###
31+
pass
32+
# ### end Alembic commands ###
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""add agent input type
2+
3+
Revision ID: 24429f13b8bd
4+
Revises: a5d67f2d7356
5+
Create Date: 2025-11-04 23:40:10.340272
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = '24429f13b8bd'
16+
down_revision: Union[str, None] = 'a5d67f2d7356'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
# Alembic doesn't create enum types on table updates, so we need to do it manually
24+
op.execute("""
25+
DO $$
26+
BEGIN
27+
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'agentinputtype') THEN
28+
CREATE TYPE agentinputtype AS ENUM ('TEXT', 'JSON');
29+
END IF;
30+
END $$;
31+
""")
32+
op.add_column('agents', sa.Column('agent_input_type', sa.Enum('TEXT', 'JSON', name='agentinputtype', create_type=False), nullable=True))
33+
# ### end Alembic commands ###
34+
35+
36+
def downgrade() -> None:
37+
# ### commands auto generated by Alembic - please adjust! ###
38+
op.drop_column('agents', 'agent_input_type')
39+
# ### end Alembic commands ###

agentex/database/migrations/migration_history.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
d7addd4229e8 -> 329fbafa4ff9 (head), change_default_acp_to_async
1+
a5d67f2d7356 -> 24429f13b8bd (head), add agent input type
2+
329fbafa4ff9 -> a5d67f2d7356, add unhealthy status
3+
d7addd4229e8 -> 329fbafa4ff9, change_default_acp_to_async
24
09368a02d6cc -> d7addd4229e8, soft delete status
35
739800d3e1ce -> 09368a02d6cc, deployment history
46
dbac39ab82c3 -> 739800d3e1ce, registration metadata

agentex/docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ services:
149149
- MONGODB_URI=mongodb://agentex-mongodb:27017
150150
- MONGODB_DATABASE_NAME=agentex
151151
- WATCHFILES_FORCE_POLLING=true
152+
- ENABLE_HEALTH_CHECK_WORKFLOW=true
153+
- AGENTEX_SERVER_TASK_QUEUE=agentex-server
152154
ports:
153155
- "5003:5003"
154156
volumes:
@@ -187,6 +189,45 @@ services:
187189
retries: 5
188190
start_period: 30s
189191

192+
agentex-temporal-worker:
193+
container_name: agentex-temporal-worker
194+
build:
195+
context: ..
196+
dockerfile: agentex/Dockerfile
197+
target: dev
198+
environment:
199+
- ENVIRONMENT=development
200+
- DATABASE_URL=postgresql://postgres:postgres@agentex-postgres:5432/agentex
201+
- TEMPORAL_ADDRESS=agentex-temporal:7233
202+
- TEMPORAL_HOST=agentex-temporal
203+
- REDIS_URL=redis://agentex-redis:6379
204+
- MONGODB_URI=mongodb://agentex-mongodb:27017
205+
- MONGODB_DATABASE_NAME=agentex
206+
- AGENTEX_SERVER_TASK_QUEUE=agentex-server
207+
volumes:
208+
- .:/app:cached
209+
depends_on:
210+
agentex-temporal:
211+
condition: service_healthy
212+
agentex-redis:
213+
condition: service_healthy
214+
agentex-postgres:
215+
condition: service_healthy
216+
agentex-mongodb:
217+
condition: service_healthy
218+
networks:
219+
- agentex-network
220+
command: |
221+
bash -c "
222+
echo 'Starting Temporal Worker...' &&
223+
export TEMPORAL_ADDRESS=agentex-temporal:7233 &&
224+
export TEMPORAL_HOST=agentex-temporal &&
225+
export MONGODB_URI=mongodb://agentex-mongodb:27017 &&
226+
python src/temporal/run_worker.py
227+
"
228+
user: root
229+
restart: unless-stopped
230+
190231
volumes:
191232
agentex-temporal-postgres-data:
192233
agentex-postgres-data:

agentex/src/adapters/orm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from sqlalchemy.orm import relationship
1818

1919
from src.domain.entities.agent_api_keys import AgentAPIKeyType
20-
from src.domain.entities.agents import AgentStatus
20+
from src.domain.entities.agents import AgentInputType, AgentStatus
2121
from src.domain.entities.tasks import TaskStatus
2222
from src.utils.ids import orm_id
2323

@@ -41,6 +41,7 @@ class AgentORM(BaseORM):
4141
)
4242
registration_metadata = Column(JSONB, nullable=True)
4343
registered_at = Column(DateTime(timezone=True), nullable=True)
44+
agent_input_type = Column(SQLAlchemyEnum(AgentInputType), nullable=True)
4445

4546
# Many-to-Many relationship with tasks
4647
tasks = relationship("TaskORM", secondary="task_agents", back_populates="agents")

agentex/src/adapters/temporal/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)