Skip to content

docs: clarify Agents vs Chats API reference pages#26021

Draft
blinkagent[bot] wants to merge 3 commits into
mainfrom
mattvollmer/clarify-agents-chats-api-docs
Draft

docs: clarify Agents vs Chats API reference pages#26021
blinkagent[bot] wants to merge 3 commits into
mainfrom
mattvollmer/clarify-agents-chats-api-docs

Conversation

@blinkagent
Copy link
Copy Markdown
Contributor

@blinkagent blinkagent Bot commented Jun 3, 2026

Problem

The REST API reference page at /docs/reference/api/agents is confusing: by the name alone, a reader looking for the AI Coder Agents programmatic API would assume this is the right page. In fact, those endpoints are for the workspace agent daemon (the coder_agent Terraform resource / workspaceagent daemon). The actual AI Coder Agents API is documented at /docs/reference/api/chats.

Both pages compound the confusion by being rendered with a bare # Agents / # Chats heading and no descriptive intro. The sidebar entries are similarly ambiguous (Agents and Chats with no descriptions).

Root cause

The reference pages are generated by scripts/apidocgen/generate.sh (swag → widdershins → postprocess). The widdershins template (scripts/apidocgen/markdown-template/main.dot) already renders data.resource.description directly under each section heading:

<!-- APIDOCGEN: BEGIN SECTION -->
{{= data.tags.section }}# {{= r}}

{{? data.resource.description }}{{= data.resource.description}}{{?}}

…but the swag annotations in coderd/coderd.go never declared @tag.name / @tag.description for any tag, so the descriptions were always empty.

Changes

  • coderd/coderd.go: add @tag.name Agents / @tag.description … and @tag.name Chats / @tag.description … annotations next to the existing @title / @version block.
  • docs/manifest.json: rename the sidebar entry AgentsWorkspace Agents and add description fields to both API sidebar entries (every other top-level section in the manifest has descriptions; the API children did not).
  • Regenerate coderd/apidoc/swagger.json, coderd/apidoc/docs.go, docs/reference/api/agents.md, and docs/reference/api/chats.md via scripts/apidocgen/generate.sh + pnpm exec markdownlint-cli2 --fix + pnpm exec markdown-table-formatter + scripts/biome_format.sh (matching the Makefile's coderd/apidoc/.gen pipeline).

Resulting diff is intentionally minimal — 6 files, 35 insertions / 3 deletions.

After this PR

The Agents page will render:

Agents

Workspace agent endpoints. These power the workspace agent daemon defined by the coder_agent Terraform resource (sometimes called the workspace daemon). This API is NOT the AI Coder Agents API. For programmatic access to AI Coder Agents (formerly Tasks), see the Chats API.

The Chats page will render:

Chats

Programmatic API for Coder AI Agents (the user-facing "Coder Agents" / "Chats" product). Experimental. Use these endpoints to create, list, and manage AI coding agent sessions. For background and migration from the Tasks API, see the AI Coder docs.

And the sidebar entry for the workspace-agent endpoints becomes Workspace Agents instead of Agents.

Out of scope (potential follow-ups)

  • docs/reference/api/chat.md is a 7-byte stub — likely dead. Could be deleted in a follow-up.
  • Larger rename of the Agents Swagger tag (and/or the coder_agent Terraform resource) to something like Workspace Agents / workspace_daemon would more thoroughly fix the naming collision, but that's a much bigger change.

Created on behalf of @mattvollmer.

The REST API reference pages for /api/v2/workspaceagents (rendered as
# Agents) and /api/experimental/chats (rendered as # Chats) were easy to
confuse because:

  - Both pages had no descriptive intro under the heading.
  - The sidebar entry "Agents" suggests the AI Coder Agents product,
    when in fact those endpoints are the workspace agent daemon
    (coder_agent Terraform resource).

This change:

  - Adds @tag.name / @tag.description annotations for the Agents and
    Chats Swagger tags in coderd/coderd.go. The widdershins template
    already renders data.resource.description directly under the
    section heading, so the descriptions now appear on both pages.
  - Renames the sidebar entry from "Agents" to "Workspace Agents" and
    adds descriptions to both API sidebar entries in docs/manifest.json.
  - Regenerates coderd/apidoc/swagger.json, coderd/apidoc/docs.go, and
    the two affected reference pages.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Docs preview

📖 View docs preview for docs/reference/api/agents.md

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Jun 3, 2026
@blinkagent blinkagent Bot removed the community Pull Requests and issues created by the community. label Jun 3, 2026
blink-so Bot added 2 commits June 3, 2026 11:09
The apidoc postprocess (scripts/apidocgen/postprocess/main.go) regenerates
the REST API sidebar entries from the Swagger tags. It preserves
description / state / icon_path on existing entries by matching them by
title, then always overwrites Title to match the Swagger tag name.

Renaming the sidebar entry from "Agents" to "Workspace Agents" therefore
gets reverted by `make gen`, which causes the CI gen check to fail.

Keep the title as "Agents" (matching the Swagger tag) so the description
survives regeneration. Renaming the sidebar entry would require renaming
the Swagger tag (and all `// @tags Agents` annotations across the
codebase), which is out of scope for this PR.
The repo enforces a no-emdash/endash lint (scripts/check_emdash.sh).
Biome unescaped the JSON \u2014 escape into a literal em dash, which
tripped lint/emdash. Use two sentences instead.
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.

1 participant