Skip to content

chore: bump coder/coder SDK and adapt to chat model config changes#381

Merged
ethanndickson merged 1 commit into
mainfrom
ethan/bump-coder-sdk
Jul 8, 2026
Merged

chore: bump coder/coder SDK and adapt to chat model config changes#381
ethanndickson merged 1 commit into
mainfrom
ethan/bump-coder-sdk

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Jul 6, 2026

Copy link
Copy Markdown
Member

Bumps github.com/coder/coder/v2 so the next PR in this stack can use the Bedrock external ID from coder/coder#26869.

The bump also pulls in coder/coder#26877, which removed the provider field from chat model configs and made ai_provider_id required. The coderd_agents_model resource keeps its provider_type attribute, but now derives it by looking up the linked AI provider, which is upstream's stated migration path.

This stays compatible with older Coder servers: the provider never sent a provider field in requests, and the lookup used to derive provider_type hits the AI provider endpoint that predates this change. The response decode is also version-agnostic — the removed provider column is simply an unknown field that Go drops, and ai_provider_id decodes into the non-pointer uuid.UUID identically on both old and new servers.

Refs coder/coder#26877.

Closes CODAGT-753

Copy link
Copy Markdown
Member Author

@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch 2 times, most recently from 96ee5a8 to 3064f9c Compare July 7, 2026 02:30
@ethanndickson ethanndickson marked this pull request as ready for review July 7, 2026 02:55
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 3064f9c to 5ad0b47 Compare July 7, 2026 03:01

@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: 3064f9c3eb

ℹ️ 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 integration/integration.go Outdated
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 5ad0b47 to 624a890 Compare July 7, 2026 03:04
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 624a890 to 9d3295e Compare July 7, 2026 03:07

@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: 624a890192

ℹ️ 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 internal/provider/agents_model_resource.go
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Handle legacy configs with missing AI provider IDs

Good thought, and the semantics are right — a null ai_provider_id does imply the config was soft-deleted (including the cascade when its AI provider is deleted, via DeleteChatModelConfigsByAIProviderID). But that deletion is already detected one layer up: soft-deleted rows are filtered out of ListChatModelConfigs (cmc.deleted = FALSE), so in Read a deleted config simply isn't in the returned list, and the existing fall-through handles it — AddWarning("...not found. Marking as deleted.") + RemoveResource(ctx).

So by the time lookupProviderType runs, the config either came from that list (Read) or is the active row we just wrote (Create/Update) — always non-null ai_provider_id. A null-triggered RemoveResource here would be dead code guarding a state we can't observe, since list-membership already covers the deletion case.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 9d3295e222

ℹ️ 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".

@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown

CODAGT-753

ethanndickson commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 8, 7:58 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 8, 7:59 AM UTC: @ethanndickson merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit 638623d into main Jul 8, 2026
14 checks passed
@ethanndickson ethanndickson deleted the ethan/bump-coder-sdk branch July 8, 2026 07:59
ethanndickson added a commit that referenced this pull request Jul 9, 2026
…#382)

coder/coder#26869 added a server-generated STS external ID to Bedrock AI
provider settings: when `role_arn` is set, the server generates an ID
and sends it on every AssumeRole call, so operators can require it in
the role's trust policy via an `sts:ExternalId` condition (the standard
confused-deputy mitigation). This exposes it on `coderd_ai_provider` as
a read-only `settings.bedrock.external_id` attribute, so the trust
policy can reference it in the same Terraform config that manages the
provider.

Design notes:

- The value is never sent outbound (the server rejects client-supplied
values on create and non-matching values on update), only read back into
state; empty responses from servers predating #26869 map to null, so the
attribute works against both old and new coderd with no version gating.
- A custom plan modifier preserves a stored ID (the server carries it
forward even if `role_arn` is later cleared), plans unknown while
`role_arn` is set or unknown, and pins null otherwise.
`UseStateForUnknown` would be wrong here per the "computed value derived
from mutable config" anti-pattern: the empty-to-set `role_arn`
transition would produce "inconsistent result after apply".

Builds on #381 (SDK bump). Follows up #372 (`role_arn`).

Closes AIGOV-504
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