Files
coder/coderd
Jeremy RuppelandCoder Agents 8b8c80614d feat: expose template builder agents and per-module agent (#28905)
Part of [DEVEX-556](https://linear.app/codercom/issue/DEVEX-556). Builds
on the base agent metadata added in #28794.

## Summary

Surfaces the backend multi-agent support through the SDK and HTTP API:
the bases endpoint returns each base's agents, and
compose/create-template accept a per-module `agent_name`.

## What changed

- `codersdk/templatebuilder.go`: added `TemplateBuilderBaseAgent`,
`TemplateBuilderBase.Agents`, and
`TemplateBuilderComposeModule.AgentName` (`agent_name,omitempty`).
- `coderd/templatebuilder_handler.go`: added `baseAgentsToSDK`; the
bases endpoint returns agents, and the compose and create-template
endpoints forward `AgentName`.
- `make gen` regenerated `site/src/api/typesGenerated.ts`,
`coderd/apidoc/docs.go`, `coderd/apidoc/swagger.json`,
`docs/reference/api/schemas.md`, and
`docs/reference/api/templatebuilder.md`.
- `wizardState.test.ts`: added `agents: []` to the base fixture now that
the field is required on the generated type.

## Scope

SDK/API plumbing only. `ComposeModule.AgentName` now has a producer (the
handlers) but no caller sets it yet — the wizard UI (follow-up) is what
will populate it. No DB change, so `enterprise/audit/table.go` is
unaffected.

## Testing

- Bases endpoint asserts each base returns agents with exactly one
default (and the `dev`/`main` names).
- Per-module `agent_name` round-trip and unknown-agent (400) compose
tests.
- `make gen` (idempotent), `make fmt` (no changes), `golangci-lint
./coderd/... ./codersdk/...`, the Go template-builder tests, frontend
`tsc` + `biome check`, and docs markdownlint all pass.

<details>
<summary>Design note</summary>

`display_name` is intentionally returned as `""` for now: every base is
single-agent, so no base authors a per-agent label. The field exists for
multi-agent bases where the wizard radio needs a human-readable name;
consumers fall back to the agent `name` when it is empty.

</details>

---
🤖 Generated by Coder Agents on behalf of @jeremyruppel.

Co-authored-by: Coder Agents <agents@coder.com>
2026-09-02 12:51:33 -04:00
..