Skip to content

feat(codersdk): add strict unmarshalling for ChatModelCallConfig - #27187

Merged
ethanndickson merged 3 commits into
mainfrom
codersdk-chatmodelcallconfig-unmarshal-strict
Jul 14, 2026
Merged

ethanndickson merged 3 commits into
mainfrom
codersdk-chatmodelcallconfig-unmarshal-strict

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Adds ChatModelCallConfig.UnmarshalStrict: UnmarshalJSON except unknown fields and trailing data are errors instead of being silently dropped.

model_config is free-form JSON at its edges (Terraform config, API bodies), so a typo'd setting is dropped with no signal; coder/terraform-provider-coderd#388 uses this for plan-time validation. It has to live in codersdk because the custom UnmarshalJSON and its unexported aux struct (which defines the accepted key set, including legacy pricing aliases) make strict decoding impossible from outside the package. UnmarshalJSON stays lenient since it is on the read path for stored configs and older clients, where unknown keys mean version skew rather than user error.

Opened by Coder Agents on behalf of @ethanndickson.

Relates to CODAGT-797

ethanndickson added a commit to coder/terraform-provider-coderd that referenced this pull request Jul 13, 2026
…ropped model_config settings

Replaces the removal-probe drop detection with
codersdk.ChatModelCallConfig.UnmarshalStrict (coder/coder#27187), pinning
the SDK to that PR's commit. The strict decoder shares the lenient path's
aux struct, so the SDK stays the sole oracle with no schema knowledge in
the provider.
@ethanndickson
ethanndickson marked this pull request as ready for review July 13, 2026 11:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4e1fbb0e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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

Comment thread codersdk/chats.go Resolved
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@ethanndickson
ethanndickson requested a review from johnstcn July 13, 2026 12:09
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b2c58b04a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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

@ethanndickson
ethanndickson force-pushed the codersdk-chatmodelcallconfig-unmarshal-strict branch from b2c58b0 to 2cc1cd0 Compare July 14, 2026 03:16
@linear-code

linear-code Bot commented Jul 14, 2026

Copy link
Copy Markdown

CODAGT-797

@ethanndickson
ethanndickson enabled auto-merge (squash) July 14, 2026 03:23
@ethanndickson
ethanndickson merged commit b0f0a54 into main Jul 14, 2026
32 of 33 checks passed
@ethanndickson
ethanndickson deleted the codersdk-chatmodelcallconfig-unmarshal-strict branch July 14, 2026 03:32
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 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