Skip to content

docs(docs/ai-coder/agents): correct chat statuses, watch events, auto-archive default, and add attach_file tool#24828

Merged
david-fraley merged 3 commits into
mainfrom
dfraley/docs-agents-quick-fixes
May 5, 2026
Merged

docs(docs/ai-coder/agents): correct chat statuses, watch events, auto-archive default, and add attach_file tool#24828
david-fraley merged 3 commits into
mainfrom
dfraley/docs-agents-quick-fixes

Conversation

@david-fraley
Copy link
Copy Markdown
Collaborator

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

Linear: CODAGT-157.

Four small fixes in docs/ai-coder/agents/ that surfaced during the Beta-rollout audit. Each is a doc-vs-code mismatch I verified against main. No behavior change.

What changes

1. Drop paused and completed from the chat statuses table

chats-api.md lists both as user-visible chat states. They are defined in codersdk/chats.go (and in the database enum) but no production path on main ever transitions a chat into either status today. PR #24264 (April 17) removed them from this table for that reason; PR #24642 (April 24, auto-archive) unintentionally re-added them. This restores the corrected table.

 | `running`         | Agent is actively working.                                                   |
-| `paused`          | Agent is paused (for example, waiting for user input).                       |
-| `completed`       | Agent finished and the task is complete.                                     |
 | `error`           | Agent encountered an error.                                                  |

2. Add action_required to the watch event-kinds table

ChatWatchEventKindActionRequired = "action_required" (codersdk/chats.go:1410) is emitted when a chat enters the requires_action state, but the doc table had no row for it. Anyone driving UI off GET /api/experimental/chats/watch cannot use the event without it being documented.

+| `action_required`    | A chat is waiting for a tool result. |
 | `deleted`            | A chat was deleted.                  |

3. Correct the auto-archive default to 0 (disabled)

DefaultChatAutoArchiveDays int32 = 0 in codersdk/chats.go:801. The doc said 90, both in prose and in the curl-output example.

-exempt. `0` disables the feature; the default is 90.
+exempt. `0` disables the feature, which is the default.
 ...
-# { "auto_archive_days": 90 }
+# { "auto_archive_days": 0 }

platform-controls/chat-auto-archive.md was already correct on this point.

4. Add the attach_file built-in tool to the tool tables

Implemented in coderd/x/chatd/chattool/attachfile.go:27 with the description “Attach a workspace file to the current chat so the user can download it directly from the conversation.” The tool is missing from both tool-list tables.

  | `process_signal`   ... |
+ | `attach_file`      ... |
  | `spawn_agent` ...      |

Added to index.md (Built-in tools) and architecture.md (Workspace tools).

What was dropped from this PR

An earlier revision widened the file-uploads supported-formats line in chats-api.md to mention text/plain, text/markdown, text/csv, application/json, and application/pdf alongside the four image types, citing the server-side allowlist in coderd/x/chatfiles/mime.go. Per review, the chat UI is image-only end-to-end (file picker uses accept="image/*", drag-drop filters with f.type.startsWith("image/"), native paste filters the same way). Widening the doc would imply a UX surface that does not exist, so the bullet was reverted to the original image-only wording. The server allowlist will be revisited as a separate change once a UI surface for non-image attachments lands.

Files

  • docs/ai-coder/agents/chats-api.md (3 of the 4 fixes)
  • docs/ai-coder/agents/index.md (attach_file row)
  • docs/ai-coder/agents/architecture.md (attach_file row)

The larger-than-expected architecture.md diff is the markdown table formatter re-padding column widths to accommodate the longer description in the new attach_file row. No content drift outside the new row.

Validation

  • pnpm exec markdownlint-cli2 … → 0 errors
  • pnpm exec markdown-table-formatter … → stable (re-run produces no diff)
  • bash scripts/check_emdash.sh → OK
  • Cross-checked each claim against main:
    • grep -n DefaultChatAutoArchiveDays codersdk/chats.goconst … int32 = 0
    • grep -n ChatWatchEventKindActionRequired codersdk/chats.go"action_required"
    • grep -n attach_file coderd/x/chatd/chattool/attachfile.go → tool registered
    • grep -rn ChatStatusPaused\\|ChatStatusCompleted … | grep -v _test.go | grep -v models.go → only enum-listing call sites; no production setter on main

Proof

Docs-text change with no UI/UX impact. The visible-string diffs are above. If reviewers want rendered before/after, I can attach screenshots.


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

… types, auto-archive default

Several inaccuracies in the /agents docs were either out of date or
quietly reintroduced. Fix four of them in one pass:

* Drop `paused` and `completed` from the chat-statuses table. PR #24264
  removed them in April; PR #24642 unintentionally re-added them
  alongside the auto-archive feature. Neither status is set by any
  production code path on this branch.
* Add `action_required` to the watch event-kinds table. The kind is
  defined in `codersdk/chats.go` and emitted when a chat enters the
  `requires_action` state, but had no doc entry.
* Widen the file-uploads supported-formats line to match the actual
  allow-list in `coderd/x/chatfiles/mime.go`: PNG, JPEG, GIF, WebP plus
  text/plain, text/markdown, text/csv, application/json, application/pdf.
* Correct the auto-archive default to `0` (disabled). `DefaultChatAutoArchiveDays`
  in `codersdk/chats.go` is `0`; the curl example output was also wrong.
* Add the `attach_file` built-in tool to the index and architecture
  tool tables. Implemented in `coderd/x/chatd/chattool/attachfile.go`.

Linear: CODAGT-157

> Coder Agent generated this commit on David's behalf.
@github-actions
Copy link
Copy Markdown

Docs preview

📖 View docs preview

…-only

The supported-formats line previously listed PNG, JPEG, GIF, and WebP
only. The earlier change in this PR widened it to include text/plain,
text/markdown, text/csv, application/json, and application/pdf, citing
the server-side allowlist in coderd/x/chatfiles/mime.go. Per review,
the chat UI is image-only end-to-end (file picker accepts image/*,
drag-drop and paste both filter to image/*), so widening the doc would
imply a UX surface that does not exist. Revert that bullet to its
original wording and leave the other four fixes in place.
Copy link
Copy Markdown
Collaborator Author

Verified. The chat composer is image-only end-to-end:

  • site/src/pages/AgentsPage/components/AgentChatInput.tsx:826 — file picker uses accept="image/*".
  • AgentChatInput.tsx:545 — drag-and-drop filters with f.type.startsWith("image/").
  • site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:209 — native paste filters clipboard files with f.type.startsWith("image/").

The one wrinkle is that very large text pastes get converted into a synthetic text/plain File (createPasteFile) and rendered as a small text-preview tile, but that is an internal UX nicety for big in-place pastes, not a way to upload text/markdown, text/csv, application/json, or application/pdf from disk. None of those types have any UI surface.

Reverted the file-uploads bullet to the original image-only wording in 02467c63a and updated the PR description accordingly. The other four fixes still stand.

When the UI grows a non-image attachment surface I'll widen the doc as a separate change.

Coder Agent bot replying on @david-fraley's behalf.

@david-fraley david-fraley changed the title docs(docs/ai-coder/agents): correct chat statuses, watch events, file types, auto-archive default docs(docs/ai-coder/agents): correct chat statuses, watch events, auto-archive default, and add attach_file tool Apr 29, 2026
david-fraley added a commit that referenced this pull request Apr 30, 2026
…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.
…description

The previous description in architecture.md was a paraphrase. Replace
with the full description from coderd/x/chatd/chattool/attachfile.go
so docs and source agree.
Copy link
Copy Markdown
Collaborator Author

Updated the attach_file row in architecture.md to use the full description from the tool source (coderd/x/chatd/chattool/attachfile.go:27-30) verbatim instead of a paraphrase. The table re-padded as expected after running the markdown table formatter.

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

@david-fraley david-fraley merged commit c0e72e2 into main May 5, 2026
26 checks passed
@david-fraley david-fraley deleted the dfraley/docs-agents-quick-fixes branch May 5, 2026 13:00
@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