Skip to content

docs: add Tasks to Chats API migration guide#24841

Merged
david-fraley merged 17 commits into
mainfrom
docs/tasks-to-chats-migration
May 5, 2026
Merged

docs: add Tasks to Chats API migration guide#24841
david-fraley merged 17 commits into
mainfrom
docs/tasks-to-chats-migration

Conversation

@david-fraley

@david-fraley david-fraley commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Linear: CODAGT-157 (Tasks → Chats migration guide for the May Beta).

New page at docs/ai-coder/agents/tasks-to-chats-migration.md plus a manifest.json nav entry.

The guide maps each Tasks API endpoint, request shape, status, and lifecycle operation onto the experimental Chats API, with explicit before/after curl examples, a step-by-step migration plan, a how-to-test section, and a CLI/GHA migration table.

Cross-checks against main and in-flight PRs

Reviewed against codersdk/chats.go, coderd/exp_chats.go, and coderd/coderd.go to confirm endpoint paths, request shapes, and status values match what the server actually accepts and emits. Also reconciled with these open PRs that touch the same surface:

PR What it changes How this guide handles it
#24432. Remove agents experiment flag The CODER_EXPERIMENTS="agents" setup step disappears for May Beta Step 1 and the testing section call this out as transitional; CLI section references the planned coder agents graduation
#24826. Beta rename Early Access becomes Beta across the agents docs Wording uses "Beta" framing in the experiment notes; nav state left as early access to merge cleanly with current manifest.json and flip in #24826's pass
#24828. Chat statuses correction Drops paused/completed from the chats-api.md status table because no production path on main sets them Status mapping table here matches: only pending/running/waiting/error/requires_action are presented as live states; paused/completed are explicitly called out as enum-only
#24830. Generate Chats API docs from swagger Replaces hand-maintained chats-api.md with docs/reference/api/chats.md Internal links still point at chats-api.md for now; will be repointed in #24830's follow-up if it merges first
CODAGT-127. coder/create-agent-chat-action GHA New action with create-task-action parity in development GHA section keeps the inline curl example but adds a callout for the dedicated action

Fixes applied during review

  1. docs/manifest.json indentation was broken. The patch chunk had misaligned tabs that left ]\t\t\t\t} on a single line. JSON parsed but rendered oddly. Re-indented to match the surrounding nav entries.
  2. Missing organization_id in the create-chat example. POST /api/experimental/chats rejects requests without it (organization_id is required., coderd/exp_chats.go:616). Added to the example body and the "Key differences" list.
  3. Status table was wrong. Listed paused and completed as live Chats statuses. Per docs(docs/ai-coder/agents): correct chat statuses, watch events, auto-archive default, and add attach_file tool #24828 (and a grep against main), neither is set by any production code path; they exist only in codersdk.ChatStatus for future use. Replaced the row mapping paused -> paused with a note explaining the workspace-pause vs. agent-interrupt difference, added a row for requires_action, and clarified that waiting is the canonical "agent is done" state.
  4. agents experiment framed as required. Flagged as transitional in three places (note callout, Step 1, testing section, checklist) so readers on the May Beta release don't get confused by a CODER_EXPERIMENTS flag that no longer exists.
  5. CLI section claimed there were no Chats CLI commands. coder exp agents exists today (cli/exp_agents.go) and is graduating to coder agents per chore: remove agents experiment flag and mark feature as beta #24432. Replaced the "no CLI yet" wording with the actual command and the planned rename.
  6. GHA section. Added a forward reference to the dedicated coder/create-agent-chat-action (CODAGT-127) so readers know an inline curl is the v0 pattern.
  7. lint/typos false positive. The example "template_version_id": "0ba39c92-..." tripped the ba to by/be rule. Replaced with <template-version-uuid> placeholder.
  8. lint/emdash failures. CI's scripts/check_emdash.sh rejects U+2014/U+2013 in the diff. Restructured prose with periods, semicolons, and parentheses; replaced empty-cell em-dash placeholders in tables with n/a. No semantic change.

Validation

  • pnpm exec markdownlint-cli2 docs/ai-coder/agents/tasks-to-chats-migration.md returns 0 errors
  • pnpm exec markdown-table-formatter docs/ai-coder/agents/tasks-to-chats-migration.md is stable (no diff after rerun)
  • python3 -c "import json; json.load(open('docs/manifest.json'))" reports valid JSON
  • make pre-commit-light (via githook) passes all checks
  • grep -P "\xE2\x80\x94|\xE2\x80\x93" docs/ai-coder/agents/tasks-to-chats-migration.md docs/manifest.json returns no matches
  • Cross-checked endpoint paths in coderd/coderd.go (tasks routes, line 1948) and coderd/exp_chats.go against the doc's endpoint mapping table

Proof

Text-only docs change. Visible-string diffs are in the commits. The doc preview on coder.com is linked from the PR comment (Docs preview) once CI rebuilds.

Notes on what was intentionally not changed in this PR

Coder Agent generated this PR description on @david-fraley's behalf.

Add a migration guide for customers moving from the Tasks API
(/api/v2/tasks) to the Chats API (/api/experimental/chats) for
Coder Agents. Covers endpoint mapping, architectural differences,
step-by-step migration instructions, template recommendations,
and GitHub Actions integration updates.

🤖 Generated with [Coder Agents](https://coder.com/docs/ai-coder/agents)
Walk through verifying each step of the Chats API integration:
experiment flag, LLM provider, chat creation, WebSocket streaming,
follow-ups, workspace provisioning, interrupt, and archive/restore.
Includes a quick checklist for CI or manual validation.

🤖 Generated with [Coder Agents](https://coder.com/docs/ai-coder/agents)
@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview

…tation

Cross-checked against codersdk.ChatStatus, exp_chats.go, and in-flight
PRs (#24432 removes the agents experiment flag, #24828 documents which
chat statuses are actually set on main).

- docs/manifest.json: fix tab indentation that broke the closing brace
- migration guide:
  - flag the agents experiment requirement as transitional (going away
    in May Beta per #24432)
  - require organization_id in the create-chat curl example (it is
    required by the API; was missing)
  - rewrite status table: paused/completed enum values exist but no
    production path on main currently sets them; add requires_action
  - replace 'no CLI yet' wording with the actual coder exp agents TUI
    and the planned coder agents graduation
  - add a note that a coder/create-agent-chat-action GHA is in flight
    (CODAGT-127)
  - frame the testing section's experiment check as transitional
  - replace UUID placeholder that tripped lint/typos

Linear: CODAGT-157

> Coder Agent generated this commit on @david-fraley's behalf.
@david-fraley david-fraley changed the title Docs/tasks to chats migration docs(ai-coder/agents): add Tasks to Chats API migration guide Apr 30, 2026
CI's lint/emdash check (scripts/check_emdash.sh) flags U+2014 in the
diff. Restructure prose with periods/semicolons/parentheses and
replace empty-cell em-dash placeholders with 'n/a' to satisfy the
check. No semantic change.

> Coder Agent generated this commit on @david-fraley's behalf.
@david-fraley david-fraley changed the title docs(ai-coder/agents): add Tasks to Chats API migration guide docs(docs): add Tasks to Chats API migration guide Apr 30, 2026
@david-fraley david-fraley changed the title docs(docs): add Tasks to Chats API migration guide docs: add Tasks to Chats API migration guide Apr 30, 2026
@david-fraley david-fraley marked this pull request as ready for review April 30, 2026 20:16
Reframe the section so the deprecation drives the migration. Calls
out the v2.36 cutoff and the Premium-only ESR fallback that PR #24831
adds to the Tasks page, instead of leaving the choice as 'if you are
adopting Coder Agents'.

Linear: CODAGT-157
Refs: #24831

\u003e Coder Agent generated this commit on @david-fraley's behalf.
The action exists at coder/create-agent-chat-action and is the supported
migration path for create-task-action workflows. Rewrite the GHA section
to point users at the action instead of an inline curl, with a note that
new features are actively shipping.

Linear: CODAGT-157

> Coder Agent generated this commit on @david-fraley's behalf.
Two regressions from 8c0a1b2 that fail markdownlint and would block CI:

- MD009: trailing space after the new getting-started link
- MD051: stale '#2-configure-an-llm-provider' fragment in the testing
  section now that the experiment step is removed and Configure an LLM
  provider is step 1

> Coder Agent generated this commit on @david-fraley's behalf.
Match the migration-steps section, which no longer enables the agents
experiment. Renumber remaining test steps 2-8 to 1-7 and remove the
matching checklist item.

> Coder Agent generated this commit on @david-fraley's behalf.
The previous step relied on the agent picking the right template and
auto-provisioning a workspace, which is hard to verify against. Replace
with a UI flow that asks the user to create a workspace from the
converted template, attach it to a chat from the composer, and confirm
the chat drives that workspace.

Update the matching checklist item.

> Coder Agent generated this commit on @david-fraley's behalf.
Pre-creating a workspace from a known template via POST /workspaces and
passing its workspace_id on chat creation gives users the
template_version_id-style determinism they had with Tasks. Add it as a
best-practice subsection right before the testing flow.

> Coder Agent generated this commit on @david-fraley's behalf.
Drop the 'best practice' framing in favor of presenting the
pre-created-workspace flow as one option for deterministic results.

> Coder Agent generated this commit on @david-fraley's behalf.
'Option:' read like a config-UI label. Switch to 'Pre-creating a
workspace for deterministic results', which matches the topic-noun
style of nearby subsections (What to include in agent templates, What
to remove from migrated task templates).

> Coder Agent generated this commit on @david-fraley's behalf.
- Drop CODER_EXPERIMENTS=agents references; the flag was removed by #24432
- Keep 'coder exp agents' per @david-fraley's direction (the API is still
  experimental) even though #24432 also graduated the CLI to 'coder agents'
- Repoint chats-api.md link to ../../reference/api/chats.md (deletion in #24830)
- Flip manifest state to beta to match the rest of /agents/ post-#24826
- Clarify that 'waiting' is both the initial idle state and the post-
  completion idle state in the status mapping table

Copy link
Copy Markdown
Collaborator Author

Pushed updates addressing the accuracy-check findings:

This is Coder Agents responding on @david-fraley's behalf.

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggest merging #24830 first and adding links as appropriate.

Comment thread docs/manifest.json Outdated
mattvollmer added a commit that referenced this pull request May 4, 2026
…#24929)

Updates `docs/ai-coder/index.md`, `docs/ai-coder/best-practices.md`, and
`docs/ai-coder/ai-governance.md` to point readers at Coder Agents and
the AI Governance Add-On instead of Coder Tasks and Agent Firewall
(CODAGT-157).

## Changes

- `docs/ai-coder/index.md`:
- Rename `## Agents with Coder Tasks` to `## Coder Agents`. Drop the
Devin / ChatGPT Codex name-drops and the Tasks pitch. New copy points at
`./agents/index.md`, names the agent loop in the control plane, and
notes that workspaces can be completely network isolated. Image swapped
from `tasks-ui.png` to `agents-hero-image.png` (the hero shot added in
#24915).
- Replace the `## Secure Your Workflows with Agent Firewall` section
with `## Govern AI activity with the AI Governance Add-On`. The new
section opens with adoption-first framing (visibility, guardrails, cost)
and links to `./ai-governance.md`, with bulleted callouts for AI
Gateway, Agent Firewall, and the expanded Agent Workspace Build
allowance the add-on bundles.
- `docs/ai-coder/best-practices.md`:
- In the use-case table, swap `[Tasks](./tasks.md)` to `[Coder
Agents](./agents/index.md)` for the developer-led-investigation and
prototyping rows, and swap the "Tasks API *(in development)*" cell to
`[Coder Agents API](./agents/chats-api.md)` for the background-jobs row.
Retitle the Security section link from "securing agents with Coder
Tasks" to "securing AI agents" since `security.md` does not actually
mention Tasks. Re-ran `markdown-table-formatter` to repad column widths.
- In `## Provide Agents with Proper Context`, add a paragraph describing
how context is provided in Coder Agents (admin-configured system
prompts, centrally registered MCP servers, and skills shipped from repos
or templates under `.agents/skills/`), with a transition line clarifying
that the existing Memory and Tools subsections cover BYO-agent patterns.
- `docs/ai-coder/ai-governance.md`: drop the "Additional Tasks Use (via
Agent Workspace Builds)" bullet from the intro feature list and the
"Expanding the use of Coder Tasks for AI-driven background work" bullet
from the audience list. The `## How Coder Tasks usage is measured`
section and the rest of the Tasks-related prose on this page are
intentionally left for a follow-up PR.

## Notes for the reviewer

- The `[Coder Agents API](./agents/chats-api.md)` link in
`best-practices.md` will need to be retargeted if #24830 (which replaces
`agents/chats-api.md` with auto-generated `reference/api/chats.md`)
lands first.
- This is the first slice of the Tasks-references audit. Remaining files
(`tasks-core-principles.md`, `tasks-lifecycle.md`, `tasks-migration.md`,
`cli.md`, `github-to-tasks.md`, `agent-compatibility.md`, the rest of
`ai-governance.md`, `custom-agents.md`,
`ai-gateway/clients/claude-code.md`, `manifest.json`,
`reference/api/tasks.md`, the `task*` CLI references, the ESR upgrade
guide, `feature-stages.md`, `workspace-scheduling.md`,
`shared-workspaces.md`) will land in follow-up PRs against the same
Linear ticket. Open PRs #24831, #24833, and #24841 cover separate slices
and do not touch any file in this PR.
- Validation: `markdownlint-cli2`, `markdown-table-formatter`,
`scripts/check_emdash.sh`, and `make pre-commit-light` all pass.

PR generated with Coder Agents.
@david-fraley david-fraley enabled auto-merge (squash) May 5, 2026 13:10
@david-fraley david-fraley merged commit f585d3e into main May 5, 2026
27 checks passed
@david-fraley david-fraley deleted the docs/tasks-to-chats-migration branch May 5, 2026 13:14
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants