fix: delete the unused ChatMessagePart.Signature field - #27588
Merged
Conversation
The field was added in #22290 and has never been assigned by any code path. It carries no variants tag, so codegen excluded it from every generated TypeScript variant and typesGenerated.ts never contained it. Nothing ever wrote the JSON key, and encoding/json ignores unknown keys on read, so persisted chat_messages.content rows are unaffected. Removes the now-redundant excludedFields entry, and the swagger, apidoc and reference-docs output from make gen.
Contributor
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
DanielleMaywood
marked this pull request as draft
July 28, 2026 14:33
DanielleMaywood
marked this pull request as ready for review
July 28, 2026 15:12
kylecarbs
approved these changes
Jul 28, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
ChatMessagePart.Signaturewas added in #22290 and has never been assigned by any code path.Pure deletion, 29 lines, nothing added.
Why it is safe
codersdkwas the field declaration itself. Every other.Signaturein the repo is unrelated: Anthropic reasoning-block metadata, JOSE object signatures, x509, and AWS/Azure instance identity.variantstag, so theDiscriminatedChatMessagePartcodegen mutation excluded it from every union member.site/src/api/typesGenerated.tscontains zero occurrences ofsignature, before and after.ChatMessagePartdoubles as thechat_messages.contentformat. Since nothing ever wrote the key, no stored row can contain it, andencoding/jsonignores unknown keys on read regardless.TestChatMessagePartVariantTagsstill passes: removing the field removes the need for itsexcludedFieldsentry, which this also deletes.Changes
codersdk/chats.gocodersdk/chats_test.goexcludedFieldsentrydocs/reference/api/schemas.mdmake gendocs/reference/api/chats.mdmake gencoderd/apidoc/swagger.jsonmake gencoderd/apidoc/docs.gomake genGenerated output is
make genverbatim. Verified that every removed line is asignaturekey or its enclosing swagger property braces.go test ./codersdk/passes.🤖 This pull request was created with Coder Agents.