Skip to content
Open
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
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,28 @@ To set up your development environment for Agentex, please refer to the [README.
1. **Fork** the repository.
2. **Clone** your fork:
```bash
git clone https://github.com/<your-username>/agentex.git
cd agentex
git clone https://github.com/<your-username>/scale-agentex.git
cd scale-agentex
```
3. **Set the original repo as upstream** (recommended):
```bash
git remote add upstream https://github.com/scaleapi/agentex.git
git remote add upstream https://github.com/scaleapi/scale-agentex.git
```
4. **Create a new branch** for your feature or bugfix:
```bash
git checkout -b my-feature-or-bugfix
```
5. **Make your changes.**
Follow project coding style and conventions.
6. **Test your changes:**
6. **Test your changes** (backend; runs from the repo root or from `agentex/`):
```bash
make test
```
Run linter/formatter as required:
Run the linter/formatter checks as required:
```bash
make lint
```
For the developer UI, run `npm run lint`, `npm run typecheck`, and `npm test` inside `agentex-ui/`.
7. **Commit your changes** (see commit message guidelines below).
8. **Push** to your fork:
```bash
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# AgentEx Workspace Makefile
.PHONY: repo-setup help
.PHONY: repo-setup help lint test

repo-setup: ## Setup development environment for the workspace
uv sync --group dev
uv run pre-commit install

lint: ## Run backend lint + format checks (delegates to agentex/)
$(MAKE) -C agentex lint

test: ## Run backend tests (delegates to agentex/; see agentex/Makefile for FILE/NAME/ARGS)
$(MAKE) -C agentex test

help: ## Show this help message
@echo "AgentEx Workspace Commands:"
@echo ""
Expand Down
8 changes: 8 additions & 0 deletions agentex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ docker-build-with-docs: ## Build production Docker image with docs included
# Test Commands
#

lint: ## Check lint and formatting with ruff (same checks as CI)
uv run ruff check src/
uv run ruff format --check src/

lint-fix: ## Auto-fix lint errors and format with ruff
uv run ruff check src/ --fix
uv run ruff format src/

test: ## Run tests (examples: make test FILE=path/to/test.py, make test NAME=pattern, make test ARGS="-v")
@uv run python scripts/run_tests.py \
$(if $(FILE),$(FILE)) \
Expand Down
8 changes: 4 additions & 4 deletions agentex/src/api/routes/checkpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

from fastapi import APIRouter, Response

from src.api.schemas.authorization_types import (
AgentexResourceType,
AuthorizedOperationType,
)
from src.api.schemas.checkpoints import (
BlobResponse,
CheckpointListItem,
Expand All @@ -14,10 +18,6 @@
PutWritesRequest,
WriteResponse,
)
from src.api.schemas.authorization_types import (
AgentexResourceType,
AuthorizedOperationType,
)
from src.domain.use_cases.checkpoints_use_case import DCheckpointsUseCase
from src.utils.authorization_shortcuts import DAuthorizedBodyId
from src.utils.logging import make_logger
Expand Down
4 changes: 1 addition & 3 deletions agentex/src/domain/repositories/checkpoint_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ async def list_checkpoints(
self.async_ro_session_maker() as session,
async_sql_exception_handler(),
):
query = select(CheckpointORM).where(
CheckpointORM.thread_id == thread_id
)
query = select(CheckpointORM).where(CheckpointORM.thread_id == thread_id)

if checkpoint_ns is not None:
query = query.where(CheckpointORM.checkpoint_ns == checkpoint_ns)
Expand Down
6 changes: 5 additions & 1 deletion agentex/src/domain/services/agent_acp_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ async def get_headers(
# message, streaming and cancel (which call get_headers(agent) with no
# request_headers) would drop traceparent and the downstream agent would
# start a detached trace. The inbound headers are on self._request.
inbound_headers = dict(self._request.headers) if getattr(self, "_request", None) is not None else {}
inbound_headers = (
dict(self._request.headers)
if getattr(self, "_request", None) is not None
else {}
)
trace_context_headers = extract_trace_context_headers(inbound_headers)
delegation_headers = self.get_delegation_headers(agent)
auth_headers = await self.get_agent_auth_headers(agent)
Expand Down
1 change: 1 addition & 0 deletions agentex/src/temporal/run_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def build_metrics_url(host_url: str | None) -> str | None:
host = f"[{host}]"
return f"http://{host}:{port}"


# Global worker instance
health_check_worker: Worker | None = None

Expand Down
4 changes: 3 additions & 1 deletion agentex/src/utils/otel_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@

# Module state
_auto_instrumentation_bootstrapped = False
_meter_provider: MeterProvider | None = None # Set only when this module creates the provider
_meter_provider: MeterProvider | None = (
None # Set only when this module creates the provider
)
_initialized: bool = False

DEFAULT_SERVICE_NAME = "agentex"
Expand Down