Commit Graph
16370 Commits
Author SHA1 Message Date
Jeremy Ruppel 531637744a chore(site): enable role-has-required-aria-props oxlint rule (#29188)
Enables the `role-has-required-aria-props` oxlint rule
(jsx-a11y/useAriaPropsForRole), moving it out of the migration backlog
and into the enforced a11y rules.

Fixes the two resulting violations:

- `ModelSelector.tsx`: wire `aria-controls` on the combobox trigger to a
`useId`-generated id set on the listbox `CommandList`.
- `Autocomplete.tsx`: add `aria-selected` to each `option`, driven by
the highlighted index.

> [!NOTE]
> This PR was generated by Coder Agents on behalf of @jeremyruppel.
2026-09-10 14:59:41 -04:00
Bobby Ho 42fcd332c6 fix: remove CORS from the OAuth2 authorization endpoint (#29143)
fix(oauth2): exclude authorization endpoint from permissive CORS

- Apply standard CORS to `/oauth2/authorize`, with or without a trailing slash, as required by OAuth 2.1 §3.1.
- Normalize repeated slashes before selecting the policy to prevent exclusion bypasses, including in wsproxy.
- Preserve permissive CORS for other OAuth2 endpoints, discovery documents, and MCP. Same-origin consent behavior is unchanged.
- Add middleware and router regression tests and update provider security docs.
2026-09-10 10:49:28 -07:00
Andrew Aquino dd313a5dd8 feat(site/src/pages/TemplateBuilder): remove redundant optional field labels/placeholders (#28928)
removes "optional" labels and placeholder text from optional fields in
Template Builder, because they're already marked as optional by being
tucked into the "Additional settings" accordion

## What

Resolves
[DEVEX-830](https://linear.app/codercom/issue/DEVEX-830/remove-optional-from-optional-template-builder-fields-placeholder-text).
This is an isolated slice of #27077 (its item 4), rebased onto current
`main`; nothing else from that PR is included.

## Changes

- **Remove the `(optional)` indicator** from optional fields.
Non-required select/radio/switch-group labels and the module-variable
label no longer append "(optional)" (the required `*` marker is
unchanged).
- **Stop writing `"Optional"` into placeholders.** The fallback is now
`"Required"` for required fields and an empty string otherwise, in both
`ModuleSettingsStep` and `BaseTemplateParametersStep`.
- **Per-module placeholder overrides.** New `moduleFieldPlaceholders.ts`
exposes `getModuleFieldPlaceholder(moduleId, varName)` backed by an
override table (locked by `moduleFieldPlaceholders.test.ts`). Precedence
in the module step: override → `defaultPlaceholder(variable.default)` →
`"Required"`/`""`.

  | Module | Field | Placeholder |
  |---|---|---|
| `codex` | `model_reasoning_effort` | `none, minimal, low, medium,
high, or xhigh` |
  | `claude-code` | `anthropic_api_key` | `sk-ant-...` |
  | `claude-code` | `model` | `e.g. claude-sonnet-5` |
  | `git-clone` | `base_dir` | `$HOME` |
  | `git-clone` | `branch_name` | `Default branch` |
| `dotfiles` | `description` | `e.g https://dotfiles.github.io or an SSH
URL git@host:user/repo` |

- **Dim placeholder text** to `content-disabled` via
`placeholder:!text-content-disabled` on the module/base text fields.

## Before / After

Storybook: `pages/TemplateBuilder/ModuleConfiguration` → `Default`, with
"Additional settings" expanded.

- **Before:** the optional field label reads `One more example
(optional)`; empty placeholders use the default `content-secondary`
tone.
- **After:** the label reads `One more example` (no "(optional)");
placeholder text is dimmed to `content-disabled`.

(Before/after screenshots are attached in the Coder chat that produced
this PR; drop them here when publishing.)

## Testing

- `pnpm check` (biome) clean
- `pnpm lint:types` (tsc) clean
- `pnpm vitest run --project=unit
src/pages/TemplateBuilder/moduleFieldPlaceholders` — 4 pass
- `pnpm vitest run --project=storybook src/pages/TemplateBuilder` — 41
pass

<details>
<summary>Context: remaining #27077 items</summary>

Per Tracy's summary, #27077's items 5 (scroll fix) and 6 (customizations
layout) are already effectively handled on `main` by later PRs (#27437,
#27797). Item 7 (required-field miss highlight) is tracked separately
(DEVEX-832). This PR is item 4.

</details>

---

Coder Agents generated, on behalf of @aqandrew.
2026-09-10 10:14:49 -07:00
Jeremy RuppelandCoder Agents e9429903d4 fix(agent): launch stdio MCP servers in the workspace dir (#29153)
## Problem

stdio MCP servers declared in `.mcp.json` were launched from the agent's
own working directory, which is unspecified and often a temp dir
(observed `/tmp/coder.*`). Relative paths in a server's `Args` (for
example a language server `-workspace ./site/`) resolved against that
temp dir instead of the workspace, so:

- `typescript-language-server` failed immediately: the resolved
`./site/` did not exist under the temp cwd.
- `go-language-server` connected but gopls rooted at the temp dir, so
workspace symbol lookups failed while per-file hover still worked.

The agent log showed `connection closed: calling "initialize": client is
closing: EOF`.

<img width="682" height="606" alt="Screenshot 2026-09-09 at 5 33 58 PM"
src="https://github.com/user-attachments/assets/650f1305-d807-406e-864e-e347e9a4c52d"
/>

## Fix

Launch stdio MCP servers in the workspace working directory instead of
inheriting the agent's cwd.

- `agent/agent.go`: hoist a single `workingDirFn` closure (reads
`a.manifest.Load().Directory`, `""` before the first manifest) and reuse
it for the process API, MCP manager, and context config/manager wiring.
- `agent/x/agentmcp/manager.go`: `Manager` gains a `workingDir func()
string`; `createTransport` sets `cmd.Dir = m.resolveWorkingDir(ctx)` for
the stdio path. `resolveWorkingDir` routes through
`usershell.ResolveWorkingDirectory`, the same helper SSH sessions and
the process API use, so the three cannot drift: an existing configured
dir is used, otherwise the user's home dir. Returns `""` (inherit) only
when the callback is nil or empty.

`.mcp.json` is unchanged. Storybook is untouched.

## Tests

- `TestCreateTransport_StdioSetsWorkingDir`: constructs the manager via
`NewManager` and asserts the stdio transport's `Command.Dir` is the
workspace dir.
- `TestResolveWorkingDir`: table cases for nil/empty callback (inherit),
existing dir, missing dir, and a path that is a file (both fall back to
home).

## Checks

`make fmt`, `make lint`, and `go test ./agent/x/agentmcp/` all pass.

<details>
<summary>Design notes and alternatives considered</summary>

First-principles contract: MCP servers should launch in the workspace
working directory, matching existing docs and agent subsystem behavior,
not the config directory that declares them.

An earlier iteration set `cmd.Dir` from the config file's directory;
review found that fragile (global config locations, `$HOME` semantics).
It was replaced with the workspace-dir callback that reuses
`usershell.ResolveWorkingDirectory` for consistency with SSH and the
process API.

A tooling-only alternative also exists (resolve the language-server
workspace via a `WORKSPACE` env value in `.mcp.json`). The agent-side
fix was preferred because it corrects the root cause for every stdio MCP
server, not just the two language servers, and keeps `.mcp.json`
portable.

Deferred (not in this PR): converting `NewManager` to an options struct
to avoid positional `nil` churn, and setting `PWD` alongside `cmd.Dir`.

</details>

---

Generated by Coder Agents on behalf of @jeremyruppel.

---------

Co-authored-by: Coder Agents <agents@coder.com>
2026-09-10 10:49:00 -04:00
Susana Ferreira efea5dc1f3 fix: persist models filters in URL (#29106)
## Description

The provider filter, search query, and page on the Models page were held
in local component state, so navigating to a model and back reset them.

The filter state now lives in URL search params, so it survives back
navigation and is shareable and refresh-safe.

## Changes

- Persist the provider filter, search query, and page in URL search
params.
- Add a Storybook story verifying the provider filter persists across
navigation.

Closes https://linear.app/codercom/issue/AIGOV-641

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-10 15:18:06 +01:00
Marcin Tojek a763e2ea6a chore(docs): update release docs for v2.36.5 (#29177)
Automated docs update for v2.36.5 release.

Created by `releasetui`.
2026-09-10 16:15:56 +02:00
Danielle Maywood 492502a51e test(site/src/pages/AgentsPage): strip visual assertions from form and settings plays (#29128) 2026-09-10 14:05:39 +00:00
Jake Howell 599b87e1c2 fix(site/src/pages/AgentsPage): keep the prompt composer editable while chats load (#29119)
Keep the prompt composer editable while chat and create-form data is
still loading, and only block Send until models, MCP, overrides, and
related checks are ready. Archived chats hide the composer entirely once
the chat record is known, so a locked prompt box is not left sitting
under a read-only transcript.

- Typing stays available during load; Enter and Send no-op until the
form can actually submit
- Archived, other-user, and forbidden chats stay non-editable (archived
hides the input)
- The loading skeleton can still flash the composer before archive state
arrives
2026-09-10 13:53:56 +00:00
Danielle Maywood 8a69ce982e test(site/src/pages/AgentsPage): strip visual assertions from conversation and tool plays (#29127)
Move a whole bunch of Coder Agents tests from asserting on DOM elements
to not (making better use of Pixel).
2026-09-10 14:17:10 +01:00
Jake Howell 712c7634a2 refactor(site): drive plan mode from mutation pending state (#29117)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

use React Query mutation state as the source of truth for pending chat
workspace and plan mode updates

- disables chat-turn actions while chat settings or another submission
are pending
- clears plan mode atomically when sending the Implement Plan message
- keeps Ask User Question responses open and retryable when submission
fails
- removes the parallel Promise-ref tracking and reconciliation helper
2026-09-10 23:10:58 +10:00
Yevhenii ShcherbinaandSusana Ferreira 80c2621f9d docs: document missing AI model price notifications (#28775)
Documents the weekly **Missing AI Model Prices** notification, its
recipients, limits, and delivery defaults.

Follows up on #28419.

---

Created by Coder Agents on behalf of @evgeniy-scherbina.

---------

Co-authored-by: Susana Ferreira <susana@coder.com>
2026-09-10 12:38:15 +00:00
david-fraley fef0763820 feat: report template builder build failure reasons in telemetry (#28586) 2026-09-10 08:21:29 -04:00
Ehab Younes 0aae890d03 feat: return per-app session counts from workspace agent stats queries (#29134)
- Make all six raw session-count queries return a session_counts JSONB
object keyed by app name instead of fixed per-family columns. Fold the
results into existing family fields in Go using the shared SDK registry,
including unrecognized names under unknown.
- Remove the registry parameters and associated dbauthz validation from
these queries, which no longer perform family attribution in SQL.
Preserve existing deployment stats, Prometheus, and telemetry outputs.
- Select session maps directly in the two latest-row queries instead of
decomposing and reaggregating a single row. Keep byte, connection, and
latency aggregates independent of per-app expansion.
- Add regressions for latest eligible rows, empty session maps, distinct
same-family app names, labels, and unchanged traffic aggregates.
2026-09-10 14:07:03 +02:00
Ehab Younes da45488208 feat: attribute session counts by app family (#28337)
- Centralize app-to-family attribution in the SDK registry so recognized
app aliases contribute to their family's session counts and usage
minutes without duplicating name lists across SQL queries.
- Pass the registry into agent stats queries, insights, and usage rollups.
- Validate its structure in dbauthz so missing or renamed families fail
explicitly instead of silently producing zero counts.
- Decompose session maps once per row for per-agent sums while retaining
the key-presence checks used by insights. Update reporting consumers
and add coverage for alias attribution and registry validation.
2026-09-10 13:54:11 +02:00
Danielle Maywood 81562205f6 test(site/src/pages/AgentsPage): strip visual assertions from sidebar and input plays (#29126)
Move a whole bunch of Coder Agents tests from asserting on DOM elements
to not (making better use of Pixel).
2026-09-10 12:13:13 +01:00
Susana Ferreira 3ed8548e78 fix: unblock AI price book refresh for gpt-6-astra and qwen3.8-max (#29170)
The weekly `aigateway-prices-refresh` job
[failed](https://github.com/coder/coder/actions/runs/34458761592)
because two upstream-guard assertions in the generator tripped:
models.dev now lists OpenAI's `gpt-6-astra` (so its `overrides.jq`
injection must be dropped), and the curated OpenRouter
`qwen/qwen3.8-max` identifier was renamed upstream to
`qwen/qwen3.8-max-0902`.

This removes the `gpt-6-astra` injection, repoints the qwen curation
entry to `qwen/qwen3.8-max-0902` (with a `displayName` override to keep
the clean "Qwen3.8 Max" label in the UI), and regenerates `prices.json`
and `knownModelsGenerated.json`.

Note: because the artifacts regenerate from live models.dev, this diff
also carries unrelated upstream drift, the same content the scheduled
refresh PR would produce.

> [!NOTE]
> Generated with Coder Agents on behalf of @ssncferreira.
2026-09-10 11:31:23 +01:00
Jake HowellandTyler 8a4f2f80fa refactor: implement standard IdP sync settings (#28935)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell.

Refactors the IdP sync settings pages to use the shared settings
patterns and make group and role mapping management clearer. It also
separates claim-value loading between the two tabs so each form
consistently reflects its configured sync field.

- reorganizes group and role sync controls into clearer settings
sections (standard components)
- preserves the group and role tabs while loading claim values
independently
- adds a typed confirmation dialog before deleting group mappings
- consolidates policy export and unseen-claim UI into shared components

| <img width="2880" height="1800" alt="idp-sync-group-settings"
src="https://github.com/user-attachments/assets/bc0cca7d-f56d-459b-a284-518a551386bb"
/> | <img width="2880" height="1800" alt="idp-sync-delete-dialog"
src="https://github.com/user-attachments/assets/702a8435-8f0c-4232-b515-1df4210f1500"
/> |
| --- | --- |

---------

Co-authored-by: Tyler <tyler.tate@coder.com>
2026-09-10 20:28:09 +10:00
Hugo Dutka 8e3c36ec5a fix: standardize org use in the mcp server tools (#29141)
Addresses
https://linear.app/codercom/issue/CODAGT-970/expose-mcp-tools-for-organization-selection.

Currently our MCP server does not handle organizations consistently.
Some tools, like `create_template`, use a random organization if the
user is in multiple orgs. Others, like `create_chat`, pick the
organization which contains the latest chat the user spawned.

This PR standardizes organization use in the MCP server tools.
Organization ID is now in the argument schema of all tools that depend
on it. It's always optional. If the user is only a member of one
organization, tools default to that organization. If the user is a
member of multiple organizations, tools return an error asking to supply
an organization id.

This PR also adds a new `list_organizations` tool to allow MCP clients
to view the organizations that the user has membership in.
2026-09-10 11:48:08 +02:00
Danielle Maywood c21e6f3cfb test(site/src/pages/AgentsPage): strip visual assertions from chat page plays (#29125)
Move a whole bunch of Coder Agents tests from asserting on DOM elements
to not (making better use of Pixel).
2026-09-10 09:37:13 +01:00
Ethan d8e3f4fcf7 feat: evict the oldest attachments at the chat file cap (#29063)
Closes CODAGT-933

Long agent sessions were hitting the 50 attachment cap, after which
every upload, screenshot and `attach_file` call was rejected, so people
were abandoning otherwise healthy chats.

Rather than raise the cap (which just moves the cliff and multiplies the
worst-case per-chat `bytea` storage), a chat now keeps its 50 most
recent attachments. `LinkChatFilesAfterLock` deletes the oldest
`chat_files` rows in the same statement and the cascade drops their
links. Files in the incoming batch are never evicted, so the only
remaining rejection is a single message with more than 50 files.

Nothing in the product ever linked one file to two chats, so rather than
guard the eviction against it, this adds `UNIQUE (file_id)` on
`chat_file_links`, with the migration dropping any existing duplicates
in favour of the oldest chat.

Evicted attachments render as the existing "Attachment expired" tile. A
`pinned` flag is the obvious follow-up if someone needs to keep a
specific file around.
2026-09-10 13:40:16 +10:00
Ethan 0f00f7a86f fix(site): preserve organization in model setup links (#28631)
The model setup call to action opened AI settings without the current
chat's organisation, so the models page would select a different one.
We'll now carry the chat organisation through in the setup link.

The AI settings sidebar had the same gap: the Models, Coder Agents and
MCP servers links were hardcoded without `?org=`, so switching between
them from a non-default organisation dropped you back to the default.
Those three links now forward the current `org` search param;
deployment-wide links (Providers, Templates, etc.) don't need it.
2026-09-10 12:08:17 +10:00
dylanhuff-at-coder 6b3aec6b03 feat(site): show effective user secret targets (#28520)
When a deployment disables file path delivery, the Secrets page derives
effective delivery from the capability plus stored fields: the type
badge and enable toggle ignore blocked paths, stored paths render as
saved but not written to workspaces, file-only secrets show `not
injected`, and new secrets require an environment variable. The edit
dialog lets users remove a blocked path (disabling the secret in the
same request when it was the only target) or add an environment
variable; nothing changes a path or the enabled state without an
explicit user action.

3 of 4 in the stack (#28518 and #28519 are merged); the final PR adds
CLI and docs. Refs #27488.

Reviewed and updated by Coder Agents on behalf of @dylanhuff-at-coder.
2026-09-09 13:28:14 -07:00
Bobby Ho 1818844069 fix: ignore unrecognized parameters at the token endpoint (#29139)
fix(oauth2): ignore unrecognized token request parameters

Align `/oauth2/tokens` with OAuth 2.1 §3.2 and `/oauth2/authorize` by ignoring unknown parameters and logging only their names at debug level, never values. Continue rejecting duplicate known parameters, with tests covering all nine and shared unknown-parameter inputs across both endpoints. Misspelled optional parameters are now ignored rather than returning 400. Changes are limited to `coderd/oauth2provider`, with no new endpoints or schema changes.

Closes https://linear.app/codercom/issue/PLAT-577
2026-09-09 11:42:57 -07:00
Bobby Ho 716a3fdbfd fix: match OAuth2 redirect_uri against every registered redirect URI (#29014)
- Fix OAuth2 redirect validation to accept any registered URI, resolving Cursor’s rejection when using its second callback (fixes #28910; stacked on #29013).

- Deduplicate primary and alternate callbacks, validate every registered entry, preserve primary-callback defaults and existing code-to-token redirect checks, and stop exposing registered URLs in errors.

- Add regression tests and update documentation; defer admin removal of registered URIs (PLAT-619) and requiring redirect_uri when multiple URIs are registered (PLAT-620) to follow-ups.
2026-09-09 11:25:17 -07:00
Bobby Ho 9f27e2b17c feat: let an OAuth2 refresh narrow the granted scope (#28751)
fix: honor scope narrowing on OAuth2 token refresh

Allow `POST /oauth2/tokens` to mint an access token with the requested
scope when covered by the consented grant. Narrowing affects only the
new access token; the stored grant and rotated refresh token scope remain
unchanged. Omitting `scope` uses the full grant.

Validate scope names against the catalog, then compare permission
coverage rather than set membership so `coder:all` grants can narrow.
Reject unknown or uncovered scopes with `400 invalid_scope` without
minting tokens or consuming the refresh token. Refresh still does not
re-check the app's current allowlist.

- Sanitize and cap token endpoint `error_description`, sharing the
  authorize path's length limit.
- Rename the scope-coverage log field `allowlist` to `ceiling` and add
  `phase=refresh`.
- Update provider docs for scoped refreshes, `invalid_scope`, composite
  scope caveats, and OAuth 2.1 draft -16.

Part 1 of 3 for PLAT-481, the final phase of PLAT-470.
2026-09-09 11:08:34 -07:00
Cian Johnston 74d1eef834 feat: support non-Anthropic models on Bedrock Mantle (#28404)
Migrates bedrock-typed provider construction to the standalone Bedrock
provider introduced by #28420, then removes the legacy Bedrock behavior
from the Anthropic provider. Existing provider and integration tests are
updated to use the new type; legacy environment configuration preserves
the `anthropic` route name while reporting provider type `bedrock`.

Adds chatd model-ID inference for Bedrock providers: `anthropic.*`
models keep the Anthropic Messages client, while other models use the
OpenAI Responses client. BYOK header format follows the inferred wire
shape.

A credential-gated live integration test discovers the Mantle catalog
from `/v1/models` and probes every model through the bridge. The
`openai.gpt-oss-*`, `google.gemma-4-*`, and `xai.grok-*` families are
documented as currently unsupported because Mantle serves them only on
routes the prefix-based rules cannot reach.

Depends on #28420.

## Smoke tests

Validated against a local `develop.sh` server on August 22, 2026:

- Coder Agents passed with Anthropic over InvokeModel, and Anthropic,
OpenAI, and Mistral models over Mantle.
- Claude Code passed the InvokeModel and Mantle Anthropic flows.
- Crush passed all four flows, including Mantle OpenAI and third-party
Chat Completions.

Models tested: `us.anthropic.claude-sonnet-4-6`,
`anthropic.claude-sonnet-5`, `openai.gpt-5.6-luna`, and
`mistral.ministral-3-14b-instruct`.

> Generated by Coder Agents
2026-09-09 18:28:57 +01:00
Jake Howell 4166fafc86 fix(site): redirect after creating organization (#29138)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell.

The create organization page regressed the redirect fix from #26890 when
its mutation moved into the page view. The per-call success callback can
be dropped when organization cache invalidation temporarily unmounts the
form.

Await the mutation and navigate inline so successful creation reliably
opens the new organization. If creation fails, `mutateAsync` rejects
before the success toast and navigation, while the mutation error
continues to be displayed by the existing error alert.
2026-09-10 01:58:31 +10:00
Jake Howell afabc3cc67 refactor(site/src/pages/AgentsPage): move chat sharing into ChatTopBar (#29116)
ChatTopBar now checks share permission and renders the sharing popover
itself, instead of receiving a canShareChat flag and
renderChatSharingContent from AgentChatPage.

- Drop canShareChat from AgentChatPageView
- Drop the renderChatSharingContent render prop
- Cover the share button from ChatTopBar stories
2026-09-09 15:06:41 +00:00
Sas Swart d5e2ca74cd chore: rename recorderTranslation to DRPCRecorder (#29133)
The old name, `recorderTranslation`, did not clarify from what calls
were being translated, nor to what they were being translated. The new
name, `DRPCRecorder`, immediately explains that calls are being recorded
over DRPC.

This was a readability hurdle while trying to investigate touch points
for AIGOV-358.

This is the first step towards implementing either a /dev/null-esque
recorder or a logging recorder as per the requirements in AIGOV-358.
2026-09-09 16:55:45 +02:00
Jake Howell 6bc033eebd refactor(site/src/pages/AgentsPage): fetch workspace options in <ChatPageInput /> (#29118)
Stop drilling `workspaceOptions` from the chat page into the composer.
`ChatPageInput` now loads the owner-me workspace list and merges in the
linked workspace, so the page only passes `onWorkspaceChange` and
mutation-pending.

- Drop `workspaceOptions` from `AgentChatPage` and `AgentChatPageView`.
- Seed `workspacesKey({ q: "owner:me", limit: 0 })` in chat stories
instead of passing the list as a prop.
- Leave create-chat alone; `AgentCreateForm` still owns that list.
2026-09-10 00:54:13 +10:00
Cian Johnston 5973e27e13 feat(aibridge): introduce standalone Bedrock provider (#28420)
Introduces a standalone Bedrock provider alongside the existing
Anthropic-backed Bedrock path. The new provider implements the full
`Provider` interface and supports Messages, Chat Completions, and
Responses, with the OpenAI routes guarded to the Mantle protocol.

Adds Bedrock-specific OpenAI interceptor constructors so existing
OpenAI, Copilot, and Anthropic call sites remain source-compatible.
`bedrocksig.MantleConfig` carries only the base URL, region, and
credentials required by the OpenAI-shaped interceptors. Existing
provider wiring is unchanged in this PR.

Tests are scoped to the new Bedrock type and its supporting URL/signing
behavior. The existing Anthropic Bedrock implementation remains intact
for the follow-up migration PR.

> Generated by Coder Agents
2026-09-09 15:27:42 +01:00
Nick Vigilante b23d73d501 docs: retire the generated feature stage lists (#29113)
## Problem

`docs/install/releases/feature-stages.md` advertised two generated
lists, and neither one earned its place:

- **Available early access features** rendered "Currently no
experimental features are available." The generator read
`ExperimentsSafe`, which is empty, while `ExperimentsKnown` in
`codersdk/deployment.go` defines fourteen experiments. The page told
readers no experimental features existed, which is false.
- **Available beta features** rendered a table built from `state: beta`
nodes in `docs/manifest.json`. It is only as accurate as those flags,
which are easy to forget when a feature graduates.

Both are drift surfaces that promise a completeness the docs cannot
maintain.

## Change

Retire the indexes rather than repair them:

- Delete `scripts/release/docs_update_feature_stages.sh`.
- Remove both generated sections from `feature-stages.md`, along with
their `BEGIN`/`END` markers and `DO NOT EDIT` banners.
- Drop the `docs/install/releases/feature-stages.md` Makefile target and
its two generated-files-list entries, so the page is no longer treated
as generated.

The page keeps everything that describes the stages themselves: the
stage comparison table, the early access / beta / GA guidance, and the
`--experiments` enabling instructions. Nothing else links to the removed
anchors.

## Verification

- `make gen` leaves no unstaged changes beyond the three intended edits.
- `pnpm run lint-docs` passes with 0 errors; `markdown-table-formatter`
reports no formatting to apply.
- `grep` confirms no remaining references to the deleted script, and no
inbound links to `#available-beta-features` or
`#available-early-access-features`.

## Context

Supersedes #28949, which took the opposite approach and generated the
experiments list from `ExperimentsKnown`. Following discussion with
David, the decision is not to advertise either list.

<details>
<summary>Decision log</summary>

**Why not fix the experiments list instead?** That was #28949: a new
`scripts/experimentsdocgen` generator plus a committed
`docs/experiments.json`, generating the table from `ExperimentsKnown`
with descriptions parsed out of the constants' comments. It worked, but
it made the docs responsible for tracking an internal, unstable surface.
Experiments are by definition subject to removal or rename without
notice, and several of the constant comments are developer notes rather
than user-facing prose.

**Why remove the beta table too?** The original ask covered the
experiments list. The beta table shares the same failure mode: it is a
completeness claim maintained by proxy, through `state` flags in
`docs/manifest.json`, with nothing that fails when a feature ships to GA
and the flag is not updated. Deleting the script removes both, and David
confirmed retiring both lists.

**Why remove the Makefile target rather than leave a no-op?** With no
generated regions left in the file, keeping the target would mean the
`make -B gen` unstaged-files check still guards a page nothing
generates. Removing it lets the page be edited as ordinary prose.

**What was deliberately left alone.** The `state: beta` flags in
`docs/manifest.json` stay: they drive badges elsewhere in the docs and
are not part of this change. `ExperimentsSafe` and `ExperimentsKnown` in
`codersdk` are untouched. The feature-stage definitions and the
`--experiments` instructions stay, since readers still need to know what
the stages mean and how to opt in, and that content does not go stale as
features move between stages.

</details>

I have read the AI Contribution guidelines.

---

Linear:
[DOCS-878](https://linear.app/codercom/issue/DOCS-878/remove-the-feature-stages-generator-script-and-retire-the-generated)

🤖 Generated with Coder Agents on behalf of @nickvigilante.


<details>
<summary>CI note: unrelated flakes on the first run</summary>

The initial run of `test-go-pg-17` failed in `cli` and `coderd`:

-
`TestSSH_OneShotCommandMode/{ClosesStdinOnEOF,DoesNotRequestPTY,PropagatesExitCode,RequestsPTYWithFlag}`
-
`TestWorkspaceUpdateAutostart/{DST_start,friday_to_monday,monday_to_tuesday}`
- `TestWorkspaceFilterManual/FilterQueryHasAgentTimeout`
- The `cli` package then hit `panic: test timed out after 25m0s`.

This PR changes no Go code and no CI configuration; the diff is one
deleted shell script, one Markdown page, and the Makefile wiring between
them. Re-running the failed jobs turned everything green with no code
changes.

</details>
2026-09-09 09:44:20 -04:00
Garrett Delfosse 65d01ef9b7 fix: error on CLI HTTP redirects instead of following them (#29104) 2026-09-09 07:34:51 -04:00
Danielle Maywood cdfcbab03c test(site/src): delete duplicate storybook stories (#29018)
Each of these stories renders a visual state that a surviving story in
the same file already captures for Pixel, or asserts behavior that an
existing Vitest suite already covers. They add screenshot and test time
without adding coverage.

70 deletion candidates were reviewed; 65 are deleted. The other five
carry a visual state or security property with no surviving duplicate,
so they are kept as play-less stories and Pixel owns them:

- `SubagentWaitTimedOutTitleFromMap` and `ComputerArrayResult`
(`Tool.stories.tsx`): the subagentTitles map title and the array-form
computer result rendered as an image.
- `RunningEmptyQuestions` (`AskUserQuestionTool.stories.tsx`): the live
status region rendered instead of a form.
- `StreamingExternalImageConsentGate` (`Response.stories.tsx`): the
Cure53 CDM-02-006 streaming consent gate; the placeholder must render
instead of an `<img>` so no external request fires mid-stream. The
static-mode gate is the surviving `ExternalImageConsentGate` story.
- `RunningWithBackendError` (`ToolCall.stories.tsx`): running-over-error
icon precedence, inherently visual.

Every duplicate relationship and cited test was verified against the
code before deletion; the pixel-excluded stories are untouched. Fixtures
and imports that only the deleted stories used are removed with them.

Where a deleted story held the only coverage of a hook-level behavior,
`useFileAttachments.test.tsx` gains a storage-retention test in this
same PR, so the PR stays coverage-neutral on its own.

Stacked on #29017; base branch set to that PR. Merge order: #29017, then
this one.

Generated by Coder Agents on behalf of @DanielleMaywood.
2026-09-09 10:25:39 +01:00
Danielle Maywood f04129699f test(site/src/pages/AgentsPage): remove assertion-only story play functions (#29017)
Storybook is visual regression only in this repository: the storybook CI
job runs pixel-storybook, which loads each story, runs its play
function, waits for the DOM to settle, and screenshots it. A play
function that only asserts visible state duplicates what the screenshot
already captures, and Pixel fails the capture only when a play throws.

This removes the play functions whose bodies are purely queries and
assertions on visible state across the AgentsPage scope: 320 stories in
44 files.

What is intentionally kept:

- Every play that drives state the screenshot needs: menu opens, expand
clicks, hovers, typing, and forced-visibility setup.
- The plays of pixel-excluded stories, so their behavior coverage is not
lost.
- Stories whose play was their only property now render as plain visual
states.

Coverage impact of the removal was checked one by one. The removed plays
contained three assertions with no visual counterpart:

- `ProviderRequiresUserApiKey`'s Settings link `href` is asserted
identically in `ModelSelectorHelp.test.tsx`.
- `AdvisorTool.Running`'s `aria-expanded="true"` is asserted by the
surviving `SuccessfulAdvice` and `LongAdviceLongQuestion` stories.
- `HiddenAssistantPlaceholderDoesNotRender`'s row-suppression behavior
is covered by `messageHelpers.test.ts` "hides assistant messages whose
execute tool renders nothing".

None of these removed plays asserted callbacks, storage, or real browser
behavior that Pixel cannot see; nothing non-visual was lost, so no
conversion was needed. Per the FE1 contract in #29016, what the DOM
renders belongs to the screenshot, and tests assert the non-visual
outcome of an interaction.

Generated by Coder Agents on behalf of @DanielleMaywood.
2026-09-09 10:05:28 +01:00
Susana Ferreira c181a72eab fix(enterprise/coderd): reject system user AI budget overrides (#28699)
## Description

System users cannot authenticate with the AI gateway, but the API
allowed user AI budget overrides to be configured for them.

The override endpoint now rejects system users with a clear forbidden
response.

## Changes

- Reject user AI budget overrides for system users.
- Add API regression coverage.

Related to: https://linear.app/codercom/issue/AIGOV-595
Related to: https://github.com/coder/coder/pull/28698

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-09 09:30:13 +01:00
Susana Ferreira 45fb985ce6 fix(coderd/database): exclude system users from AI budgets (#28698)
## Description

Group AI budget totals counted system users, including the prebuilds
user, even though they are excluded from the displayed member count.

The budget queries now exclude system users when calculating group
totals and over-budget user counts.

## Changes

- Exclude system users from group AI budget totals.
- Exclude system users from over-budget user counts.
- Add database regression coverage.

Closes https://linear.app/codercom/issue/AIGOV-595

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-09-09 09:29:57 +01:00
Danielle Maywood 5d048998b5 docs: correct FE1 and agent guidance on Storybook and Vitest roles (#29016)
Storybook in this repository is visual regression only. The storybook CI
job runs pixel-storybook, which loads each story, runs its play
function, waits for the DOM to settle, and screenshots it.

FE1 stated the opposite: it demanded interaction coverage in play
functions and called RTL interaction tests a violation, so agents kept
producing assertion-heavy play functions that duplicate what Pixel
already captures.

The corrected contract, in every document that restates it:

- **Visual regression is Pixel's job.** What the DOM renders, shows, or
hides is verified by the story's screenshot, not by an assertion. That
applies in both places: a `play` function must not assert at all (it
only drives state setup the screenshot needs), and a Vitest test must
not use `toBeVisible`/`toBeInTheDocument`/geometry as its outcome
assertion.
- **Vitest is the behavior check.** A test drives the real interaction
with `userEvent`, uses semantic queries to locate the element it
interacts with, and asserts the non-visual outcome: the callback
payload, the API request, the attribute value, the state change.

Files updated:

- `.claude/docs/FRONTEND_PATTERNS.md`: FE1 rewritten with both incorrect
examples (assertions in a play function, and visibility as a test's
outcome) plus a correct example asserting `onValueChange`'s payload.
- `site/AGENTS.md`: FE1 one-line summary and the Testing section.
- `AGENTS.md`: the frontend repository guardrail.
- `.claude/skills/frontend-review/SKILL.md`: the FE1 checklist now flags
visibility/presence outcome assertions in tests as a FAIL, alongside
assertions in play functions.

Follow-ups in this stack remove the assertion-only play functions and
duplicate stories that the old guidance produced.

Generated by Coder Agents on behalf of @DanielleMaywood.
2026-09-09 09:19:38 +01:00
Paweł Banaszewski 8472a6884f chore!: remove env-based AI provider configuration (#29053)
> AI tools were used to create this PR

Removes deprecated AI provider configuration through environment
variables, CLI flags, and YAML.
Deletion includes indexed providers and legacy OpenAI, Anthropic, and
Bedrock options under both AI Gateway and AI Bridge branding, eg.
`CODER_AI_GATEWAY_PROVIDER_<N>_*` or `CODER_AI_GATEWAY_ANTHROPIC_KEY`.
Removes the associated startup-seeding code.
Updates tests and documentation.

**Breaking change:** Remove [obsolete AI provider CLI flags and YAML
keys](https://coder.com/docs/ai-coder/ai-gateway/providers#database-management-of-providers)
before upgrading, otherwise Coder will fail to start with an `unknown
flag` or `unknown option` error. Provider environment variables are
ignored and no longer seed the database. Existing database-stored
provider configuration is preserved.
2026-09-09 10:16:24 +02:00
Sas Swart 6e2b0abc19 chore: improve code readability for Session Search (#29121)
Resolves feedback from [this
review](https://github.com/coder/coder/pull/28422).

Follows standard prop definition patterns for the HighlightText
component.
Improves prop names for the same component.
Edits `classifyThreadSearch` for readability.
2026-09-09 07:49:21 +00:00
christinandAndrew Aquino d44f87eed0 feat(site/src/pages/TemplateBuilder): keep Continue button enabled with inline validation (#28940)
## Summary

On the template builder (`/templates/new/builder`), the **Continue**
button was disabled until the current step's requirements were met,
leaving users with no explanation for why they could not advance.

This PR keeps the **Continue** button enabled at all times. When the
current step is incomplete, clicking Continue no longer advances;
instead it:

- shows a red validation message (12px) below the button explaining what
is missing, and
- outlines the required input fields that are blocking continuation in
red.

## Changes

- Removed the `disabled={!canContinue}` guard from the Continue button
so it is always clickable.
- `handleNext` blocks navigation when the step is incomplete and reveals
the red validation message instead.
- Added `continueErrorMessage(stepId)` with a step-specific reason (base
template not selected, required parameters/module settings missing, no
provisioner online).
- Validation message uses a 12px (`text-xs`) font.
- When validation is triggered, empty required fields in the
base-parameters and module-settings steps are outlined in red
(`aria-invalid` + `border-border-destructive`). Optional fields are
unaffected.
- The message and outlines clear automatically once the step's
requirements are satisfied or the user moves to another step.
- Added Storybook interaction tests: `TemplateBuilderPageView` (Continue
stays enabled, message appears then clears),
`BaseTemplateParametersStep` and `ModuleSettingsStep` (required field
flagged invalid when empty).

The final-step "Create Template" button keeps its existing
provisioner-based disable behavior; this change is scoped to the
Continue button as requested.

## Visual proof

Base template step (`?step=base-infra`), no base selected:

| Before (Continue disabled) | After (Continue enabled) | After
(validation error on click) |
|---|---|---|
|
![before](https://raw.githubusercontent.com/coder/coder/pr-assets/template-builder-continue-btn/before-1-initial.png)
| ![after
enabled](https://raw.githubusercontent.com/coder/coder/pr-assets/template-builder-continue-btn/after-1-initial.png)
| ![after
error](https://raw.githubusercontent.com/coder/coder/pr-assets/template-builder-continue-btn/after-2-error.png)
|

Module settings step (`?step=module-settings`) — required field outlined
in red with the 12px message on Continue:

![module
outline](https://raw.githubusercontent.com/coder/coder/pr-assets/template-builder-continue-btn/after-3-module-outline.png)

## Testing

- `pnpm check`, `pnpm lint`, `pnpm lint:types`, `pnpm format` pass.
- Storybook interaction tests pass (`vitest --project=storybook` for the
three step/page stories).
- Verified manually against the running dev app on port 8080.

<details>
<summary>Implementation notes</summary>

Requirement: "for the template builder (`/templates/new/builder`) always
keep the continue button enabled. If the requirements to continue are
not met, show the error in red." Follow-up: "use 12px for the font size
for the error message and highlight the input fields that cause the
error with a red outline if applicable."

Approach:
1. Keep the Continue button always enabled by dropping the `disabled`
prop.
2. Gate navigation in `handleNext`: when `canContinue` is false, set a
local `showContinueError` flag and return instead of navigating.
3. Render a red (`text-content-destructive`), 12px (`text-xs`)
validation message below the nav controls when `showContinueError &&
!canContinue`.
4. Pass `showContinueError` into the step renderers as `showErrors`; the
base-parameters and module-settings steps mark each required-but-empty
field's `field.error`, which `FormField` renders as `aria-invalid` plus
a red border.
5. Clear the flag (and thus the message and outlines) when requirements
become satisfied or on step change, so nothing lingers.
6. Message text is derived per step via `continueErrorMessage(stepId)`.

</details>

---
_This PR was generated by Coder Agents on behalf of @chrifro._

---------

Co-authored-by: Andrew Aquino <dawneraq@gmail.com>
2026-09-09 09:02:23 +02:00
Harsh Singh Panwar df4a7644fd feat: import template metadata from README frontmatter on push (#28465) 2026-09-08 21:45:43 -06:00
Ethan 518d230b02 feat(site/src): hide Browser, Desktop, and Debug panels behind the add-panel dropdown (#28370)
The Browser, Desktop, and Debug right-panel tabs appeared automatically
whenever the deployment supported them, so every chat with an
`agent-browser` app mounted the app iframe at page load even if the user
never opened the panel.

These panels now start hidden and are toggled from the existing
add-panel dropdown as checkbox items. Each visible tab gets an X close
control, each panel can appear at most once, and visibility is persisted
per chat. Unsupported panels are hidden from both the dropdown and the
tab list, but a saved choice survives a temporary loss of support.
Summary, Git, and Terminal are unchanged.

<img width="244" height="154" alt="image"
src="https://github.com/user-attachments/assets/f70dbfef-510e-4f63-bf04-47c3822dea3b"
/>

Notes: `getEffectiveTabId` drops its unreachable `desktopChatId`
fallback, `DropdownMenuCheckboxItem` is new and reuses `menuItemClass`,
and existing chats lose these tabs on first load after deploy since
there is no migration.

---

Opened by Coder Agents on behalf of @ethanndickson.
2026-09-09 12:09:21 +10:00
Bobby Ho 0ad8eebbf7 fix: allow any port on loopback OAuth2 redirect URIs (#29013)
Fix: Allow variable ports for registered HTTP loopback redirect URIs (127.0.0.1, [::1], and localhost), enabling native apps to use dynamically assigned ports. Apply this registration-matching exception at both authorization and token endpoints while preserving the presented port.

Safeguards: Keep all other URI components and non-loopback matching unchanged, and retain exact code-to-token redirect URI matching, including the port.

Implementation and verification: Add shared matching logic, automated tests, and updated documentation. All 29 manual scenarios passed, although browser click-through to a listener on an OS-chosen port was not tested.
2026-09-08 17:40:10 -07:00
Bobby Ho 96ee8d171a fix: make OAuth2 code redemption single-use under concurrency (#28744)
TL;DR

Third PR in the PLAT-480 stack, on top of #28740. Fixes a race where the same authorization code could be redeemed twice concurrently.

The redeeming delete now returns the deleted row. If another request already redeemed the code, the delete returns sql.ErrNoRows and redemption fails with invalid_grant.

Each redemption runs in its own transaction, so concurrent requests serialize on the code row and only one succeeds.

The test now races two concurrent redemptions to verify single-use behavior.

No scope logic, new endpoints, or schema changes.

Depends on #28740.

Stack: #28237, #28740, this PR.
2026-09-08 16:42:34 -07:00
Jeremy Ruppel 23a1ad05fb feat(site): enable oxlint react/refs rule and fix violations (#29005)
Enables the React Compiler-powered
[`react/refs`](https://oxc.rs/docs/guide/usage/linter/rules/react/refs)
rule in `site/.oxlintrc.jsonc` and resolves the remaining violations by
moving ref reads/writes out of render:

- Lazy stable init via `useState(() => ...)` instead of
`useRef(factory()).current` (Storybook stories).
- Measure dropdown width in a layout effect instead of reading
`clientWidth` during render (`VSCodeDesktopButton`,
`VSCodeDevContainerButton`).
- Previous-value tracking via state-during-render instead of a ref
(`WorkspaceTerminalAlerts`); a render-time latch via state
(`SetupPage`); return-focus element in state (`SecretsPageView`).
- Sync a ref in an effect rather than during render
(`useSyncFormParameters`); destructure the `ref` off the `useClickable`
result so the object is not ref-tainted (`CopyableValue`).

The dynamic-parameter socket pages were already fixed in the stacked
base PR.

Depends on #29004

<sub>Opened by Coder Agents on behalf of @jeremyruppel.</sub>
2026-09-08 16:31:39 -04:00
Jeremy Ruppel 7dfe264faa refactor(site/src): track dynamic parameter socket connection in state (#29004)
The three dynamic-parameter pages (`CreateWorkspacePage`,
`WorkspaceParametersPage`, `TemplateEmbedPage`) read
`ws.current.readyState` during render to decide loading state, sourcing
render output from a mutable ref. This replaces those reads with an
`isConnecting` state toggled from the socket callbacks.

The mock dynamic-parameter socket is updated to match: it now starts in
`CONNECTING` and transitions to `OPEN` when `publishOpen` is called, and
no longer fires `onOpen` during construction. Tests emit the open event
imperatively via `mockPublisher.publishOpen()` after mount, mirroring
the real WebSocket lifecycle.

Making the mock faithful also surfaced a latent bug: when the socket
errored before opening, the loader stayed up forever. Tracking
`isConnecting` in state fixes that (see the `handles error gracefully`
test).

Prepares these pages for the `react/refs` lint rule enabled in the
stacked follow-up.

<sub>Opened by Coder Agents on behalf of @jeremyruppel.</sub>
2026-09-08 16:31:38 -04:00
Nick Vigilante dbd4924f51 chore: make content-guidelines canonical for evidence-versus-claim rule (#28594)
Agent-authored docs PRs kept leaking implementation detail into
user-facing pages: chat status enum values and `root_chat_id` on the
auto-archive page (#28570, flagged by reviewers), and RBAC resource
names and response fields in the first revision of #28482. The
correction pattern was the same each time: state the behavior in the
reader's terms.

This encodes that pattern as one canonical rule with citations in every
file that carries the exact-values instruction:

- `docs/.style/content-guidelines.md`: new guiding principle "Evidence
justifies a claim; it does not belong in the claim". The test is scoped
to the task the page documents, with a first-match ladder: exact value
where the reader types or receives it, visible product wording where the
screen shows it, plain reader's-terms prose otherwise. An identifier set
described as a set resolves at the lowest rung any member reaches.
Stripped identifiers are named (file and symbol) in the PR discussion as
a best-effort pointer for the reviewer. Cross-linked with
verify-exact-values, describe-current-version, the routing table, and
word-choice. Also repairs a pre-existing broken feature-stages link.
- `docs/.style/style-guide/word-choice.md`: the internal-references
section notes that implementation identifiers follow the (conditional)
canonical rule, covering the prose-edit route that AGENTS.md sends to
the prose style guide.
- `.claude/docs/DOCS_STYLE_GUIDE.md`: the Accuracy Standards section
head and Key Principles item 2 carry the same qualifier, since this
always-loaded file is where agents get the unqualified exact-values
instruction.
- `.claude/skills/write-docs/SKILL.md`: workflow step 1 marks copied
identifiers as verification inputs with a forward link; citation-only
"Evidence versus claim" section; matching anti-pattern bullet and a
checklist item that defers the stripped-identifier disclosure to the
canonical rule.
- `.claude/skills/doc-check/SKILL.md`: "Evidence versus claim" check
scoped to identifiers the change adds or touches, working from the diff
(doc-check does not police the disclosure, which it cannot see);
pre-existing violations on untouched pages are informational only.

The motivating page (`chat-auto-archive.md`) was fixed separately in
#28570 (DOCS-722, merged). Corpus sweep for other violations: DOCS-730.
Lint and link coverage for the `.claude` and `docs/.style` trees:
DOCS-729.

Linear: DOCS-728 https://linear.app/codercom/issue/DOCS-728

<details>
<summary>CI note (docs-only PR)</summary>

This PR changes only Markdown under `docs/.style/` and `.claude/` (no
`site/src` or other product code).

- The `ci` workflow's docs-relevant jobs pass on the head commit:
`changes`, `gen`, `lint`, `lint-docs`, `fmt`, `offlinedocs`, `required`.
Heavy build/test jobs are correctly skipped for a docs-only change.
(Run: https://github.com/coder/coder/actions/runs/32986743037)
- `Pixel / Review` (frontend visual snapshots) is unrelated to the
changed paths and is treated as an unrelated flake.

</details>

> This PR was created with AI assistance (Coder Agents).
2026-09-08 18:57:24 +00:00
Hugo Dutka 150c680a4b fix: return MCP server tool execution errors as tool results (#29051)
Coder's MCP server currently sends most tool execution failures as
top-level JSON-RPC errors. The underlying error text is transmitted like
this:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32603,
    "message": "workspace name cannot be empty"
  }
}
```


Not all clients handle it well, and some may return a generic "MCP tool
request failed." to the model instead of passing the details as tool
output.

This PR starts returning execution failures as tool results with
`isError: true` and descriptive content like this:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "isError": true,
    "content": [
      {
        "type": "text",
        "text": "workspace name cannot be empty"
      }
    ]
  }
}
```

This should make the MCP server work better across a broader range of
MCP clients.
2026-09-08 17:28:46 +00:00
Steven Masley d544f394d4 fix(coderd): keep parameter values when the render is incomplete (#29108)
Closes #29099 ([ENG-3324](https://linear.app/codercom/issue/ENG-3324)).
Follow-up to #29102, which stopped the loss propagating through stop
builds but left start builds truncating.

## What this does

A render carrying a `module_not_loaded` diagnostic could not see the
whole template, so a parameter's absence from it is not evidence the
template stopped declaring that parameter. Keep the unmatched values
instead of deleting them.

## Why preserve rather than fail

provisionerd resolves modules itself, so only coderd's render is
degraded. Keeping the value produces a correct apply and the workspace
keeps building. Failing the build would turn silent data loss into an
inability to start every workspace on an affected template version.

A complete render is still authoritative and still narrows the set, so
unrelated warnings and legitimate parameter removals behave exactly as
before.

## Tests

- `TestResolveParameters/IncompleteRender`: complete render drops,
`module_not_loaded` preserves previous and build values, unrelated
warning drops.
- `TestDynamicParametersModuleCachePurged` now continues into the start
build. On `main` it fails with `start build must not drop the module
parameter`.

<details>
<summary>Notes for the reviewer</summary>

### Detection

`preview` tags the warning with `types.DiagnosticCode(diag,
types.DiagnosticModuleNotLoaded)`, so the check is
`previewtypes.ExtractDiagnosticExtra(diag).Code ==
previewtypes.DiagnosticModuleNotLoaded` over the second render's
diagnostics. Adding future completeness codes is a one-line change in
`incompleteRender`.

### Departure from the issue's sketch

The issue proposed also gating on `v.Source != sourceDefault`, to keep
discarding values that only ever came from a default. That check cannot
fire: `sourceDefault` is only assigned to parameters present in the
render output, so an unmatched value is never default-sourced. A default
stored by an earlier build arrives as `sourcePrevious` and is
indistinguishable from user input at this layer. The condition is
omitted rather than left in as dead code.

### Not covered

Nothing surfaces the degraded render to the operator. `wsbuilder` has no
logger, and `render.go` still discards preview's diagnostics (`Logger:
slog.New(slog.DiscardHandler)`). That is the follow-up work listed in
the issue.

</details>

---

🤖 Authored by Coder Agents on behalf of @Emyrk.
2026-09-08 17:20:53 +00:00