feat: add experimental agents support (#22290)

feat: add AI chat system with agent tools and chat UI

Introduce the chatd subsystem and Agents UI for AI-powered chat
within Coder workspaces.

- Add chatd package with chat loop, message compaction, prompt
  management, and LLM provider integration (OpenAI, Anthropic)
- Add agent tools: create workspace, list/read templates, read/write/
  edit files, execute commands
- Add chat API endpoints with streaming, message editing, and
  durable reconnection
- Add database schema and migrations for chats, chat messages, chat
  providers, and chat model configs
- Add RBAC policies and dbauthz enforcement for chat resources
- Add Agents UI pages with conversation timeline, queued messages
  list, diff viewer, and model configuration panel
- Add comprehensive test coverage including coderd integration tests,
  chatd unit tests, and Storybook stories
- Gate feature behind experiments flag

---------

Co-authored-by: Cian Johnston <cian@coder.com>
Co-authored-by: Danielle Maywood <danielle@themaywoods.com>
Co-authored-by: Jeremy Ruppel <jeremy@coder.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle Carberry
2026-02-27 11:50:56 -05:00
committed by GitHub
parent 67da4e8b56
commit edee917d88
201 changed files with 44828 additions and 1859 deletions
+29 -3
View File
@@ -109,6 +109,24 @@
vendorHash = "sha256-69kg3qkvEWyCAzjaCSr3a73MNonub9sZTYyGaCW+UTI=";
};
# Keep Terraform aligned with provisioner/terraform/testdata/version.txt
# so `make gen` remains deterministic in Nix shells.
terraform_1_14_1 =
if pkgs.stdenv.isLinux && pkgs.stdenv.hostPlatform.isx86_64 then
pkgs.runCommand "terraform-1.14.1" {
nativeBuildInputs = [ pkgs.unzip ];
src = pkgs.fetchurl {
url = "https://releases.hashicorp.com/terraform/1.14.1/terraform_1.14.1_linux_amd64.zip";
hash = "sha256-n1MHDuYm354VeIfB0/mvPYEHobZUNxzZkEBinu1piyc=";
};
} ''
mkdir -p "$out/bin"
unzip -p "$src" terraform > "$out/bin/terraform"
chmod +x "$out/bin/terraform"
''
else
unstablePkgs.terraform;
# Packages required to build the frontend
frontendPackages =
with pkgs;
@@ -156,7 +174,7 @@
gnused
gnugrep
gnutar
unstablePkgs.go_1_25
unstablePkgs.go_1_26
gofumpt
go-migrate
(pinnedPkgs.golangci-lint)
@@ -170,7 +188,7 @@
lazydocker
lazygit
less
mockgen
unstablePkgs.mockgen
moreutils
nfpm
nix-prefetch-git
@@ -191,7 +209,7 @@
# sqlc
sqlc-custom
syft
unstablePkgs.terraform
terraform_1_14_1
typos
which
# Needed for many LD system libs!
@@ -285,6 +303,14 @@
lib.optionalDrvAttr stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
NODE_OPTIONS = "--max-old-space-size=8192";
BIOME_BINARY =
if pkgs.stdenv.isLinux then
if pkgs.stdenv.hostPlatform.isAarch64 then
"@biomejs/cli-linux-arm64-musl/biome"
else
"@biomejs/cli-linux-x64-musl/biome"
else
"";
GOPRIVATE = "coder.com,cdr.dev,go.coder.com,github.com/cdr,github.com/coder";
};
};