mirror of
https://github.com/coder/coder.git
synced 2026-10-31 02:43:21 +08:00
Two Coder Agents pages describe chat statuses that no longer exist and attribute auto-archive to the wrong subsystem. The valid status set is `waiting`, `running`, `error`, `requires_action`, `interrupting`. - `architecture.md`: a submitted prompt marks the chat `running`, not `pending`; there is no queued state. - `chat-auto-archive.md`: the excluded status set is `running`, `interrupting`, `requires_action`. - `chat-auto-archive.md`: the job runs in the chatd chat worker on an hourly tick, not in `dbpurge`. - `chat-auto-archive.md`: documents the dashboard control at **AI Settings** > **Coder Agents** > **Lifecycle**, and the 25-title cap on the digest notification. API paths on the auto-archive page are intentionally untouched; a separate PR fixes the `/api/v2` to `/api/experimental` drift. Linear: DOCS-722 https://linear.app/codercom/issue/DOCS-722 <details><summary>Analysis evidence</summary> - `codersdk/chats.go`: `ChatStatus` constants are `waiting`, `running`, `error`, `requires_action`, `interrupting`. No `pending`, `paused`, or `completed`. - `coderd/x/chatd/chatstate/transitions.go`: `sendMessageQueueAndSetStatus` and the send paths apply `database.ChatStatusRunning`, so a submitted prompt is `running` immediately. `docs/ai-coder/agents/tasks-to-chats-migration.md` already states that chats have no separate queued state. - `coderd/database/queries/chats.sql`, `GetAutoArchiveInactiveChatCandidates`: `status NOT IN ('running', 'interrupting', 'requires_action')`, plus `archived = false`, `pin_order = 0`, `parent_chat_id IS NULL`. - `coderd/x/chatd/auto_archive.go`: `archiveLoop` runs from `coderd/x/chatd/worker.go` on `opts.ArchiveInterval`; `coderd/x/chatd/options.go` sets `defaultArchiveInterval = time.Hour`. Nothing in `dbpurge` performs chat auto-archive. - `coderd/x/chatd/auto_archive.go`: `chatAutoArchiveDigestMaxChats = 25`; `buildAutoArchiveDigestData` truncates to 25 titles and reports the remainder as `additional_archived_count`. - `coderd/x/chatd/options.go`: `defaultArchiveBatchSize = int32(1000)`, so the existing "up to 1,000 root chats" claim stands. - `site/src/pages/AISettingsPage/LifecyclePage/LifecyclePageView.tsx` mounts `AutoArchiveSettings`; `site/src/modules/management/AISettingsSidebarView.tsx` places the Lifecycle sub-nav item under Coder Agents. Validation: `pnpm run format-docs` (no changes) and `pnpm run lint-docs` (0 errors). </details> Generated by Coder Agents on behalf of @nickvigilante.