Skip to content

chore!: bump coder/coder go module to latest main#386

Closed
ethanndickson wants to merge 2 commits into
mainfrom
bump-coder-main
Closed

chore!: bump coder/coder go module to latest main#386
ethanndickson wants to merge 2 commits into
mainfrom
bump-coder-main

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Jul 11, 2026

Copy link
Copy Markdown
Member

Bumps github.com/coder/coder/v2 from the previously pinned main commit (db7f4438b4ad, 2026-07-01) to a newer main commit (9af3d31036bf, 2026-07-10).

Resulting module version: v2.34.0-rc.0.0.20260710073612-9af3d31036bf

Breaking change

This SDK bump changes the model_config schema for coderd_agents_model, so this provider version requires a Coder deployment running coder/coder main (equivalently, Coder >= v2.36.0 once that is cut). It is not compatible with any currently released Coder.

  • Reasoning effort moved out of per-provider options: provider_options.anthropic.effort and provider_options.openai.reasoning_effort are removed in favor of a top-level reasoning_effort object ({ default, max }). This restructure only exists on coder/coder main; 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 tidy pulled in the corresponding transitive dependency updates. go build ./... passes.

Cost pricing (model_config.cost) is unchanged: it is nested under cost on 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_arn error on older servers (#389, fixes #387), the empty-Bedrock-string null fix (#384), optional template versions (#383), and the computed Bedrock external_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/coder main (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_config validator that fails loudly on keys Coder would silently drop. Landing it alongside this bump turns a user's now-removed provider_options.anthropic.effort into a clear plan-time error (with the effort -> reasoning_effort migration 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.

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

Comment thread go.mod
@ethanndickson ethanndickson changed the title chore(go.mod): bump coder/coder to latest main chore!: bump coder/coder go module to latest main Jul 13, 2026
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: P1 Badge Preserve reasoning effort fields during SDK bump

Thanks — this is already handled, in two parts:

  1. Example and docs are migrated in this PR. As of d1c87d1, examples/resources/coderd_agents_model/resource.tf (and the generated docs/) no longer use provider_options.anthropic.effort; they use the new top-level reasoning_effort = { default, max } object. provider_options.anthropic now only carries thinking. I think the review ran against an earlier commit, before the migration landed.

  2. The silent-drop/no-plan-time-error case is covered by feat!: reject unrecognized model_config settings and bump coder/coder to latest main #388. We deliberately don't translate or silently accept the old shape (that would just re-hide the loss). Instead, feat!: reject unrecognized model_config settings and bump coder/coder to latest main #388 adds agentsModelConfigNoDroppedKeysValidator, which canonicalizes model_config through codersdk.ChatModelCallConfig and fails at plan time, listing any key the SDK would drop — with a specific hint when effort is dropped that points users at the top-level reasoning_effort object. So a user who keeps the old config gets a clear plan error instead of losing the setting.

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.

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

Comment thread go.mod
@ethanndickson ethanndickson self-assigned this Jul 13, 2026
…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.
ethanndickson added a commit that referenced this pull request Jul 13, 2026
…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.
@ethanndickson

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member Author

Fully superseded by #388.

Comment by Coder Agents on behalf of @ethanndickson.

ethanndickson added a commit that referenced this pull request Jul 13, 2026
… 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._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coderd_ai_provider - Bedrock Settings produces inconsistent values for sensitive attribute

1 participant