Reduce repeated database/server fixtures and fixed timer waits in chat tests without changing production code or assertions. `TestTransitionMatrix_AllCombinations` shares one database and seeded dependencies across 272 leaves, with a unique chat and recording publisher per leaf. `TestPostChatFile` shares one authenticated client across 20 upload leaves. `TestResolveFallbackModelConfigID` shares one database with independently seeded model configurations. The requires-action test closes its server after the expected state persists; the stopped-workspace test advances a trapped Quartz validation timer; two tool-filtering tests no longer start unused workspace agents. | Test | Before | After | |---|---|---| | `chatstate/TestTransitionMatrix_AllCombinations` (272 leaves) | 94.06s | 16.86s | | `coderd/TestPostChatFile` (20 leaves) | 31.23s | 0.95s | | `chatd/TestRequiresActionChatPersistsWaitingStatusLabel` | 11.21s | 1.25s | | `chatd/TestSubagentChatExcludesWorkspaceProvisioningTools` | 7.90s | 2.84s | | `chatd/TestPlanModeSubagentChatExcludesAskUserQuestion` | 8.25s | 3.00s | | `chatd/TestStoppedWorkspaceWithPersistedAgentBindingDoesNotBlockChat` | 6.91s | 1.91s | | `chatd/TestResolveFallbackModelConfigID` (12 leaves) | 7.58s | 0.34s | Independent review measurements on September 18, 2026: median summed leaf time from two runs per side in A/B/B/A order, comparing base `0ea777a341` with head `e378f9e936`. Every run used `-tags=testsmallbatch -count=1 -v -p 1 -parallel 8`, PostgreSQL 17, and the same test selection per package. Other agents shared the host, so absolute times varied. The speedups reproduced, but not the original ratios: the matrix improved 5.58x and uploads 32.87x. Summed leaf time excludes shared parent fixture setup and cleanup; it is not package wall time. Median package elapsed was 19.26s to 9.76s for the full `chatstate` package, 4.47s to 1.28s for `coderd` with only `TestPostChatFile`, and 11.43s to 3.36s for the five targeted `chatd` tests. Compilation time is excluded. <details> <summary>Investigation notes</summary> - Transition matrix: the shared user, organization, membership, provider, and model are not mutated by any leaf. Each leaf seeds its own chat, messages, and queue, and copies the fixture with a new recording publisher (`transitions_matrix_test.go:617,728,762`). `ChatMachine.Update` still opens real transactions on the shared database store; no outer transaction masks rollback assertions (`chatstate/machine.go:161`, `transitions_helpers_test.go:891`). Parent cleanup runs after every leaf. - Requires-action: the old idle hook reached its 10s timeout because the runner remains active while awaiting dynamic-tool results (`testhooks.go:14`, `worker.go:114`). The test now waits for the persisted status and label, closes and drains the server, and retains the no-web-push assertion (`chatd_test.go:3072`). - Stale binding: the test injects a new Quartz mock, traps the 5s validation timer, waits for `MustRelease` to finish timer registration and for the dial to start, then advances the clock (`chatd_test.go:4907`). The one-dial, model-call, and unavailable-workspace tool-result assertions remain intact. - Tool filtering: both tests create templates but no workspace, and their mocked model only invokes `spawn_agent` before returning text. The removed workspace agents could not authenticate and were never used by the tested flow; their shutdown added about 5s (`chatd_test.go:229,384`). - Fallback models: configurations and providers are independently inserted. Most leaves use unique organizations; the two default-organization cases insert distinct models, and only one inserts a default. No leaf mutates another leaf's model or provider (`chatd_internal_test.go:3512`). Validation: all changed tests passed with `-count=5` and `-race -count=2`; the full `chatstate` package passed both checks (2,350 and 940 test executions, including parents). All 272 matrix, 20 upload, and 12 fallback leaves remain present. `gofmt -l`, `git diff --check`, and `golangci-lint run` on the three changed packages were clean. The full `coderd` package was not run. No correctness changes were needed during review. `ARCHITECTURE.md` was read; this test-only PR does not affect the documented architecture, so no TODO or architecture edit is needed. </details> _Investigated, implemented, and validated by Coder Agents on behalf of @ibetitsmike._
Coder is a self-hosted platform for cloud development environments and AI coding agents. Workspaces are defined with Terraform, connected through a secure Wireguard® tunnel, and automatically shut down when not used. Coder Agents runs a native AI coding agent whose loop executes in the control plane on your infrastructure, with no API keys in workspaces.
- Define cloud development environments in Terraform
- EC2 VMs, Kubernetes Pods, Docker Containers, etc.
- Automatically shutdown idle resources to save on costs
- Onboard developers in seconds instead of days
- Delegate coding work to AI agents on your infrastructure
- Bring any model (Anthropic, OpenAI, Google, Bedrock, self-hosted)
- No LLM credentials in workspaces, user identity on every action
- Centralized model governance, cost tracking, and audit logging
Quickstart
Check out our install guides for other methods and a complete tutorial.
Try Coder with the install script on Linux and macOS, or grab the latest binary or installer from GitHub Releases on Windows:
curl -fsSL https://coder.com/install.sh | sh
Start the server and open http://localhost:3000 to create your initial user, create a Docker template, and provision your first workspace:
coder server
For a production deployment, add a PostgreSQL database (version 13 or later) and an external access URL, and see our validated architectures for sizing and infrastructure guidance:
coder server --postgres-url <url> --access-url <url>
Without these flags, Coder uses a built-in database and sets up a *.try.coder.app access URL for evaluation. Use coder --help for the full list of flags and environment variables.
Documentation
Browse the documentation or visit a specific section below:
- Workspaces: Workspaces contain the IDEs, dependencies, and configuration information needed for software development
- Templates: Templates are written in Terraform and describe the infrastructure for workspaces
- Coder Agents: Delegate coding work to AI agents running on your self-hosted infrastructure
- AI Gateway: Centralize authentication, auditing, and cost controls for AI tooling
- Administration: Learn how to operate Coder
- Premium: Learn about paid features built for large teams
- IDEs: Connect your existing editor to a workspace
Support
Open an issue for bugs and feature requests.
For community support, showcasing what you built, and feedback on in-progress features, join our Discord or GitHub Discussions.
Dedicated support is included in Coder Premium. For more information, visit coder.com/pricing.
Integrations
New integrations are always in progress. Open an issue to request one. Contributions are welcome in any official or community repository.
Official
- Coder Registry: Templates, modules, and integrations for common development environments
- Coding Agents: Run agents like Claude Code, Codex, and OpenCode isolated in Coder workspaces
- coderd Terraform Provider: Declaratively manage your Coder deployment configuration as code
- VS Code Extension: Open any Coder workspace in VS Code with a single click
- JetBrains Toolbox Plugin: Open any Coder workspace from JetBrains Toolbox with a single click
- Dev Containers: Build development environments using
devcontainer.jsonon Docker, Kubernetes, and OpenShift - Kubernetes Log Stream: Stream Kubernetes Pod events to the Coder startup logs
- Self-Hosted VS Code Extension Marketplace: A private extension marketplace that works in restricted or airgapped networks integrating with code-server.
- GitHub Actions: An action to set up the Coder CLI in GitHub workflows
Community
- Coder Discord: Chat with the community, get support, and hear about new product updates first
- Community Templates: Community-contributed workspace templates in the Coder Registry
- Community Modules: Community-contributed modules to extend Coder templates
- Coder Template GitHub Action: A GitHub Action that updates Coder templates
- Coder Agents Chat Action: A GitHub Action that starts a Coder Agents chat against a GitHub issue or pull request
Contributing
New contributors are always welcome. If you are new to the Coder codebase, see the contribution guide to get started.
Hiring
Apply on the careers page if you are interested in joining the team.
