This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- This repository is a Stainless-generated SDK. Open PRs against the
nextbranch (notmain). Stainless watchesnextand release-please opens release PRs fromnext→main. - PR titles must follow Conventional Commits — the
Validate PR title (Conventional Commits)CI check enforces this on every PR. - The
Validate PR base branchCI check fails on PRs targetingmainfrom non-automation accounts and posts a comment with resolution steps. Add thetarget-mainlabel only for genuine exceptions (e.g. an urgent hotfix). - See
CONTRIBUTING.mdfor the full workflow.
- Use
ryefor dependency management (preferred) - Run
./scripts/bootstrapto set up the environment - Or use
rye sync --all-featuresdirectly
Special note: the individual tutorials maintain their own tutorial specific virtualenv using uv. So when testing/running tutorials, you uv run instead of rye run. Everything else is similar.
- Run tests:
rye run pytestor./scripts/test - Run specific test:
rye run pytest path/to/test_file.py::TestClass::test_method -v - Mock server is automatically started for tests, runs on port 4010
- Format code:
rye run formator./scripts/format- The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run
run rye formatwith additional arguments to constrain the formatting to the files that you are modifying.
- The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run
- Lint code:
rye run lintor./scripts/lint - Type check:
rye run typecheck(runs both pyright and mypy)
- Build package:
rye build
The package provides the agentex CLI with these main commands:
agentex agents- Get, list, run, build, and deploy agentsagentex tasks- Get, list, and delete tasksagentex secrets- Sync, get, list, and delete secretsagentex uv- UV wrapper with AgentEx-specific enhancementsagentex init- Initialize new agent projects
- 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
/src/agentex/- Core SDK and generated API client code/src/agentex/protocol/- Canonical location for wire-protocol shapes (JSON-RPC envelopes, ACP method-param types). Depends only onpydanticand the Stainless-generatedagentex.types.*surface, so it is safe to import from a future slim REST-only install.acp.py-RPCMethod,CreateTaskParams,SendMessageParams,SendEventParams,CancelTaskParams,RPC_SYNC_METHODS,PARAMS_MODEL_BY_METHODjson_rpc.py-JSONRPCRequest,JSONRPCResponse,JSONRPCError
/src/agentex/config/- Canonical location for deployment/agent configuration models (manifest shapes). Depends only onpydantic, so it is safe to import from a slim REST-only install.agent_config.py,build_config.py,deployment_config.py,local_development_config.py,environment_config.py,agent_manifest.py(model classes only), plus their model depscredentials.pyandagent_configs.py- yaml loaders / build machinery (
load_environments_config*,load_agent_manifest,build_context_manager,BuildContextManager) stay inagentex.lib.sdk.config.*so these models stay slim-safe
/src/agentex/lib/- Custom library code (not modified by code generator)/cli/- Command-line interface implementation/core/- Core services, adapters, and temporal workflows/sdk/- SDK utilities and FastACP implementationconfig/- manifest loaders + Docker build machinery (agent_manifest'sload_agent_manifest/build_context_manager/BuildContextManager,validation,project_config) plus back-compat shims for the model classes now canonical underagentex.config.*
/types/- Custom type definitionsacp.py,json_rpc.py- back-compat shims re-exporting fromagentex.protocol.*.credentials.py,agent_configs.py- shims re-exporting fromagentex.config.*. Existingfrom agentex.lib...imports keep working; new code should import from the canonical paths.- Other modules (
tracing,agent_card,fastacp,llm_messages,converters, etc.) stay here — they have heavier transitive deps (temporal, openai-agents, model_utils/yaml) and aren't slim-safe.
/utils/- Utility functions
/examples/- Example implementations and tutorials/tests/- Test suites
SDK Architecture:
- Client Layer: HTTP client for AgentEx API (
_client.py,resources/) - CLI Layer: Typer-based command interface (
lib/cli/) - Core Services: Temporal workflows, adapters, and services (
lib/core/) - FastACP: Fast Agent Communication Protocol implementation (
lib/sdk/fastacp/) - State Machine: Workflow state management (
lib/sdk/state_machine/)
Temporal Integration:
- Workflow definitions in
lib/core/temporal/ - Activity definitions for different providers
- Worker implementations for running temporal workflows
Agent Framework:
- Manifest-driven agent configuration
- Support for multiple agent types (sync, temporal-based)
- Debugging support with VS Code integration
Most SDK code is auto-generated. Manual changes are preserved in:
src/agentex/lib/directoryexamples/directory- Merge conflicts may occur between manual patches and generator changes
temporalio- Temporal workflow enginetyper- CLI frameworkpydantic- Data validationhttpx- HTTP clientfastapi- Web frameworkruff- Linting and formattingpytest- Testing framework
- Python 3.12+ required
- Uses Rye for dependency management
- Supports both sync and async client patterns