docs(docs/ai-coder/agents): correct chat statuses, watch events, auto-archive default, and add attach_file tool#24828
Conversation
… 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.
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.
|
Verified. The chat composer is image-only end-to-end:
The one wrinkle is that very large text pastes get converted into a synthetic Reverted the file-uploads bullet to the original image-only wording in 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. |
…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.
|
Updated the
|
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 againstmain. No behavior change.What changes
1. Drop
pausedandcompletedfrom the chat statuses tablechats-api.mdlists both as user-visible chat states. They are defined incodersdk/chats.go(and in the database enum) but no production path onmainever 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.2. Add
action_requiredto the watch event-kinds tableChatWatchEventKindActionRequired = "action_required"(codersdk/chats.go:1410) is emitted when a chat enters therequires_actionstate, but the doc table had no row for it. Anyone driving UI offGET /api/experimental/chats/watchcannot 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 = 0incodersdk/chats.go:801. The doc said90, both in prose and in the curl-output example.platform-controls/chat-auto-archive.mdwas already correct on this point.4. Add the
attach_filebuilt-in tool to the tool tablesImplemented in
coderd/x/chatd/chattool/attachfile.go:27with 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) andarchitecture.md(Workspace tools).What was dropped from this PR
An earlier revision widened the file-uploads supported-formats line in
chats-api.mdto mentiontext/plain,text/markdown,text/csv,application/json, andapplication/pdfalongside the four image types, citing the server-side allowlist incoderd/x/chatfiles/mime.go. Per review, the chat UI is image-only end-to-end (file picker usesaccept="image/*", drag-drop filters withf.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_filerow)docs/ai-coder/agents/architecture.md(attach_filerow)The larger-than-expected
architecture.mddiff is the markdown table formatter re-padding column widths to accommodate the longer description in the newattach_filerow. No content drift outside the new row.Validation
pnpm exec markdownlint-cli2 …→ 0 errorspnpm exec markdown-table-formatter …→ stable (re-run produces no diff)bash scripts/check_emdash.sh→ OKmain:grep -n DefaultChatAutoArchiveDays codersdk/chats.go→const … int32 = 0grep -n ChatWatchEventKindActionRequired codersdk/chats.go→"action_required"grep -n attach_file coderd/x/chatd/chattool/attachfile.go→ tool registeredgrep -rn ChatStatusPaused\\|ChatStatusCompleted … | grep -v _test.go | grep -v models.go→ only enum-listing call sites; no production setter onmainProof
Docs-text change with no UI/UX impact. The visible-string diffs are above. If reviewers want rendered before/after, I can attach screenshots.