Skip to content

fix: delete the unused ChatMessagePart.Signature field - #27588

Merged
DanielleMaywood merged 1 commit into
mainfrom
danielle/delete-chat-part-signature
Jul 28, 2026
Merged

fix: delete the unused ChatMessagePart.Signature field#27588
DanielleMaywood merged 1 commit into
mainfrom
danielle/delete-chat-part-signature

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Contributor

ChatMessagePart.Signature was added in #22290 and has never been assigned by any code path.

Pure deletion, 29 lines, nothing added.

Why it is safe

  • No Go writer. The only reference in codersdk was the field declaration itself. Every other .Signature in the repo is unrelated: Anthropic reasoning-block metadata, JOSE object signatures, x509, and AWS/Azure instance identity.
  • No frontend change. The field carried no variants tag, so the DiscriminatedChatMessagePart codegen mutation excluded it from every union member. site/src/api/typesGenerated.ts contains zero occurrences of signature, before and after.
  • No persistence risk. ChatMessagePart doubles as the chat_messages.content format. Since nothing ever wrote the key, no stored row can contain it, and encoding/json ignores unknown keys on read regardless.
  • TestChatMessagePartVariantTags still passes: removing the field removes the need for its excludedFields entry, which this also deletes.

Changes

File Lines
codersdk/chats.go -1, the field
codersdk/chats_test.go -1, the stale excludedFields entry
docs/reference/api/schemas.md -13, from make gen
docs/reference/api/chats.md -8, from make gen
coderd/apidoc/swagger.json -3, from make gen
coderd/apidoc/docs.go -3, from make gen

Generated output is make gen verbatim. Verified that every removed line is a signature key or its enclosing swagger property braces.

go test ./codersdk/ passes.

🤖 This pull request was created with Coder Agents.

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.
@DanielleMaywood
DanielleMaywood requested a review from a team as a code owner July 28, 2026 14:30
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

Check 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
DanielleMaywood marked this pull request as draft July 28, 2026 14:33
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review July 28, 2026 15:12
@DanielleMaywood
DanielleMaywood merged commit be22640 into main Jul 28, 2026
57 of 60 checks passed
@DanielleMaywood
DanielleMaywood deleted the danielle/delete-chat-part-signature branch July 28, 2026 15:26
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 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.

2 participants