chore!: bump coder/coder SDK and remove model cost settings - #413
Merged
Conversation
ethanndickson
force-pushed
the
codagt-716/sdk-bump
branch
from
August 18, 2026 07:04
967b43b to
c3d171a
Compare
ethanndickson
marked this pull request as ready for review
August 18, 2026 07:12
ethanndickson
marked this pull request as draft
August 18, 2026 07:29
ethanndickson
marked this pull request as ready for review
August 18, 2026 07:32
ethanndickson
force-pushed
the
codagt-716/sdk-bump
branch
from
August 19, 2026 09:45
c3d171a to
4742dca
Compare
johnstcn
approved these changes
Aug 19, 2026
5 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps
github.com/coder/coder/v2from the previously pinned main commit (fbac602456c9, 2026-07-28) to a newermaincommit (8a7e8d9d5b31, 2026-08-19).Resulting module version:
v2.34.0-rc.0.0.20260819135125-8a7e8d9d5b31Breaking change
This SDK bump removes pricing fields from
coderd_agents_model.model_config. The following settings are no longer supported and must be removed:The four legacy top-level pricing settings are also removed:
input_price_per_million_tokensoutput_price_per_million_tokenscache_read_price_per_million_tokenscache_write_price_per_million_tokensThe provider validates
model_configagainst 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_templateresource. The follow-up #414 adds the optionalagents_allowedattribute. 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_configpricing migration. The breaking change applies tocoderd_agents_model.This is the prerequisite layer for #414 and also includes the exported
codersdk.SanitizePromptTextused by #412.Refs https://linear.app/codercom/issue/CODAGT-716/expose-agents-allowed-in-the-coderd-terraform-provider
Stack plan
Update the Coder SDK and remove obsolete chat model cost configuration.
Add
agents_allowedto thecoderd_templateresource and data source in feat(coderd_template): expose agents_allowed #414.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.