chore!: bump coder/coder go module to latest main#386
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aadd633d31
ℹ️ 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".
|
@codex review re: P1 Badge Preserve reasoning effort fields during SDK bump Thanks — this is already handled, in two parts:
Sequencing: #388 merges first, then this PR rebases on top of it, so the validator is present when this SDK bump ships. No silent loss on either side of the bump. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1c87d194b
ℹ️ 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".
…schema
The coder/coder bump removes provider_options.*.effort and
provider_options.openai.reasoning_effort in favor of a top-level
reasoning_effort object ({default, max}). Update the example, generated
docs, and integration fixtures/expectations to the new schema.
d1c87d1 to
a789e69
Compare
…xtures to top-level reasoning_effort Folds the non-go.mod changes from #386 into this branch, since it already pins an SDK with the reasoning_effort restructure.
|
Superseded by #388, which now carries this SDK bump (pinned even newer, pending coder/coder#27187) plus the schema-migrated example/docs/integration fixtures verbatim. Merge #388 instead. |
|
Fully superseded by #388. Comment by Coder Agents on behalf of @ethanndickson. |
… to latest main (#388) Closes CODAGT-797 Adds a plan-time validator for `coderd_agents_model.model_config` that fails loudly when the config contains settings the provider would silently drop when decoding into its pinned Coder SDK. ## Why Each provider release pins exactly one `codersdk`, and `model_config` is decoded into that SDK's `ChatModelCallConfig` before every create/update — so a release supports exactly one `model_config` schema. Standard `encoding/json` ignores object keys with no matching struct field, so anything outside that schema (a misspelled key, a field from a newer Coder, a field removed or renamed by an SDK bump) is silently dropped in the provider before the request is ever sent, with no plan diff, and the value in state compares semantically equal. A user can lose configured behavior with no signal. ## What - New `agentsModelConfigNoDroppedKeysValidator`, wired into the `model_config` schema alongside the existing not-empty validator. - It reports every dropped setting by its full dotted path (e.g. `provider_options.anthropic.bogus_setting`), so a name that is valid in one place cannot mask a dropped occurrence of the same name elsewhere. - The error explains that the settings are not part of the schema this provider was built against, and tells the user to either upgrade the provider to a release built against their Coder version or fix/remove the field. This is schema-change-agnostic: nothing in the implementation restates the SDK schema, so it cannot drift when `ChatModelCallConfig` evolves. <details> <summary>Design notes</summary> - **The SDK is the sole oracle.** To decide whether a key is dropped, the validator removes it from the decoded document, re-canonicalizes through `ChatModelCallConfig`, and compares against the canonical output of the full document: a key whose removal leaves the output unchanged contributed nothing, so it was dropped. Nothing hardcodes recognized fields, legacy aliases, or folding rules. - **Relocations and legacy aliases fall out for free.** A legacy top-level pricing key on its own (folded under `cost`) probes as *kept*, because removing it changes the output. The same key shadowed by a differing `cost.<key>` (whose nested value wins) probes as *dropped*, because removing the ignored legacy value changes nothing — so silent overrides are still caught. - **Content-free values are skipped.** `null`, `[]`, and `{}` hit `omitempty` whether or not the key is recognized, so removing one never changes the output; the probe cannot judge them and does not try. - `json.DisallowUnknownFields` does **not** work here: `ChatModelCallConfig` has a custom `UnmarshalJSON` that calls plain `json.Unmarshal` internally, discarding the decoder's strict setting for the whole subtree. - This branch is independent of the coder/coder bump (PR #386): tests assert on synthetic unknown keys that drop on any SDK version. </details> ## Compatibility model The supported way to consume this (experimental) resource is to run the provider release that matches your Coder version; cross-version compatibility is delivered by the release stream (see #386's release plan), not by any single provider binary. We considered making `model_config` an opaque passthrough blob (raw JSON both ways, bypassing the typed SDK client) so one provider release could span Coder versions, and rejected it as counter to that compatibility story. Passthrough would let this one attribute float across versions while everything else about the resource stays typed to the pinned SDK — a false sense of cross-version support — and it silently accepts typos and unsupported settings, which match no Coder version, get dropped by the server on write, and never come back: a perpetual diff with no error. This validator enforces the contract loudly instead: any setting outside the schema the provider was built against fails at plan time, with the remedy in the diagnostic (fix the field name, or upgrade the provider if the setting is valid on your Coder). Combining passthrough with this validation wouldn't help either — the error rejects exactly the newer-server fields passthrough exists to forward, and softening it to a warning just re-introduces quiet drift while adding the raw-HTTP machinery passthrough requires. The validator checks against the pinned SDK, not the live server, so the reverse mismatch — a provider newer than your Coder — can still send fields the server drops; that too is solved by matching versions. _Opened by Coder Agents on behalf of @ethanndickson._
Bumps
github.com/coder/coder/v2from the previously pinned main commit (db7f4438b4ad, 2026-07-01) to a newermaincommit (9af3d31036bf, 2026-07-10).Resulting module version:
v2.34.0-rc.0.0.20260710073612-9af3d31036bfBreaking change
This SDK bump changes the
model_configschema forcoderd_agents_model, so this provider version requires a Coder deployment runningcoder/codermain(equivalently, Coder >= v2.36.0 once that is cut). It is not compatible with any currently released Coder.provider_options.anthropic.effortandprovider_options.openai.reasoning_effortare removed in favor of a top-levelreasoning_effortobject ({ default, max }). This restructure only exists oncoder/codermain; the newest release branch (release/2.35) still uses the per-provider fields.The example, generated docs, and integration fixtures are migrated to the new schema in this PR.
go mod tidypulled in the corresponding transitive dependency updates.go build ./...passes.Cost pricing (
model_config.cost) is unchanged: it is nested undercoston every supported version and legacy top-level pricing keys are still folded in on read, so it is not affected by this bump.Release context
This is the second of two releases.
Release A — shipped as v0.0.21. The compatible bugfix release for released Coder (v2.35.x): clearer Bedrock
role_arnerror on older servers (#389, fixes #387), the empty-Bedrock-string null fix (#384), optional templateversions(#383), and the computed Bedrockexternal_id(#382). It stays on the pre-bump SDK, so released-Coder users are unaffected by this PR.Release B — this PR. The breaking SDK bump, compatible only with
coder/codermain(Coder >= v2.36.0). To be cut and marked breaking once merged, with the minimum required Coder version called out in the release notes. Users on released Coder should stay on v0.0.21.Companion: #388
#388 adds a plan-time
model_configvalidator that fails loudly on keys Coder would silently drop. Landing it alongside this bump turns a user's now-removedprovider_options.anthropic.effortinto a clear plan-time error (with theeffort->reasoning_effortmigration hint) instead of a silent drop. It depends on this bump's SDK, so merge this first, then #388, and include both in Release B.Opened by Coder Agents on behalf of @ethanndickson.