feat(coderd_agents_mcp_server)!: import by organization name and slug - #427
Closed
ethanndickson wants to merge 1 commit into
Closed
feat(coderd_agents_mcp_server)!: import by organization name and slug#427ethanndickson wants to merge 1 commit into
ethanndickson wants to merge 1 commit into
Conversation
Member
Author
|
Folded into #423 — this change now ships as part of that PR. |
ethanndickson
added a commit
that referenced
this pull request
Aug 31, 2026
Stacked on #422. Coder 2.37 makes the default chat model per-organization rather than deployment-global: each organization has its own default, the first model created in an organization is automatically promoted, and existing configurations are migrated to the default organization. The experimental `coderd_default_agents_model` resource modeled one global selection and no longer matches the server. This PR replaces it with `coderd_agents_default_model`: - Renames the resource from `coderd_default_agents_model` to `coderd_agents_default_model`, grouping it with `coderd_agents_model`. - Requires an explicit `organization_id`; changing it forces replacement. - Uses the organization UUID as the resource `id`, since each organization has one default. - Create and update mark the selected model as default through the organization-scoped `/api/v2` endpoint. - Read lists the organization's models and resolves its current default. - Missing or inaccessible organizations and unsupported Coder versions produce actionable diagnostics. - Delete remains an intentional no-op because Coder requires a default while models exist and provides no unset-default API. ## Breaking change and migration `coderd_default_agents_model` is removed and replaced by `coderd_agents_default_model`. The new resource implements `ResourceWithMoveState`, allowing existing state to migrate declaratively: ```hcl moved { from = coderd_default_agents_model.this to = coderd_agents_default_model.this } resource "coderd_agents_default_model" "this" { organization_id = var.organization_id model_id = coderd_agents_model.default.id } ``` The legacy deployment-wide selection is assigned to the provider's default organization during the move. The configured `organization_id` should therefore identify that same organization. Also folds in the `coderd_agents_mcp_server` import ID change (originally #427): `<organization-name>/<slug>` instead of `<organization-id>/<id>` (the organization component also accepts a UUID). Slugs are unique per organization, but the get-by-ID endpoint only accepts UUIDs, so import resolves the slug from the organization's server list. The resource requires Coder v2.37.0 or later. Its import ID is the organization name (a UUID is also accepted); `model_id` is resolved during read. > Disclosure: Xum (AI agent) authored this PR on @ethanndickson's behalf. Closes CODAGT-973
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.
Changes the
coderd_agents_mcp_serverimport ID from<organization-id>/<id>to<organization-name>/<slug>(the organization component also accepts a UUID):MCP server slugs are unique per organization, but the get-by-ID endpoint only accepts UUIDs, so import resolves the slug from the organization's server list. The resource hasn't shipped in a provider release, so the old UUID-composite format is dropped without a compatibility path.
Refs CODAGT-973.
Disclosure: Xum (AI agent) authored this PR on @ethanndickson's behalf.
Stack created with GitHub Stacks CLI • Give Feedback 💬