Drops the `has_ai_task` column from `template_versions` and
`workspace_builds` (with its index and view projections) and removes the
three task build reasons (`task_auto_pause`, `task_manual_pause`,
`task_resume`) from the `build_reason` enum. Existing rows are remapped
before the enum swap: automatic pauses become `autostop`, manual pauses
and resumes become `initiator`, and
`workspace_build_orchestrations.child_reason` follows the same mapping.
The query filters, provisionerdserver flag writes, and audit ignore
entries for the column go with it.
**Migration cost:** recreating `build_reason` rewrites
`workspace_builds`. `TestMigration000593TaskBuildReasonRewriteTiming`
seeds 1,000 workspaces, 100,000 builds (30,000 with task reasons) and
5,000 orchestrations and asserts the migration stays under a two-minute
bound; locally it takes about 0.7 to 1.0 s. The test is skipped under
`-short`.
**Breaking change:** the down migration re-adds `has_ai_task` as `false`
and restores the enum values; remapped reasons keep their new values.
**Review changes:** the migration test now asserts only the row remaps
(schema and enum introspection removed per review); renumbered from
000592 to 000593.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → #29084
notifications → **#29085 build reasons** → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and its own
migration number.
> Created by Xum (AI agent) on behalf of @ibetitsmike.
Removes the six Coder Tasks notification templates (their preferences
and inbox history go with them via cascade) and the
`preference_task_notification_alert_dismissed` user setting with its two
queries. The `task` value of `ai_seat_usage_reason` stays: seats
consumed through tasks remain consumed, and remapping their reason would
misstate billing history.
**Breaking change:** migration 000592 deletes data. The down migration
restores the template definitions, not the deleted preferences or
notification history.
**Review changes:** dropped the `ai_seat_state` remap and enum swap and
the migration unit test (both per review); moved the migration from
000591 to 000592 because main took 000591.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → **#29084
notifications** → #29085 build reasons → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and its own
migration number.
> Created by Xum (AI agent) on behalf of @ibetitsmike.
A review reuses one chat for each pull request, and that chat owns one
workspace. The workspace stops after about a day and then goes dormant.
When a later push reuses the chat, every tool call fails:
```
get workspace agents in latest build: unauthorized: rbac: forbidden
```
The review reads no files, searches no docs, and posts nothing. This job
read only the chat's terminal status, so the pull request got a green
check for a review that never ran.
Tracked in [CODAGT-1025](https://linear.app/codercom/issue/CODAGT-1025).
## How often
Measured on the deployment that runs doc-check, over 30 days:
| | |
|---|---|
| review sessions inspected | 250 |
| sessions that hit this error | 54 (21.6%), 54 distinct pull requests |
| failure on a reused chat, more than 48 h after the chat was created |
44 |
| reused chat, 6 to 48 h later | 9 |
| within 15 min of chat creation | 1 |
| first seen | 2026-07-23 |
The failing turn ran on Opus 4.8 in 49 of 54 cases, so this is not model
specific. Right now 116 of 159 review workspaces are dormant, and 20 of
those belong to open pull requests.
## What changes
A new step reads the workspace state from Coder before the chat starts.
If the workspace is dormant, the job fails, and the error and the
summary link
[CODAGT-1025](https://linear.app/codercom/issue/CODAGT-1025) and say how
to start the workspace. If Coder cannot be read, the step warns and
continues, so this never blocks a review on its own.
The prompt now tells the review what to do when a tool call fails on the
workspace, and it matches what the tools can actually do:
- stopped workspace: call `start_workspace`
- deleted workspace: `list_templates`, then `create_workspace` with the
`coder-workflow-bot` template
- dormant workspace: it cannot be repaired from inside the chat, so
stop, say the review did not happen, and post no comment
## Why the chat cannot repair a dormant workspace
A dormant workspace is a different RBAC resource.
`WorkspaceTable.RBACObject` returns `ResourceWorkspaceDormant` when
`DormantAt` is set. The chat daemon subject holds `workspace` read and
update and no `workspace_dormant` permission, so both `start_workspace`
and `create_workspace` fail on the same read before they do any work.
Full write-up, with the code paths and a suggested fix, in
[CODAGT-1025](https://linear.app/codercom/issue/CODAGT-1025).
I tested this on this pull request: with its workspace stopped and
dormant, the review called `start_workspace` twice, got `load workspace:
unauthorized: rbac: forbidden`, then stopped and posted nothing. The new
step then failed the job before the chat started, which is what the red
check on this pull request is.
## Still open
The job reads only the chat's terminal status, so a review that could
not run and a review that found nothing both report success. The dormant
case is covered here. Other failures are not.
Follow-up to https://github.com/coder/coder/pull/28919.
The tmpfs mount step only ran when `GOTMPDIR` was already exported, and
the only thing that exports it is `./.github/actions/setup-go-paths`,
which just `test-go-pg` uses. So on `test-go-pg-17`, `test-go-race-pg`
and `flake_go` the step printed `GOTMPDIR is not set, skipping` and
exited 0, and Go test binaries and `t.TempDir()` output stayed on the
root disk.
https://github.com/coder/coder/actions/runs/34359015069/job/102491022886
is one such run.
To fix, we'll just have the action default `GOTMPDIR` to
`${RUNNER_TEMP}/go-tmp` (the same path `setup-go-paths` uses) and export
it via `$GITHUB_ENV` before mounting. The skip path is gone, so a mount
failure now fails the step.
Worth noting that `test-go-pg`, where the mount was already active,
still stalled on
https://github.com/coder/coder/actions/runs/34481693660/job/102889890085,
with the `iostat` samples showing the disk at 100% utilisation
regardless. So I don't expect this to fix the stalls on its own, but it
at least makes all the Linux jobs behave the same whilst we chase the
underlying issue with Depot.
Removes AI task support from the provisioner protocol: the task-related
proto fields, terraform scanning for `coder_ai_task` resources, echo
provisioner support, the regenerated `.pb.go` and
`provisionerGenerated.ts`, and the terraform testdata that exercised
them. The provisioner API version change lives in
`provisionerd/proto/version.go`.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → #29084
notifications and usage → #29085 build reasons → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and a focused
migration test.
**Why:** the proto fields lost their last consumer in #28789; this
deletes the producer side and the wire format.
**What to scrutinize:** the proto/version handling, and that
`coder_ai_task` resources in existing templates are now ignored rather
than errors (template imports simply no longer scan for them).
**Validation:** `go build ./...`, `go test ./provisionersdk/...
./provisionerd/...`, `go test ./provisioner/terraform -run
TestConvertResources`, provisioner list golden regenerated, site tsc,
pre-commit hooks.
**Size:** +580/-1,286 over 76 files; most files are mechanical testdata
and generated-code updates.
> Created by Xum (AI agent) on behalf of @ibetitsmike.
Removes the Tasks API and task orchestration from coderd and codersdk:
the `/api/v2/tasks` handlers, task middleware and search filters, task
name generation, autobuild pause/resume logic, task notification
enqueues, telemetry, and the codersdk task types. Regenerates apidoc,
the API reference docs, and `typesGenerated.ts`.
**Breaking change:** the Tasks API is removed; requests to
`/api/v2/tasks` fail. Tasks was deprecated in v2.34.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → #29084
notifications → #29085 build reasons → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and its own
migration number.
**Why:** with the UI (#28743) and CLI (#28788) gone, this deletes the
server surface. Database tables, RBAC, and notification templates stay
until the top of the stack so every layer builds and migrates
independently.
**What to scrutinize:**
- The `enable-ai-tasks` option is removed outright (review feedback):
configs still carrying `enableAITasks` fail to parse until the key is
deleted.
- provisionerdserver now writes `HasAITask: false` on template/build
flags; the column and these lines are dropped in #29085.
- `codersdk.ResourceTypeTask` stays so audit logs recorded before the
removal keep rendering.
**Validation:** `go build ./...`, `go vet ./...`, `go test
./codersdk/...`, site biome and tsc, CLI goldens regenerated, pre-commit
hooks.
**Size:** +242/-10,792 over 76 files; additions are regenerated
docs/goldens and test fixture updates.
> Created by Xum (AI agent) on behalf of @ibetitsmike.
Removes the `release-validation` workflow. Its only job,
`network-performance`, dispatched `ci.yaml` in `coder/schmoder` on every
`v*` tag push, and has been failing with `Bad credentials` since the
`CDRCI_SCHMODER_ACTIONS_TOKEN` secret expired, e.g. on `v2.34.9`:
https://github.com/coder/coder/actions/runs/33473690657/job/99748425314.
A user saw the red check and asked whether the release was okay. Nobody
currently owns the schmoder side of this, so we'll just remove it until
it's prioritised again.
`CDRCI_SCHMODER_ACTIONS_TOKEN` is now unused and can be deleted from the
repository secrets.
Closes CODAGT-878
This issue has bounced between Done and Triage since July, so I spent
some time working out where it was actually coming from before touching
anything.
The error is a server-sent HTTP/2 `RST_STREAM` from `proxy.golang.org`,
e.g. from https://github.com/coder/coder/actions/runs/34257346575:
```
github.com/armon/circbuf@v0.0.0-20190214190532-5111143e8da2: read "https://proxy.golang.org/github.com/armon/circbuf/@v/v0.0.0-20190214190532-5111143e8da2.zip": stream error: stream ID 173; INTERNAL_ERROR; received from peer
make: *** [Makefile:645: fmt/go] Error 1
```
It isn't Depot. The Go project sees the identical error on its own LUCI
builders (https://github.com/golang/go/issues/51323, 9 reports in August
and 4 so far in September, versus roughly one a month before that), and
someone on that thread reported it from GitHub-hosted runners too.
There's a CL in review to have `cmd/go` resume broken downloads
(https://go-review.googlesource.com/c/go/+/824044), but that won't reach
us on 1.26.x.
The reason it only started for us in July is on me: #27250 removed the
`go-cache` action, which also removed the retried `go mod download`
prefetch from every Go job, and the first report was the next day.
#27816 put the prefetch back for `lint` and `test-e2e` only, and since
then those two jobs have had zero recurrences across the 19 later
failing runs, whilst every recurrence has been in a job without it
(`fmt`, `gen`, `test-go-pg`, `test-go-race-pg`, `offlinedocs`).
So, the fix is just to add the same step everywhere else: `gen`, `fmt`,
`test-go-tailnet-integration`, `offlinedocs`, `sqlc-vet`, the shared
`test-go-pg` action (which covers the test matrix, `flake-go` and
`nightly-gauntlet`), and the bare `go mod download` in `pr-deploy`.
I did initially also set `GOPROXY=https://proxy.golang.org|direct`, so
`cmd/go` would fall through to a VCS fetch on any proxy error rather
than just 404/410, but I've dropped it. The Go team explicitly declined
to make that the default for security reasons
(https://github.com/golang/go/issues/37367), the fallback is silent so
we'd lose visibility of proxy incidents, and
`github.com/charmbracelet/glamour` contains Git LFS files, so a direct
fetch of it on our runners (which have `git-lfs` installed) would
produce a different zip and fail with a checksum mismatch
(https://github.com/golang/go/issues/41708). Not worth it for the rare
case where three consecutive proxy attempts all fail.
Removes every in-repo Tasks client: the `coder exp tasks` CLI command
family, the tasks scaletest runner, and the task-driven triage
automation (`traiage.yaml`, `code-review.yaml`,
`classify-issue-severity.yml`, `scripts/traiage.sh`). Triage runs
through `triage-via-chat-api.yaml` and coder/create-agent-chat-action
instead.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → #29084
notifications and usage → #29085 build reasons → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and a focused
migration test.
**Why:** clients come off before the API they call. After this layer
nothing in the repo invokes the Tasks API outside coderd itself.
**What to scrutinize:** all but three files are whole-file deletions.
`triage-via-chat-api.yaml` gets a comment fix. `NavbarView.tsx` and its
stories carry two small repairs to the frontend layer below (unused
`user` prop, stale `TasksFilter` story wiring) so the stack lints clean
from this layer up; they rebase away if folded into #28743.
**Validation:** `go build ./...`, `go test ./cli -run TestCommandHelp`,
site tsc, pre-commit hooks (gen, fmt, lint).
**Size:** +4/-6,938 over 42 files; effectively pure deletion, so it
reads much faster than the line count suggests.
> Created by Xum (AI agent) on behalf of @ibetitsmike.
Follow-up to #29194. That PR let us pick the review model, and picking a
smaller local model exposed a hole in the instructions rather than in
the model.
## What went wrong
On a PR that raises one documented default from `1m` to `5m`, the review
read the diff, saw that the diff already regenerated
`docs/reference/cli/server.md`, concluded "the changes are minimal and
fully accounted for", and posted nothing. Two pages still stated the old
default. It never searched `docs/` at all, because nothing required it
and staying silent was the cheapest exit.
A larger model went looking on its own and found one of the two pages.
That difference is initiative, not judgment, so the instructions have to
supply it.
## What changes
`.claude/skills/doc-check/SKILL.md`, step 3: name the search, show the
command, and say plainly that a review of only the files in the diff is
not a review.
```sh
grep -rn '<the old literal>' docs/ | grep -v '^docs/reference/'
```
Step 5: staying silent is a finding and earns the same evidence. Post
nothing only after every search comes back empty outside
`docs/reference/`. "The diff already updates its own reference page" is
not a reason to skip the search.
The workflow prompt says the same in short, so the requirement is
visible without loading the skill.
## Measured
One real PR that changes a documented default, same model, same harness,
before and after this change:
| | Before | After |
|---|---|---|
| `prebuilt-workspaces.md` (guide states "defaults to 1 minute") |
missed | found |
| `configuration-reference.md` (generated, still states the old default)
| missed | found |
| Declined to ask for a hand edit of the generated CLI reference | n/a,
stayed silent | correct |
| Outcome | silent pass | both gaps reported |
The larger model, on the same PR before this change, found the first
page and missed the second.
The examples in the text deliberately use an unrelated value, so the PR
above stays usable as a blind regression case.
Enables the `role-supports-aria-props` oxlint rule (jsx-a11y), moving it
out of the migration backlog and setting it to `error`.
Stacked on top of #29191. Review that PR first; the base of this PR is
its branch.
## Fixes for the two violations the rule surfaced
- **`Autocomplete.tsx` (select-only trigger button):** removed
`aria-invalid` from the `<button>`. `aria-invalid` is not exposed by the
implicit `button` role, so it had no effect for assistive tech. The
error message linkage via `aria-describedby` (a global attribute) is
kept. The only consumer that sets an invalid state
(`ModelIdentifierField`) uses the `inlineSearch` variant, which renders
an `<input role="combobox">` that still keeps `aria-invalid` (valid
there).
- **`AgentLatency.tsx` (latency popover trigger):** the trigger was a
`<span role="presentation" aria-label="latency">`; `presentation` does
not support `aria-label`, and a presentational role on an interactive
trigger is wrong. Converted it to a real `<button>` with reset styling
so it stays visually identical (inline colored text, no button chrome)
while being a focusable, correctly-labeled control.
## Verification
- `oxlint --deny-warnings`: 0 warnings, 0 errors.
- `biome lint --error-on-warnings` on the changed files: clean.
- `tsc -p .`: clean.
- Storybook visual check of `components/AgentRow --example`: latency
renders as inline colored text (no boxed button) and clicking it still
opens the "Latency" popover.
---
_This PR was generated by Coder Agents on behalf of @jeremyruppel._
Enables the `anchor-ambiguous-text` oxlint rule (jsx-a11y), moving it
out of the migration backlog and setting it to `error`.
The codebase already has zero violations, so no code changes were
needed. Verified with `oxlint --deny-warnings` (0 warnings, 0 errors)
and confirmed the rule is active by testing it against a known-bad
`<a>click here</a>` sample.
Per request, the corresponding Biome rule (`a11y/noAmbiguousAnchorText`)
is intentionally left enabled for now so both linters double-check this.
---
_This PR was generated by Coder Agents on behalf of @jeremyruppel._
This lets us choose which model reviews a PR for documentation, instead
of always using the deployment default. Set the repository variable
`DOC_CHECK_MODEL_CONFIG_ID` to a model configuration ID to pick one, and
clear it to go back. We want this so doc-check can run on a local LLM at
no marginal cost. It also pins the chat organization, because the bot
account belongs to many organizations and the model ID only works inside
one of them.
The skill file gains the review order that scored best when we
benchmarked this job against 48 real merged PRs: list what the user
experiences, check the guide and the list page separately, find the
exact stale sentence, treat a PR that ships its own docs as done, and
write the evidence before the verdict.
The local LLM we tested still scores lower than a frontier model on our
benchmark, 89.6 percent against 96.6 percent but is deemed effective for
this use case and we'll continue to iterate on models/instructions
Enables the `heading-has-content` oxlint rule
(jsx-a11y/useHeadingContent), moving it out of the migration backlog and
into the enforced a11y rules.
Fixes the three heading wrapper components that spread props onto a bare
heading element (`AlertTitle`, and the
`SectionHeading`/`FilterGroupHeading` in the agents filter popover) so
they destructure and render `children` explicitly, letting the rule
verify the headings have content.
> [!NOTE]
> Stacked on top of #29188. Review and merge that PR first.
> [!NOTE]
> This PR was generated by Coder Agents on behalf of @jeremyruppel.
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.
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.
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.
## 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>
## 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.
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
> 🤖 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
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>
- 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.
- 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.
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.
> 🤖 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>
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.
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.
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.
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.
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
- 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.
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.
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
> 🤖 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.
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
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.
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.
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
## 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>
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.
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.