Skip to content

docs: remove unused paused and completed chat statuses, add requires_action#24264

Merged
david-fraley merged 6 commits into
mainfrom
docs/remove-dead-chat-statuses
Apr 17, 2026
Merged

docs: remove unused paused and completed chat statuses, add requires_action#24264
david-fraley merged 6 commits into
mainfrom
docs/remove-dead-chat-statuses

Conversation

@david-fraley

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

Copy link
Copy Markdown
Collaborator

Removes paused and completed from the documented chat statuses and adds the missing requires_action status.

Why: Both paused and completed exist in the DB enum and SDK constants but are never set by any production code path. Meanwhile requires_action (set when dynamic tool calls are pending) was missing from the docs entirely.

Analysis: why these statuses are dead code

The only place chat status is terminally determined is the deferred cleanup in processChat. The status defaults to waiting and is only overwritten to:

Every other UpdateChatStatus call in the codebase writes one of the same five statuses:

That's an exhaustive list of every production UpdateChatStatus call. Neither paused nor completed is written anywhere — they only appear in test fixtures.

Generated by Coder Agents

…tion

The paused and completed chat statuses are defined in the enum but never
set by any production code path. The agent transitions between waiting,
pending, running, error, and requires_action only.

Also adds the missing requires_action status which is actively used when
dynamic tool calls are pending.

@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.

Confirmed with mk1 eyeballs

@mafredri mafredri 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.

Clean docs fix that aligns the documented chat statuses with what production code actually writes. Good analysis in the PR description tracing every UpdateChatStatus call site.

One nit, one note. No blocking findings.

"The byte sequence e2 80 94 at 'Idle --- newly created' is a Unicode em-dash." -- Netero, squinting at hex dumps

🤖 This review was automatically generated with Coder Agents.

Comment thread docs/ai-coder/agents/chats-api.md Outdated
Comment thread docs/ai-coder/agents/chats-api.md Outdated

@mafredri mafredri 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.

Panel review, round 2. One P3, two P4s (outside diff). No blocking findings.

The PR description's call-site audit is thorough and verifiable. The five documented statuses match the exhaustive set of statuses written by production code. Good change.

Correction on round 1 findings:

  • The em-dash nit (#comment-3066723267) was wrong. There is no project convention against em-dashes. The docs/ directory contains 195 em-dash occurrences across 34 files, including this same file on lines 9, 68, 69. Five panel reviewers independently verified this. The "no emdashes" rule is a constraint on reviewer output, not a documentation convention. Closing.
  • The OpenAPI divergence note (#comment-3066723271) overstated the scope. ChatStatus is absent from swagger.json entirely because experimental chat endpoints omit swagger annotations. The actual divergence is between human docs (5 statuses) and DB enum / SDK constants (7 statuses). No generated client is affected.

P4 coderd/exp_chats_test.go:698-702 -- Valid-status assertion accepts dead ChatStatusCompleted (never written by production code) and omits live ChatStatusRequiresAction (written when dynamic tool calls are pending). A chat legitimately in requires_action would fail this test with a confusing error, while a chat that somehow reached completed would pass silently. (Bisky P4)

P4 coderd/x/chatd/integration_test.go:203-204 -- Integration test switches on ChatStatusCompleted as a valid terminal state. Since no production code path writes completed, this branch is dead and would silently accept an invalid transition as success. Same class as the finding above. (Meruem P4)

Neither P4 is introduced by this PR, but this PR's assertion that completed is dead code makes them visible.

"They don't know what a dynamic tool is, how it differs from a non-dynamic tool, or what endpoint to hit." -- Leorio, reading the docs like a newcomer

🤖 This review was automatically generated with Coder Agents.

Comment thread docs/ai-coder/agents/chats-api.md Outdated
@mafredri mafredri self-requested a review April 17, 2026 20:11
@david-fraley david-fraley merged commit 1feb183 into main Apr 17, 2026
25 of 26 checks passed
@david-fraley david-fraley deleted the docs/remove-dead-chat-statuses branch April 17, 2026 20:17
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 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.

3 participants