Skip to content

chore!: bump coder/coder SDK and remove model cost settings - #413

Merged
ethanndickson merged 4 commits into
mainfrom
codagt-716/sdk-bump
Aug 20, 2026
Merged

chore!: bump coder/coder SDK and remove model cost settings#413
ethanndickson merged 4 commits into
mainfrom
codagt-716/sdk-bump

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Aug 18, 2026

Copy link
Copy Markdown
Member

Bumps github.com/coder/coder/v2 from the previously pinned main commit (fbac602456c9, 2026-07-28) to a newer main commit (8a7e8d9d5b31, 2026-08-19).

Resulting module version: v2.34.0-rc.0.0.20260819135125-8a7e8d9d5b31

Breaking change

This SDK bump removes pricing fields from coderd_agents_model.model_config. The following settings are no longer supported and must be removed:

model_config = jsonencode({
  cost = {
    input_price_per_million_tokens  = "3"
    output_price_per_million_tokens = "15"
  }
})

The four legacy top-level pricing settings are also removed:

  • input_price_per_million_tokens
  • output_price_per_million_tokens
  • cache_read_price_per_million_tokens
  • cache_write_price_per_million_tokens

The provider validates model_config against its pinned SDK. Configurations with these pricing settings will fail at plan time. Remove these settings before you upgrade the provider. Coder now gets cost data from AI Gateway.

The example and generated documentation remove model_config.cost.

Compatibility

This SDK bump does not set a new minimum Coder version for the coderd_template resource. The follow-up #414 adds the optional agents_allowed attribute. Explicit use of that attribute requires Coder v2.37.0 or later.

Release context

This change requires a provider release that is marked as breaking. The release notes must include the model_config pricing migration. The breaking change applies to coderd_agents_model.

This is the prerequisite layer for #414 and also includes the exported codersdk.SanitizePromptText used by #412.

Refs https://linear.app/codercom/issue/CODAGT-716/expose-agents-allowed-in-the-coderd-terraform-provider

Stack plan
  1. Update the Coder SDK and remove obsolete chat model cost configuration.

  2. Add agents_allowed to the coderd_template resource and data source in feat(coderd_template): expose agents_allowed #414.

  3. Add the deployment-wide chat system prompt resource in feat(coderd_chat_system_prompt): manage the deployment-wide chat system prompt #412.

Opened by Coder Agents on behalf of @ethanndickson.

@linear-code

linear-code Bot commented Aug 18, 2026

Copy link
Copy Markdown

CODAGT-716

@ethanndickson ethanndickson changed the title codagt 716/sdk bump chore(deps): update Coder SDK for template agents support Aug 18, 2026
@ethanndickson ethanndickson changed the title chore(deps): update Coder SDK for template agents support chore!: bump coder/coder module for agents_allowed Aug 18, 2026
@ethanndickson
ethanndickson marked this pull request as ready for review August 18, 2026 07:12
@ethanndickson
ethanndickson marked this pull request as draft August 18, 2026 07:29
@ethanndickson
ethanndickson marked this pull request as ready for review August 18, 2026 07:32
@ethanndickson ethanndickson changed the title chore!: bump coder/coder module for agents_allowed chore!: bump coder/coder SDK and remove model cost settings Aug 18, 2026
@ethanndickson
ethanndickson merged commit 48e7030 into main Aug 20, 2026
13 checks passed
@ethanndickson
ethanndickson deleted the codagt-716/sdk-bump branch August 20, 2026 10:16
ethanndickson added a commit that referenced this pull request Aug 20, 2026
Expose the per-template `agents_allowed` flag through the
`coderd_template` resource and data source. Terraform can now create,
update, and read whether Coder Agents can use a template.

The change does not set a new minimum Coder version for existing
`coderd_template` configurations. If the configuration omits
`agents_allowed`, the provider does not send the field during create.
Older Coder servers omit the field in responses, so the provider reads
it as `false`, consistent with other versioned template attributes.

The PR author accepts these compatibility limits:

- Explicit `agents_allowed` configuration requires Coder v2.37.0 or
later. An older server will ignore the unsupported field and cause an
inconsistent-result apply error.
- The template data source reports `false` for `agents_allowed` on older
servers because the API response omits the field.
- A saved plan created before a Coder v2.37.0 upgrade can carry the
synthetic `false` into an unrelated template update after the upgrade.
This only disables Coder Agent access for that template. It does not
affect ordinary workspaces or damage the template. Users can restore
access by setting `agents_allowed = true` in a fresh plan.

Users must create a fresh Terraform plan with refresh enabled after
upgrading Coder to v2.37.0. They must not apply a saved pre-upgrade plan
after the upgrade.

Acceptance coverage runs only when the Coder image reports v2.37.0 or
later.

Depends on #413.

Closes
https://linear.app/codercom/issue/CODAGT-716/expose-agents-allowed-in-the-coderd-terraform-provider

<details>
<summary>Stack plan</summary>

1. Update the Coder SDK and remove obsolete chat model cost
configuration in #413.
2. Add `agents_allowed` to the resource and data source, including
generated documentation and version-gated acceptance coverage.

3. Add the deployment-wide chat system prompt resource in #412.

</details>

This PR was generated by Coder Agents.
ibetitsmike added a commit that referenced this pull request Aug 21, 2026
…em prompt (#412)

Closes #411

Adds `coderd_chat_system_prompt`, a singleton resource for the
deployment-wide Coder Agents system prompt (`Settings → Instructions`).
Replaces the CI `curl` workaround used in coder/dogfood#400.

```hcl
resource "coderd_chat_system_prompt" "this" {
  system_prompt                  = file("${path.module}/system-prompt.md")
  include_default_system_prompt = true
}
```

## Status

- [X] coder/coder#28283 merged (`codersdk.SanitizePromptText` exported)
- [X] SDK bump and model-cost migration split into
#413
- [X] Mirrored sanitizer deleted; this resource calls the SDK
implementation directly
- [ ] Re-review @ethanndickson
- [ ] Merge + provider release, then coder/dogfood drops the workflow
PUT/drift steps

## Design

* Coder sanitizes stored prompts, so `system_prompt` compares values by
sanitized form (`codersdk.SanitizePromptText`). A trailing newline from
`file(...)` never drifts; real edits still diff.
* Singleton like `coderd_oauth2_provider_settings`: one idempotent PUT,
destroy resets deployment defaults, import adopts the live value,
plan-time warnings before a first apply overwrites out-of-band values.
* Plan-time 128 KiB length validation.
* A 404 reports that the endpoint is unavailable and explains both
likely causes: Coder older than v2.32.0 or insufficient site-wide
permissions.

## Stack

Depends on #414. The SDK export used by
this resource is provided by the bottom stack layer,
#413.

1. #413 — bump the Coder SDK and remove
obsolete model cost settings
2. #414 — expose `agents_allowed` on
templates
3. #412 — manage the deployment-wide chat
system prompt

## Testing

* Real-Coder acceptance tests (`integration.StartCoder`): lifecycle
no-drift with a deliberately messy prompt (CRLF, zero-width space,
blank-line run, trailing newline), import convergence, destroy reset.
* Fake-coderd tests for request-level assertions (import issues no PUT,
unavailable-endpoint diagnostic) plus unit tests for semantic equality,
the validator, and the ModifyPlan advisories.
* Build, formatting, generated docs, lint, and provider unit tests pass
locally on the restacked branch.

> Generated by Coder Agents on behalf of @bpmct

---------

Co-authored-by: Ethan Dickson <ethan@coder.com>
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.

2 participants