Repository navigation
refactor(coderd)!: retire the V0 chat message content decoder - #30998
Draft
ibetitsmike wants to merge 1 commit into
Draft
ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
ibetitsmike
added this pull request to stack #30999
October 18, 2026 18:26
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
Closed
Closed
Collaborator
Author
|
@codex review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ibetitsmike
removed this pull request from stack #30999
October 18, 2026 19:27
ibetitsmike
added this pull request to stack #31006
October 18, 2026 19:28
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR breaks compatibility with chat messages stored in the legacy content format (
chat_messages.content_version = 0). Messages written before v2.32 have it: migration 000434 (#23042) stamped every existing row with version 0, and nothing converts them later. The PR deletes the legacy decoder fromchatprompt:ContentVersionV0,parseLegacyContentand its per-role parsers, the fantasy envelope detectorisFantasyEnvelopeFormat,ExtractFileID, and the legacy tool-row typetoolResultRaw. Coder Agents is experimental (coderd/x), so we drop legacy persisted shapes and the helpers that parse them outright instead of carrying a migration.What happens to those messages:
ParseContentnow returnsunsupported content version 0. Throwaway API tests on this head show the effect on a chat with version 0 rows:GET /api/v2/chats/{chat}/messagesreturns 200, but the version 0 messages have no content.Failed to create chat message.orFailed to edit chat message., detailexecute transaction: parse assistant message: unsupported content version 0). By code reading, promote does the same.build chat prompt: unsupported content version 0) and the chat goes to error.Chats with only version 1 rows do not change.
Why it is safe
CurrentContentVersion(1), andcontent_versionisNOT NULLwith no default, so no new row gets version 0.maincatches, out of the 17 listed in test(coderd): stamp chat message fixtures with the current content version #30996, is still caught on this head.git grepfor each removed symbol across the repository, includingsite/,enterprise/,cli/,docs/andscripts/, finds nothing on this head. Before this PR, the only hit outsidechatprompt.gowascoderd/exp_chats_test.go, which now writes the version as a literal0. That test checks that the SQLjsonb_typeofguard skips scalar JSON rows.Review focus
Version 0 rows now take the existing
unsupported content versionbranch ofParseContent; the PR adds no new error path.Validation
go test ./coderd/x/chatd/... ./coderd/database/db2sdk/ -count=1 -p 4 -parallel 4: okgo test ./coderd/ ./enterprise/coderd/ -run '(?i)chat|agent|mcp|skill' -count=1 -p 4 -parallel 4: okgolangci-lint run --fix=false ./coderd/x/chatd/chatprompt/...: 0 issues; pre-commit hook: passedStack
This stack retires chatd compatibility paths for chat data that older Coder versions stored.
close_agenttool alias