chore: bump coder/coder SDK and adapt to chat model config changes#381
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
96ee5a8 to
3064f9c
Compare
3064f9c to
5ad0b47
Compare
There was a problem hiding this comment.
💡 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".
5ad0b47 to
624a890
Compare
|
@codex review |
624a890 to
9d3295e
Compare
There was a problem hiding this comment.
💡 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".
|
@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. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Merge activity
|
…#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

Bumps
github.com/coder/coder/v2so 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
providerfield from chat model configs and madeai_provider_idrequired. Thecoderd_agents_modelresource keeps itsprovider_typeattribute, 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
providerfield in requests, and the lookup used to deriveprovider_typehits the AI provider endpoint that predates this change. The response decode is also version-agnostic — the removedprovidercolumn is simply an unknown field that Go drops, andai_provider_iddecodes into the non-pointeruuid.UUIDidentically on both old and new servers.Refs coder/coder#26877.
Closes CODAGT-753