Skip to content

Add agent-swarms E2E sample#18

Open
larohra wants to merge 4 commits into
previewfrom
larohra/add-swarms-sample
Open

Add agent-swarms E2E sample#18
larohra wants to merge 4 commits into
previewfrom
larohra/add-swarms-sample

Conversation

@larohra
Copy link
Copy Markdown
Collaborator

@larohra larohra commented May 5, 2026

This pull request introduces a comprehensive, deployable sample called agent-swarms for orchestrating agent swarms using Durable Task Scheduler and ACA Sandboxes. The sample demonstrates how to plan, execute, review, and publish code changes to a GitHub repository using GitHub Copilot, with full Azure infrastructure-as-code, deployment automation, and detailed documentation. Key additions include the sample's code, deployment scripts, Dockerfile, and extensive documentation for setup, architecture, and usage.

Major additions and improvements:

1. New Sample: Agent Swarms

  • Added a new end-to-end sample, agent-swarms, illustrating how to orchestrate agent swarms with Durable Task Scheduler and ACA Sandboxes, including a FastAPI service, deployment automation, and integration with GitHub Copilot. [1] [2]

2. Documentation

  • Added a detailed README.md for agent-swarms covering prerequisites, deployment steps, API usage, token handling, customization, local development, and cleanup.
  • Added an architecture.md document explaining the system's components, flow, and validation anchors.

3. Deployment and Infrastructure

  • Introduced azure.yaml for azd deployment, specifying preprovision hooks, Bicep infra, and container app service configuration.
  • Added .dockerignore and .gitignore files to ensure clean Docker builds and proper source control hygiene. [1] [2]
  • Added a multi-stage Dockerfile to build and package the FastAPI app with all dependencies, including vendored Azure SDKs and Copilot SDK, for deployment to Azure Container Apps.

4. Repository Organization

  • Updated the root README.md to include the new agent-swarms sample in the samples table, making it discoverable for users.

Verify that the following are valid

  • ...

Other Information

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new end-to-end samples/agent-swarms sample that packages a FastAPI-based swarm orchestration service, ACA sandbox execution adapters, Azure deployment assets, and sample-specific docs/tests so users can deploy and run agent swarms against GitHub repos.

Changes:

  • Adds the new agent-swarms sample application, including API, orchestration, storage, sandbox, auth, and GitHub publishing code.
  • Adds deployment assets for azd, Bicep, Docker packaging, sandbox-image creation, and sample-local configuration.
  • Adds contract/integration-style tests plus sample README/quickstart/architecture/troubleshooting docs and links the sample from the repo root README.

Reviewed changes

Copilot reviewed 55 out of 56 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
samples/agent-swarms/tests/test_sandbox_adapter_contract.py Adds contract tests for log tailing and redaction helpers.
samples/agent-swarms/tests/test_request_validation_contract.py Adds request/settings validation contract tests.
samples/agent-swarms/tests/test_public_http_contract.py Adds API/OpenAPI/SSE contract coverage for public routes.
samples/agent-swarms/tests/test_external_sample_layout.py Verifies docs/infra/layout expectations for the sample.
samples/agent-swarms/tests/contract_support.py Adds shared test helpers for imports, paths, OpenAPI, and scratch files.
samples/agent-swarms/src/agent_swarm_service/services/swarm_runs.py Implements the main run service facade over orchestration and secret storage.
samples/agent-swarms/src/agent_swarm_service/services/__init__.py Adds service package marker.
samples/agent-swarms/src/agent_swarm_service/sandboxes/workspace.py Adds sandbox workspace staging/read helpers.
samples/agent-swarms/src/agent_swarm_service/sandboxes/sandbox_groups.py Re-exports sandbox group client type.
samples/agent-swarms/src/agent_swarm_service/sandboxes/logs.py Adds sandbox log redaction and local tail helpers.
samples/agent-swarms/src/agent_swarm_service/sandboxes/aca_client.py Adds small ACA sandbox handle helpers.
samples/agent-swarms/src/agent_swarm_service/sandboxes/__init__.py Adds sandbox package marker.
samples/agent-swarms/src/agent_swarm_service/runtime/storage.py Adds in-memory/Azure storage backends for runtime state, queues, and leases.
samples/agent-swarms/src/agent_swarm_service/runtime/__init__.py Re-exports runtime storage types/helpers.
samples/agent-swarms/src/agent_swarm_service/orchestration/sandbox_execution.py Implements planner/worker/reviewer/merge sandbox execution flow.
samples/agent-swarms/src/agent_swarm_service/orchestration/projections.py Builds summary/plan/tasks/details/event projection responses.
samples/agent-swarms/src/agent_swarm_service/orchestration/models.py Defines swarm domain/config/projection models.
samples/agent-swarms/src/agent_swarm_service/orchestration/__init__.py Adds orchestration package marker.
samples/agent-swarms/src/agent_swarm_service/github/publishing.py Adds GitHub PR publishing integration.
samples/agent-swarms/src/agent_swarm_service/github/__init__.py Adds GitHub package marker.
samples/agent-swarms/src/agent_swarm_service/dependencies.py Adds FastAPI dependency providers and sandbox log chunk helper.
samples/agent-swarms/src/agent_swarm_service/config.py Adds typed environment/settings loading and defaults.
samples/agent-swarms/src/agent_swarm_service/auth/session_store.py Adds run-scoped GitHub PAT storage abstractions.
samples/agent-swarms/src/agent_swarm_service/auth/__init__.py Adds auth package marker.
samples/agent-swarms/src/agent_swarm_service/app.py Wires the FastAPI app, runtime host, storage, clients, and routers.
samples/agent-swarms/src/agent_swarm_service/api/sse.py Adds SSE event formatting helper.
samples/agent-swarms/src/agent_swarm_service/api/schemas.py Defines request/response schemas for the public API.
samples/agent-swarms/src/agent_swarm_service/api/routers/swarm_runs.py Adds run CRUD/control/SSE/logstream routes.
samples/agent-swarms/src/agent_swarm_service/api/routers/health.py Adds /health and /api/health routes.
samples/agent-swarms/src/agent_swarm_service/api/routers/__init__.py Adds router package marker.
samples/agent-swarms/src/agent_swarm_service/api/__init__.py Adds API package marker.
samples/agent-swarms/src/agent_swarm_service/__init__.py Adds package version export.
samples/agent-swarms/sandbox-image/run-role.py Adds baked sandbox entrypoint launcher.
samples/agent-swarms/sandbox-image/README.md Documents building/pushing/registering the sandbox disk image.
samples/agent-swarms/sandbox-image/Dockerfile Builds the private sandbox image contract.
samples/agent-swarms/README.md Adds main sample documentation and usage instructions.
samples/agent-swarms/pyproject.toml Declares sample package metadata and Python dependencies.
samples/agent-swarms/infra/main.parameters.json Adds azd/Bicep parameter defaults.
samples/agent-swarms/infra/main.bicep Provisions Azure resources for the sample.
samples/agent-swarms/hooks/preprovision.sh Registers required Azure providers on POSIX.
samples/agent-swarms/hooks/preprovision.ps1 Registers required Azure providers on Windows.
samples/agent-swarms/docs/troubleshooting.md Adds deployment/runtime troubleshooting guidance.
samples/agent-swarms/docs/quickstart.md Adds step-by-step deployment guide.
samples/agent-swarms/docs/architecture.md Documents sample architecture and runtime flow.
samples/agent-swarms/Dockerfile Adds the app container build for azd deployment.
samples/agent-swarms/azure.yaml Adds azd project/service configuration.
samples/agent-swarms/.gitignore Adds sample-local git ignore rules.
samples/agent-swarms/.dockerignore Adds Docker build context exclusions.
README.md Adds the new sample to the repo-level samples list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/agent-swarms/tests/contract_support.py Outdated
Comment thread samples/agent-swarms/Dockerfile
Comment thread samples/agent-swarms/src/agent_swarm_service/config.py
Comment thread samples/agent-swarms/docs/quickstart.md Outdated
Comment thread samples/agent-swarms/docs/quickstart.md Outdated
Comment thread samples/agent-swarms/pyproject.toml Outdated
Comment thread samples/agent-swarms/tests/test_request_validation_contract.py Outdated
Comment thread samples/agent-swarms/src/agent_swarm_service/api/routers/swarm_runs.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants