Commit Graph
16385 Commits
Author SHA1 Message Date
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
Cian Johnston 760fd15e21 docs: add detail on testing bedrock provider with curl (#29077)
Adds directions on testing a Bedrock provider through AI Gateway via `curl`.
2026-09-08 17:59:05 +01:00
Bobby Ho d69e235edf ci: move Linux Go temp dir to tmpfs and stop Postgres statement logging (#28919)
Seven `test-go-pg` failures on `main` since 2026-08-31 share one
signature: unrelated tests in different packages expire their contexts
within the same few seconds while the process keeps logging normally.
Only filesystem writes and database round trips stall. This points at
the runner's EBS-backed root disk, not CPU.

- Mount an 8 GB tmpfs on GOTMPDIR for Linux jobs using the test-go-pg
action. It holds test binaries and per-test temp dirs. Windows and macOS
already use RAM-backed storage; Linux was the only platform on disk.
- Stop `log_statement=all` on the CI test Postgres container. Nothing in
the test jobs reads it, and with 64 concurrent tests it is the largest
continuous disk writer. The gen job keeps the default.
- Sample `vmstat` and `iostat` during the test step and upload on
failure, so the next occurrence can confirm or refute the disk theory.

Depot documents the 8-core Linux runner as an EBS volume at 8000 IOPS
and 250 MB/s behind an 8 GB in-memory write buffer, which fits a stall
that hits every writer at once.

Refs coder/internal#1365
2026-09-08 09:53:17 -07:00
Nick Vigilante 7846490770 docs: reconcile H1/label mismatches into front-matter titles (Phase 3) (#28036)
## Summary

**Batch B of Phase 3** of the H1 → front-matter migration (`DOCS-484`;
parent `DOCS-477`), the editorial follow-up to Batch A (#28030). For the
**124** hand-authored pages whose leading body H1 differed from the
manifest nav label, this promotes the richer body H1 to the front-matter
**page title** and drops the duplicate H1, while keeping the short
manifest **label** as the sidebar entry.

Policy agreed with the docs owner:
- Short sidebar labels win. Duplicate sidebar labels are acceptable.
- Identical **page titles** across two pages are not. On a collision,
rename the non-generated page's title.

## Page-title collisions resolved

Promoting the H1 created 4 page-title collisions; each is disambiguated
by renaming the non-generated / secondary page (sidebar labels left
unchanged):

| page | sidebar label | body H1 | → page title |
|------|---------------|---------|--------------|
| `install/index.md` | Install | Installing Coder | **Install Coder in
your infrastructure** |
| `install/cli.md` | Coder CLI | Installing Coder | **Install the Coder
CLI** |
| `ai-gateway/clients/jetbrains.md` | JetBrains | JetBrains IDEs |
**JetBrains** |
| `workspace-access/web-ides.md` | Web IDEs and Coder Apps | Web IDEs |
Web IDEs *(kept — primary user guide)* |
| `extending-templates/web-ides.md` | Web IDEs and Coder Apps | Web IDEs
| **Web IDEs in templates** |
| `workspace-management.md` | Workspace Management | Workspaces |
**Manage workspaces** *(vs generated `api/workspaces.md`)* |

These titles are the only non-mechanical editorial calls in this PR.

## Deliberately excluded: generated pages

`admin/security/audit-logs.md` and
`admin/setup/configuration-reference.md` are `make gen` outputs
(`auditdocgen` / `configdocgen`) that Phase 2 did **not** update, so a
hand-added title would be reverted on the next generation. They're
excluded here and need their generators taught to emit front matter
first (Phase 2 pattern), tracked as `DOCS-631`. Batch A (#28030) had the
same issue for three other generated pages; it has been corrected there
too.

## Verification

AI was the primary author of this PR (see disclosure below); per the [AI
Contribution
Guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING)
here is the manual verification.

- Promote = set front-matter `title` to the body H1 (or the
disambiguated title above) and remove that one duplicate H1. No other
body prose is reflowed.
- Every added front-matter block parses as YAML; all files pass `pnpm
check-docs` (markdownlint-cli2 + table formatter): `Summary: 0
error(s)`.
- Removing the H1 orphaned one in-page fragment (`[MCP](#mcp)` in
`ai-gateway/mcp.md`), now repointed. A cross-file fragment audit into
the retitled pages found no real breakage.


Anchor-change note

Unlike Batch A (title unchanged, a rendered no-op), Batch B changes each
page's effective title from the manifest label to the body H1, so the
rendered H1 **anchor slug changes**. An audit of cross-file
`.md#fragment` links into these pages surfaced no links that break as a
result (the only hits were false positives against a still-present `##
TLS & Reverse Proxy` heading). Same-file fragments are enforced by
markdownlint MD051, which is green.

## Title casing (follow-up, DOCS-742)

A follow-up commit puts the promoted titles into sentence case and
removes leading gerunds (for example, `Managing workspace schedules` →
`Manage workspace schedules`): 57 of the 120 titles changed, the other
63 were already compliant. Proper nouns and branded names (Coder
Validated Architecture, JetBrains, File Browser, Dev Containers,
Island), acronyms (API, CLI, IDE, MCP, OIDC, URL, UI, CI/CD), the
Premium license tier, and maturity labels (Beta, Experimental) are
preserved. The four `Nk-users` pages become `Reference architecture: up
to N users` (lowercase, matching the CVA landing page's own usage); the
CVA landing page keeps its branded title. `pnpm check-docs`: `Summary: 0
error(s)`.

Linear: DOCS-484, DOCS-742

> This PR was created with AI assistance (Coder Agents).
2026-09-08 16:34:00 +00:00
Steven Masley 36ea6eaf80 fix(coderd): do not narrow the parameter set on non-start builds (#29102)
Fixes part of #29099
([ENG-3324](https://linear.app/codercom/issue/ENG-3324)).

## What this does

Only a start build may narrow the stored set. A stop or delete build
does not change which parameters a workspace has.

## Why

A stop or delete build re-resolves the workspace parameters and deletes
every stored value the render did not return.

- When a template version's `cached_module_files` is NULL the renderer
cannot load modules, and the parameters are dropped. Any `restart` or
`coder update`, uses the broken version for `stop` and all parameters
are removed before the fixed `start`.
  - This can happen on any broken template version

## Scope

This does not fix a start build that resolves against a version with a
NULL module cache, which still truncates. That is the completeness-aware
discard loop described in the issue, and it lands separately.

## Tests

- `TestResolveParameters/UnmatchedValues` covers all three transitions
at the resolver level.
- `TestDynamicParametersModuleCachePurged` is an end-to-end regression
test: create a workspace with a module declared parameter, remove the
module cache, stop, and assert the value survives. It fails on `main`.

<details>
<summary>Implementation plan</summary>

### Problem

`dynamicparameters.ResolveParameters` ends with an unconditional discard
loop (`coderd/dynamicparameters/resolver.go`) that deletes every stored
value whose parameter is absent from the render output. With a NULL
module cache the render is incomplete, `preview` reports
`module_not_loaded` at warning severity, and the reduced parameter set
is treated as authoritative.

`wsbuilder.getParameters()` is transition-agnostic, so a stop build
persists that truncated set. `cli/update.go` stops first against the
workspace's current version, then starts against the active version, and
the start build reads the truncated set via `getLastBuildParameters()`.

### Coverage

| Case | Fixed here |
|---|---|
| `coder update`, old version purged, active version healthy | yes |
| Workspace sits on a purged version, autostop then autostart | no,
needs the discard loop fix |
| `require_active_version` where the active version is purged | no,
needs the discard loop fix |

### Changes

1. `resolver.go`: gate the discard loop on the build transition.
Ephemeral trimming, immutability, monotonicity, and default backfill are
unchanged.
2. `wsbuilder.go`: pass `b.trans`. Single non-test caller.

### Deliberate calls

- `delete` is treated like `stop`. Neither transition changes which
parameters a workspace has, and it keeps the condition to one
comparison.
- The transition is passed rather than a second boolean flag, so the
call site stays unambiguous next to `firstBuild`.

</details>

---

🤖 Authored by Coder Agents on behalf of @Emyrk.
2026-09-08 11:01:59 -05:00
Jake Howell 019910bf49 refactor(site/src/pages/AgentsPage): read parent chat from ChatTopBar (#29074)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

ChatTopBar now loads the parent chat itself instead of taking
`parentChat` from AgentChatPage and the view. The page no longer queries
`chatById` for the parent.

- Drop `parentChat` from AgentChatPage and AgentChatPageView
- Let ChatTopBar read `chatById` when the chat has a parent ID
- Seed the parent entity in Storybook and assert the breadcrumb link
2026-09-09 01:00:45 +10:00
Cian JohnstonandSas Swart e9946e81c5 feat: Add search to AI Gateway SessionTimeline (#28424)
This pull request:
- Wires debounced search into AI Gateway session details
- Filters prompts, tool calls, inputs, and network destinations
- Highlights matches and expands relevant content
- Reports matching events and loaded-data limitations

Stack details:
- #28422
- #28424 (this PR)

> Generated by Coder Agents on behalf of @johnstcn

---------

Co-authored-by: Sas Swart <sas.swart.cdk@gmail.com>
2026-09-08 16:38:29 +02:00
Jake Howell 5bc6553fc7 refactor(site/src/pages/AgentsPage): derive workspace skills in ChatPageInput (#29071)
ChatPageInput now derives workspace skills from chat instead of taking a
sliced list from AgentChatPage and the view. The page still computes
that list for slash-command send.

Depends on #29070

- Drop workspaceSkills from AgentChatPage and AgentChatPageView
- ChatPageInput calls workspaceSkillsFromChat(chat)
2026-09-09 00:38:18 +10:00
Jake Howell 486d2faa81 refactor: modernize the create user page (#28894)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

Redesigns the create user flow using the settings page layout and
renames it to "New user." The form includes clearer field guidance,
explicit authentication-method loading, error, and empty states, updated
documentation, and aligned end-to-end selectors.

| Old | New |
| --- | --- |
| <img width="2560" height="2516" alt="02-create-user"
src="https://github.com/user-attachments/assets/c79fb42b-3b0f-47fa-b03d-801c81584dba"/>
| <img width="2560" height="2748" alt="02-create-user-page"
src="https://github.com/user-attachments/assets/2d2dd777-3ae9-444d-9811-082f30eb8387"/>
|

Depends on #28893.

<details>
<summary>Stack</summary>

1. #28893 - Edit user page redesign
2. #28894 - Create user page redesign (this PR)

</details>
2026-09-09 00:35:42 +10:00
Jake Howell 3b1828db5b refactor: modernize the edit user page (#28893)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

Redesigns the edit user page using the settings page layout, with
clearer field guidance, explicit loading and error states, documentation
and back links, and access to the shared user administration menu.

Successful updates refresh the page heading and query cache without
resetting an in-progress form during background refetches.

| Old | New |
| --- | --- |
| <img width="2560" height="1800" alt="03-edit-user-member"
src="https://github.com/user-attachments/assets/915434fe-9587-49e9-b962-cc1ebeca3ea4"
/> | <img width="2560" height="1800" alt="02-edit-user-page"
src="https://github.com/user-attachments/assets/2b188c26-4268-4498-96a0-4fd1825a6a49"
/> |
| `** didnt exist **` | <img width="2560" height="1800"
alt="03-edit-user-page-action-menu"
src="https://github.com/user-attachments/assets/1e657626-ab43-4d49-a375-414896728fb9"
/> |

<details>
<summary>Stack</summary>

1. #28893 - Edit user page redesign (this PR)
2. #28894 - Create user page redesign

</details>
2026-09-09 00:21:16 +10:00
Hugo Dutka 19b72a7bed fix(codersdk/toolsdk): remove background test startup timing assumptions (#29043)
The background bash tests assumed their initial output would arrive
within a two-second deadline. Separate completed-command output capture
from timeout behavior, and gate background completion until after the
handler returns. Each run now uses its own temporary FIFO and completion
marker instead of a fixed sleep and shared file.

Fixes https://linear.app/codercom/issue/CODAGT-1004

<details>
<summary>Investigation and validation evidence</summary>

Injecting a three-second delay into external command execution
reproduced both original failures with exit code 124 and no initial
output. This demonstrates the unsafe startup-timing assumption; it does
not establish the precise source of the CI runner's delay or implicate
the output-drain window.

The updated tests passed three repetitions with the same injected delay,
five race-enabled repetitions, the full `toolsdk` package, and package
lint checks (zero issues).

The continuation test releases its FIFO only after the timeout result
and verifies the unique completion marker afterward. Output capture is
covered separately for stdout and stderr.

</details>

Generated by Coder Agents on behalf of @hugodutka.
2026-09-08 16:15:05 +02:00
Jake Howell 3d882335e4 fix(site): wrap workspace sharing loading states in a table (#29027)
When workspace sharing settings are still loading (or fail / are
disabled), WorkspaceSharingForm rendered a bare TableBody. That left the
spinner in a tiny left-aligned box.

Wrap those early returns in a Table so the loader, error, and disabled
states span the full width. Also add stories for those states.

| Old | New |
| --- | --- |
| <img width="2902" height="854" alt="animation-old"
src="https://github.com/user-attachments/assets/a0a84394-5aa4-4a75-a1ff-e6434ef4ac13"
/> | <img width="2902" height="854" alt="animation-fixed"
src="https://github.com/user-attachments/assets/17ed7374-147a-4b71-ad98-cef1b26d9d32"
/> |
2026-09-09 00:12:24 +10:00
dependabot[bot] e346d58da3 chore: bump github.com/aws/aws-sdk-go-v2/service/sts from 1.47.1 to 1.49.0 (#29091)
Bumps
[github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2)
from 1.47.1 to 1.49.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/4fd9126607b61a0fe22af3a6a31b4e4792a66d83"><code>4fd9126</code></a>
Release 2024-02-13</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/d22cecd4af5dc762e59c2bd156e3a774cbc1f2db"><code>d22cecd</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/b640bf508c997be09b65a3b0d7f2be07ee1e7ac6"><code>b640bf5</code></a>
Update SDK's smithy-go dependency to v1.20.0</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/94e885c36103117b48764e0e94d88da729b84047"><code>94e885c</code></a>
Update endpoints model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/b3a6cd78eabbe87d11278117682674044d1e4408"><code>b3a6cd7</code></a>
Update API model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/5f328e6ca9ec4effe5f82d79c2076c59788c05b8"><code>5f328e6</code></a>
chore: bump min go to 1.20 (<a
href="https://redirect.github.com/aws/aws-sdk-go-v2/issues/2494">#2494</a>)</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/3cb2c978aed75796d8db56dab5f496329af8b182"><code>3cb2c97</code></a>
ci: fix CI scripts for main branch case (<a
href="https://redirect.github.com/aws/aws-sdk-go-v2/issues/2491">#2491</a>)</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/0e44db4cf355dbb0324cba2ee49cafed1454ba26"><code>0e44db4</code></a>
Release 2024-02-12</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/1d8fb3bda76e7fa0373768c10f90aa2aa5281e4a"><code>1d8fb3b</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/e4d556f1d9af36afc7d5109010e3330975877f13"><code>e4d556f</code></a>
Update API model</li>
<li>Additional commits viewable in <a
href="https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.47.1...service/s3/v1.49.0">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 14:07:46 +00:00
Garrett Delfosse c12355d6e5 fix(coderd/x/chatd): carry unanswered user messages through compaction verbatim (#28645)
Fixes
[CODAGT-737](https://linear.app/codercom/issue/CODAGT-737/compaction-can-treat-the-last-user-message-as-an-assistant-message)

## Problem

Auto-compaction can trigger on a turn whose last history message is a
fresh, unanswered **user** message. Two things go wrong:

1. The summary instruction is appended as another user message.
Providers that merge consecutive same-role messages (verified against
fantasy's Anthropic conversion) fuse it with the user's message, and the
summarizer misattributes the user's instruction as assistant intent.
2. After compaction the original user row falls outside the prompt
window, so the instruction survives only through summary fidelity.

## Fix

Carry unanswered trailing user messages through compaction verbatim
instead of summarizing them. All logic lives in `chatd`; `chatloop` is
unchanged apart from prompt wording.

- **Prepare** (`generation_preparer.go`): `pendingUserSegmentStart`
locates the trailing user rows on the persisted rows, before
provider-switch sanitization (which can drop the assistant row
separating them from an already-answered message). Head and tail are
converted separately so the summarizer input excludes the tail exactly.
Falls back to summarizing everything when no usable segment exists.
- **Commit** (`buildCompactionMessages`): replays the tail after the
boundary trio as uncompressed, model-only user rows. The existing prompt
window query includes them; no SQL, UI, or turn-guard changes. Replay
rows carry no usage, so compaction cannot immediately re-fire.
- **Prompt** (`chatloop/compaction.go`): the summary prefix no longer
claims the assistant "was actively working", which is false in this
case. The summarizer prompt is unchanged.
- `ARCHITECTURE.md` compaction section updated.

## Testing

`go test ./coderd/x/chatd/...` green. New:
`TestBuildCompactionMessages_ReplaysPendingUserMessages`,
`TestPendingUserSegmentStart`,
`TestPendingUserSegmentConversionEquivalence`,
`TestPendingUserSegmentDerivedBeforeProviderSwitchSanitization`,
`TestDecisionGeneratesAfterCompactionWithReplayedPendingUser`.

<details>
<summary>Root-cause repro</summary>

Replaying the reported scenario through fantasy's Anthropic provider
against a capture server:

```
=== fantasy prompt (roles as chatd builds them) ===
[2] role=user      "You'll hit compaction now, we'll need to go through some fin..."
[3] role=user      "You are performing a context compaction. Summarize the conve..."

=== wire request to Anthropic ===
[2] role=user, 2 content block(s)
    block[0]: "You'll hit compaction now, we'll need to go through some final checks..."
    block[1]: "You are performing a context compaction. Summarize the conversation so..."
```

</details>

---

🤖 This PR was generated by Coder Agents on behalf of @f0ssel.
2026-09-08 09:31:42 -04:00
dependabot[bot] cbcfe85a5e chore: bump github.com/aws/aws-sdk-go-v2/service/bedrock from 1.70.0 to 1.71.0 (#29097)
Bumps
[github.com/aws/aws-sdk-go-v2/service/bedrock](https://github.com/aws/aws-sdk-go-v2)
from 1.70.0 to 1.71.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/9a211f9a8eb9923a47740503892928d702a2ac63"><code>9a211f9</code></a>
Release 2024-12-03.2</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/c357d6ce9cf35ab9fc343d1d8ea1147885a1276b"><code>c357d6c</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/e6160c9846d4f72e5d09a2c6160b1cd1770b5bad"><code>e6160c9</code></a>
Update API model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/cfd99f86832af2f033fcd34148bef6f32ab36211"><code>cfd99f8</code></a>
Merge customizations for DSQL</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/3418b7488a6dda849fa2b314aad7d8a24af435e0"><code>3418b74</code></a>
Release 2024-12-03</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/bc3406170ac25a0cdb61aaa1b7c25415fdee17d3"><code>bc34061</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/4eb6ed801453f7b5f45423d59f39b27409dd517b"><code>4eb6ed8</code></a>
Update endpoints model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/b9b73ec7647e6ea6e5862d906f616e8c2d2b3e4b"><code>b9b73ec</code></a>
Update API model</li>
<li>See full diff in <a
href="https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.70.0...service/s3/v1.71.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go-v2/service/bedrock&package-manager=go_modules&previous-version=1.70.0&new-version=1.71.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 13:29:37 +00:00
Jeremy Ruppel 40a907f7d5 test(site/src/components/FormField): convert IgnorePasswordManagers story to Vitest (#29002)
## Summary

Converts the `IgnorePasswordManagers` Storybook story in `FormField` to
a Vitest/RTL test.

The story only asserted DOM attributes (`autocomplete`,
`data-1p-ignore`, `data-lpignore`, `data-form-type`, `data-bwignore`)
with no visual or interactive value, so it is a better fit for a unit
test than a Pixel-captured story. This follows up on the review
discussion in [#28998](https://github.com/coder/coder/pull/28998)
([comment](https://github.com/coder/coder/pull/28998/files#r3937699707)).

- Adds `FormField.test.tsx`: asserts the ignore attributes are applied
when `ignorePasswordManagers` is set, and absent by default.
- Removes the `IgnorePasswordManagers` story and the now-unused
`ignorePasswordManagers` plumbing from the story wrapper.

## Testing

- `pnpm test src/components/FormField/FormField.test.tsx` (2 passed)
- `pnpm test:storybook src/components/FormField/FormField.stories.tsx`
(7 passed)
- `pnpm check`, `pnpm lint:types`, `pnpm format`

---
Generated by Coder Agents on behalf of @jeremyruppel.
2026-09-08 09:16:02 -04:00
dependabot[bot] ad192b6f44 chore: bump github.com/aws/aws-sdk-go-v2 from 1.45.1 to 1.46.0 (#29094)
Bumps
[github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2)
from 1.45.1 to 1.46.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/afdc89fb3e9277f2c13acbdbe088c8c32aab38f9"><code>afdc89f</code></a>
Release 2026-09-04</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/5875f616ef3e5d21b12f350b7a09446a762d56ca"><code>5875f61</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/9d20eaa373e771ad3dbe18648ebbeb2d086c9727"><code>9d20eaa</code></a>
Update API model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/08c63d9df4a4327e0c8f79346e42acd04eece2c2"><code>08c63d9</code></a>
Remove span retry loop middleware (<a
href="https://redirect.github.com/aws/aws-sdk-go-v2/issues/3543">#3543</a>)</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/99b223d878489f2dd1dba6df1c0ca3c1d9a36053"><code>99b223d</code></a>
Release 2026-09-03</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/2d2fdf61732b629307eb59a038f10b720748f725"><code>2d2fdf6</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/093c165c00746d3a1626dd638fa65eb77431da17"><code>093c165</code></a>
Update API model</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/5b4cd6fcf3b8b47b4054ef2f967bf95bc5cbfbef"><code>5b4cd6f</code></a>
Release 2026-09-02</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/9e0203971e91ff11453805bd88ebd26d96d3adc3"><code>9e02039</code></a>
Regenerated Clients</li>
<li><a
href="https://github.com/aws/aws-sdk-go-v2/commit/b785dd9bcf5ee61445c0a058681929fc38fdcbaa"><code>b785dd9</code></a>
Update API model</li>
<li>Additional commits viewable in <a
href="https://github.com/aws/aws-sdk-go-v2/compare/v1.45.1...v1.46.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go-v2&package-manager=go_modules&previous-version=1.45.1&new-version=1.46.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 13:14:58 +00:00
Jake Howell 69f40fc22b refactor: read compaction threshold from ChatPageInput (#29070)
ChatPageInput now loads compaction thresholds itself instead of taking
compressionThreshold from AgentChatPage and the view. It resolves
chat.last_model_config_id against the shared chatModels cache and
userCompactionThresholds, the same query settings already uses.

Depends on #29069

- Drop compressionThreshold from AgentChatPage and AgentChatPageView
- ChatPageInput reads userCompactionThresholds through
resolveCompactionThreshold
- CompactsAtUserOverride opens the context ring and asserts the user
override wins over the model default
2026-09-08 22:28:45 +10:00
dependabot[bot] f2da41a143 chore: bump github.com/coreos/go-oidc/v3 from 3.20.0 to 3.21.0 (#29093)
Bumps [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc)
from 3.20.0 to 3.21.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/coreos/go-oidc/releases">github.com/coreos/go-oidc/v3's
releases</a>.</em></p>
<blockquote>
<h2>v3.21.0</h2>
<h2>What's Changed</h2>
<ul>
<li>oidc: ignore JWKs with unsupported key types rather than failing by
<a href="https://github.com/nicoske"><code>@​nicoske</code></a> in <a
href="https://redirect.github.com/coreos/go-oidc/pull/499">coreos/go-oidc#499</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/nicoske"><code>@​nicoske</code></a> made
their first contribution in <a
href="https://redirect.github.com/coreos/go-oidc/pull/499">coreos/go-oidc#499</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/coreos/go-oidc/compare/v3.20.0...v3.21.0">https://github.com/coreos/go-oidc/compare/v3.20.0...v3.21.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/coreos/go-oidc/commit/c914bd380327a5a3a81403774d1a5d5b73772ce7"><code>c914bd3</code></a>
oidc: ignore JWKs with unsupported key types rather than failing</li>
<li>See full diff in <a
href="https://github.com/coreos/go-oidc/compare/v3.20.0...v3.21.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/coreos/go-oidc/v3&package-manager=go_modules&previous-version=3.20.0&new-version=3.21.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 11:55:19 +00:00
Jake Howell 8e0fcdf6d4 refactor: read send shortcut from AgentChatInput (#29069)
AgentChatInput now loads the send shortcut preference itself instead of
taking it from AgentChatPage, AgentCreatePage, the view,
ChatPageContent, and AgentCreateForm. Loading still uses modifier_enter
so Enter cannot send a draft before the stored preference lands.

Depends on #29067

- Drop sendShortcut from AgentChatPage, AgentCreatePage,
AgentChatPageView, ChatPageContent, and AgentCreateForm
- AgentChatInput reads preferenceSettings through
getAgentChatSendShortcut
- Stories seed MockUserPreferenceSettings on the preference query
2026-09-08 21:32:35 +10:00
dependabot[bot] 73d3ade172 chore: bump github.com/klauspost/compress from 1.19.1 to 1.20.0 (#29095)
Bumps
[github.com/klauspost/compress](https://github.com/klauspost/compress)
from 1.19.1 to 1.20.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/klauspost/compress/releases">github.com/klauspost/compress's
releases</a>.</em></p>
<blockquote>
<h2>v1.20.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add lzw reader/writer by <a
href="https://github.com/klauspost"><code>@​klauspost</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1189">klauspost/compress#1189</a></li>
<li>xpress: add Microsoft XPRESS (MS-XCA) decompression by <a
href="https://github.com/MP-GOWTHAM"><code>@​MP-GOWTHAM</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1195">klauspost/compress#1195</a></li>
<li>s2: arm64 assembly encoders, lowered from the amd64 avo program by
<a href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in
<a
href="https://redirect.github.com/klauspost/compress/pull/1187">klauspost/compress#1187</a></li>
<li>zstd, huff0: improved arm64 lowering, and narrow two table loads to
MOVWQZX by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1175">klauspost/compress#1175</a></li>
<li>gzhttp: limit jitter hash to jitterBuffer bytes by <a
href="https://github.com/VedantMadane"><code>@​VedantMadane</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1192">klauspost/compress#1192</a></li>
<li>s2: clamp the Go EncodeBetter skip to match the assembly by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1190">klauspost/compress#1190</a></li>
<li>xxhash: bound input of non-preemptive assembly by <a
href="https://github.com/AskAlexSharov"><code>@​AskAlexSharov</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1196">klauspost/compress#1196</a></li>
<li>zstd/huff0: fold two ISA-gap x86 idioms in the avo arm64 lowering by
<a href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in
<a
href="https://redirect.github.com/klauspost/compress/pull/1199">klauspost/compress#1199</a></li>
<li>ci: test against go1.27.x, drop go1.24.x by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1198">klauspost/compress#1198</a></li>
<li>zstd/huff0: break false partial-register dependencies in seqdec/4X
decoders by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1197">klauspost/compress#1197</a></li>
<li>flate: Writer L7-9 with dictionary can emit the dictionary to stream
by <a href="https://github.com/klauspost"><code>@​klauspost</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1201">klauspost/compress#1201</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/VedantMadane"><code>@​VedantMadane</code></a>
made their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1192">klauspost/compress#1192</a></li>
<li><a
href="https://github.com/AskAlexSharov"><code>@​AskAlexSharov</code></a>
made their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1196">klauspost/compress#1196</a></li>
<li><a
href="https://github.com/MP-GOWTHAM"><code>@​MP-GOWTHAM</code></a> made
their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1195">klauspost/compress#1195</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/klauspost/compress/compare/v1.19.2...v1.20.0">https://github.com/klauspost/compress/compare/v1.19.2...v1.20.0</a></p>
<h2>v1.19.2</h2>
<h2>What's Changed</h2>
<ul>
<li>huff0: add arm64 assembly for Decompress4X/1X via avo lowering by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1172">klauspost/compress#1172</a></li>
<li>zstd: Re-enable unsafe decodeSync memory copies (<a
href="https://redirect.github.com/klauspost/compress/issues/1168">#1168</a>)
by <a href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1171">klauspost/compress#1171</a></li>
<li>zstd: fix arm64 asm frame offsets placing locals on the saved LR
slot by <a
href="https://github.com/lizthegrey"><code>@​lizthegrey</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1176">klauspost/compress#1176</a></li>
<li>zstd: avoid racing MaxDecodedSize write on shared dict litEnc by <a
href="https://github.com/zanarellidev"><code>@​zanarellidev</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1182">klauspost/compress#1182</a></li>
<li>zstd: keep BuildDict recent-offsets positive and loadable by <a
href="https://github.com/zanarellidev"><code>@​zanarellidev</code></a>
in <a
href="https://redirect.github.com/klauspost/compress/pull/1184">klauspost/compress#1184</a></li>
<li>zstd: handle zero-literal BuildDict corpus by <a
href="https://github.com/cyphercodes"><code>@​cyphercodes</code></a> in
<a
href="https://redirect.github.com/klauspost/compress/pull/1178">klauspost/compress#1178</a></li>
<li>zstd: don't clear the registered dictionary when decoding past the
window by <a
href="https://github.com/sueun-dev"><code>@​sueun-dev</code></a> in <a
href="https://redirect.github.com/klauspost/compress/pull/1177">klauspost/compress#1177</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/zanarellidev"><code>@​zanarellidev</code></a>
made their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1183">klauspost/compress#1183</a></li>
<li><a
href="https://github.com/cyphercodes"><code>@​cyphercodes</code></a>
made their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1178">klauspost/compress#1178</a></li>
<li><a href="https://github.com/sueun-dev"><code>@​sueun-dev</code></a>
made their first contribution in <a
href="https://redirect.github.com/klauspost/compress/pull/1177">klauspost/compress#1177</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/klauspost/compress/compare/v1.19.1...v1.19.2">https://github.com/klauspost/compress/compare/v1.19.1...v1.19.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/klauspost/compress/commit/9d8ccb1d9567304420eb55a88b6f63a2067a8da4"><code>9d8ccb1</code></a>
flate: Writer with a preset dictionary emits the dictionary into the
output s...</li>
<li><a
href="https://github.com/klauspost/compress/commit/f93f23a4bd5434ab55872aff9717f769398fa59e"><code>f93f23a</code></a>
build(deps): bump the github-actions group with 6 updates (<a
href="https://redirect.github.com/klauspost/compress/issues/1200">#1200</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/42f9d969024a20735148e3577d4b602ed4d0590a"><code>42f9d96</code></a>
xpress: add Microsoft XPRESS (MS-XCA) decompression (<a
href="https://redirect.github.com/klauspost/compress/issues/1195">#1195</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/629c2ea148ae6ddbd3b70bc1e35076aaf94b7143"><code>629c2ea</code></a>
zstd/huff0: break false partial-register dependencies in seqdec/4X
decoders (...</li>
<li><a
href="https://github.com/klauspost/compress/commit/ba74977eb2c7002604765bf9c7f3c8a497224d60"><code>ba74977</code></a>
ci: test against go1.27.x, drop go1.24.x (<a
href="https://redirect.github.com/klauspost/compress/issues/1198">#1198</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/f5c1529bc7838087176f39eb85e2495f5292606d"><code>f5c1529</code></a>
zstd/huff0: pin avo peephole folds, regenerate arm64 (<a
href="https://redirect.github.com/klauspost/compress/issues/1199">#1199</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/73508b25f222ed50fad2ff7540c059f893781c30"><code>73508b2</code></a>
s2: arm64 assembly encoders, lowered from the amd64 avo program (<a
href="https://redirect.github.com/klauspost/compress/issues/1187">#1187</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/0e43f04adae8400cdaf545242467c9910ce9a513"><code>0e43f04</code></a>
xxhash: bound input of non-preemptive assembly (<a
href="https://redirect.github.com/klauspost/compress/issues/1196">#1196</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/4005c155a2670b665ddc52205b6e9dacb43cf651"><code>4005c15</code></a>
s2: clamp the Go EncodeBetter skip to match the assembly (<a
href="https://redirect.github.com/klauspost/compress/issues/1190">#1190</a>)</li>
<li><a
href="https://github.com/klauspost/compress/commit/dd6de45e8beb8833684fbafb4ecd06b0062dafa6"><code>dd6de45</code></a>
gzhttp: limit jitter hash to jitterBuffer bytes (<a
href="https://redirect.github.com/klauspost/compress/issues/1192">#1192</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/klauspost/compress/compare/v1.19.1...v1.20.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/klauspost/compress&package-manager=go_modules&previous-version=1.19.1&new-version=1.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 11:25:13 +00:00
Jake Howell 0cda3f085f fix(site): polish the workspace filter combobox (#29080)
A pile of visual nits from design review on the unified workspace
filter. Nothing functional, just making the thing look like the Figma
mock.

- dropdown rows stay content-secondary until hover/highlight, then icon
and label go primary together
- only the suggestion list scrolls, so we don't get two scrollbars
- search and filter icons stick to the first chip row when tokens wrap
- chip area padding is 8px top/right/bottom, 4px between tokens
- bigger dismiss X on chips (why is this a prop?????)
- Template icon uses `LayoutPanelTopIcon`, Attributes icon uses
`TagsIcon`

| Old | New |
| --- | --- |
| <img width="533" height="104" alt="COMBOBOX_INPUT_OLD"
src="https://github.com/user-attachments/assets/ef0ce112-fa42-4242-aafb-2b1a86895cc2"
/> | <img width="533" height="115" alt="COMBOBOX_INPUT_NEW"
src="https://github.com/user-attachments/assets/0797b172-258f-4276-bc23-2ae870ce704a"
/> |
| <img width="535" height="349" alt="COMBOBOX_DROPDOWN_OLD"
src="https://github.com/user-attachments/assets/db5cc856-7005-4433-a2e0-03746a09b58d"
/> | <img width="537" height="361" alt="COMBOBOX_DROPDOWN_NEW"
src="https://github.com/user-attachments/assets/f5f24a56-52b0-4a4c-89f5-9328ffe4d57b"
/> |
2026-09-08 10:14:27 +00:00
Jake Howell ab5c0595c8 refactor(site/src/pages/AgentsPage): treat route agentId as required (#29067)
AgentChatPage now treats the :agentId route param as required, matching
WorkspacePage, instead of coercing a missing id to "". Queries and
mutations take that string directly.

Depends on #29065

- KeyedAgentChatPage renders not-found when the param is missing
- Drop agentId ?? "" and enabled: Boolean(agentId) from chat queries
- Drop !agentId guards from send, interrupt, workspace, and plan-mode
handlers
2026-09-08 19:23:28 +10:00
Marcin Tojek ab1959d661 chore(docs): update release docs for v2.37.1 (#29076)
Automated docs update for v2.37.1 release.

Created by `releasetui`.
2026-09-08 11:08:50 +02:00
Danny Kopping 69f5ac17c4 fix(.github/workflows): use canonical dogfood deployment URL (#29075)
Use `https://dogfood.cdr.dev` directly when deploying dogfood templates.
The legacy hostname returns a 301 redirect, converting upload POST
requests into GET requests that fail with HTTP 405.

Refs
https://github.com/coder/coder/actions/runs/34145739247/job/101967393279

<details>
<summary>Diagnosis evidence</summary>

The job failed uploading all three template archives after Terraform
validation and authenticated reads succeeded. An unauthenticated empty
POST to the legacy upload URL confirmed the 301 redirect to the
canonical hostname. This change avoids that redirect without changing
the provider or template configuration.

</details>

Generated by Coder Agents on behalf of @dannykopping.
2026-09-08 10:05:08 +01:00
Mathias Fredriksson 6a3dae7571 chore(Makefile): drop test-storybook from pre-push (#29078)
Remove the test-storybook target (and its cache warmup step) from the
pre-push aggregate because it repeatedly stalls or fails.
2026-09-08 12:04:16 +03:00
Jake Howell 029b0eee95 refactor(site/src/pages/AgentsPage): read archive pin rename from layout outlet (#29065)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

ChatTopBar now calls the layout outlet archive, pin, and rename actions
instead of taking page wrappers drilled through the view. Loading,
error, and not-found omit chat, so they no longer need dummy handlers.

Depends on #29064

- Drop archive, pin, and rename handlers from AgentChatPage and
AgentChatPageView
- Gate archive actions using the per-chat live status and outlet
activeChatChildren
- Exercise every moved outlet action through Storybook interactions
2026-09-08 18:56:32 +10:00
Jake Howell 80bb56034d refactor(site/src/pages/AgentsPage): pass Chat instead of sliced chat flags (#29064)
Pass the chat record into ChatTopBar, ChatPageInput, and
ChatActionsMenuItems instead of deriving title, pin, archive, child,
share, diff, plan mode, workspace, context, and ids at each parent.
Handlers stay props. Loading, error, not-found, and the create composer
still omit chat because they have no record yet.

- ChatTopBar reads title, share, pin, archive, parent, and diff from
chat
- ChatPageInput reads org, id, plan mode, workspace, and context from
chat
- ChatActionsMenuItems reads archive/pin/child from chat, so the sidebar
tree drops isChildNode
2026-09-08 17:02:04 +10:00
Jake Howell 257c6f1dca refactor: move shared AI model UI into modules/aiModels (#29040)
> 🤖 Refactoring with Cursor.

AI settings was importing model form fields, ModelSelector, and
ProviderIcon from AgentsPage. Those now live in
`site/src/modules/aiModels`.

No user-facing behavior change.

- Move ProviderIcon, ModelSelector, and the model admin form fields into
`modules/aiModels`
- Point AgentsPage and AI settings at the new paths
- Drop the leftover ChatModelAdminPanel ProviderIcon duplicate and the
knownModels barrel
- Update the known-models catalog generator paths
2026-09-08 14:34:51 +10:00
Yevhenii Shcherbina 93089d447f fix: resolve Bedrock application inference profile ARNs (#28877)
AWS recommends [application inference
profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-application-inference-profiles.html)
for attributing Bedrock spend to a team or workload, which requires
invoking Bedrock with the profile ARN as the `modelId`. AI Gateway used
the configured Bedrock model for both the invocation target and model
capability detection, and capability detection is substring matching
against model IDs. Application inference profile ARNs are opaque, so
they matched nothing.

Reproduced against a profile wrapping `anthropic.claude-opus-4-8`: the
client sent `thinking.type: "adaptive"`, the gateway rewrote it to
`enabled` + `budget_tokens` because the ARN did not look like an
adaptive-capable model, and Bedrock returned

```text
400 "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
```

Models that accept both shapes, such as Sonnet 4.6, did not fail but had
adaptive thinking silently downgraded. The ARN was also recorded as the
interception model, so those requests never matched a price and may
appear in the weekly Missing AI Model Prices report.

The gateway now resolves application inference profile ARNs through
`GetInferenceProfile` and uses the model behind them for capability
detection, usage records, pricing, and metrics, while still invoking the
profile so AWS records the cost attribution. Resolution runs only for
`application-inference-profile` ARNs, so plain model IDs and
system-defined inference profile ARNs, which already carry the model ID,
cost no AWS call and need no new permission. Deployments that do
configure a profile must grant `bedrock:GetInferenceProfile` to the
identity the gateway already uses, including any assumed role.
Resolution failure fails provider construction, matching how other
misconfigured providers behave: the failure is logged and the provider
is reported as errored rather than serving requests it would shape
incorrectly.

## Concerns

**Every provider reload re-resolves every application inference
profile.**

Any provider create/update/delete publishes on
`AIProvidersChangedChannel`, and each subscriber responds by rebuilding
its whole snapshot: `Reload` fetches all providers and
`BuildProvidersFromProto` constructs every one of them from scratch
before `ReplaceProviders` swaps the snapshot in.

That rebuild used to be purely local work. This PR makes it hit the
network: a Bedrock provider configured with an AIP ARN now performs a
synchronous `GetInferenceProfile` call during construction,
sequentially, before the snapshot is published. So editing an unrelated
OpenAI provider re-resolves every AIP in the deployment. Consequences:

- Reload latency grows with the number of AIP-configured providers,
bounded by the 30s resolution timeout per provider.
- A transient AWS failure during an unrelated provider edit drops the
Bedrock provider from the new snapshot until the next reload, surfacing
as a 404 for a provider whose configuration never changed.

An ARN-keyed resolution cache would remove this: the Bedrock API has no
`UpdateInferenceProfile`, so a profile's underlying model is fixed at
creation and repointing requires a new ARN, hence a config change and a
reload. A process-lifetime cache is therefore sound with no invalidation
logic. Left out of this PR to keep it scoped.

## Improvement Options

1. Keep it as is.
2. Add a per-process in-memory cache that maps AIP ARNs to models.
3. Add a database-level cache for AIP-to-model resolution.
4. Move AIP resolution to the per-LLM-request path and cache the result
there.

My choice would be either 3 or 4. See the relevant P1s:
- https://github.com/coder/coder/pull/28877#discussion_r3936255218
- https://github.com/coder/coder/pull/28877#discussion_r3936255211

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

Created by Coder Agents on behalf of @evgeniy-scherbina.
2026-09-07 21:01:39 -04:00
Ehab Younes 90c7533204 perf: store workspace agent session counts as JSONB (#28126)
Replace fixed session_count_* columns with a sparse session_counts
JSONB object so new session types require no schema changes.

Convert retained and unrolled-up activity, warning on backlogs spanning
more than 24 hours. Update batching, queries, and rollups while preserving
existing API shapes and compatibility with older agents.

Add migration, query, and batcher coverage.
2026-09-07 22:31:42 +02:00
Hugo Dutka fcaa14f456 fix: validate mcp input (#28702)
Addresses
[CODAGT-994](https://linear.app/codercom/issue/CODAGT-994/return-validation-errors-for-invalid-mcp-tool-arguments).

The MCP server currently does not validate tool call arguments against
the MCP JSON schema.

Additionally, when a client passes invalid arguments to a Coder MCP
server tool call, currently the server returns only:

```json
{
  "error": "MCP tool request failed."
}
```

In this PR we start validating arguments and returning an informative
validation error instead:

```json
{
  "error": "invalid arguments: ...",
  "expectedSchema": { ... }
}
```
2026-09-07 19:15:38 +02:00
Michael Suchacz e738062ffc fix(dogfood/coder): derive AI Gateway URLs from deployment access URL (#29015)
The dogfood template hard-coded `dev.coder.com` for both AI provider
base URLs even though the active deployment is now `dogfood.cdr.dev`.
Derive the origin from `data.coder_workspace.me.access_url`, trimming a
trailing slash, while preserving the provider suffixes and session-token
wiring.

Current main registers `/api/v2/ai-gateway` as canonical and
`/api/v2/aibridge` as a legacy alias, so this keeps the canonical paths
documented for Anthropic and OpenAI clients. Only the two URL
assignments change.

**Validated:** repository pre-commit-light hooks, Terraform formatter,
`terraform fmt -check`, `terraform init -backend=false -input=false`,
`terraform validate`, and 12 Terraform-console URL checks covering both
providers, three origins, and optional trailing slashes. The original
main values reproduce the regression; session-token wiring and all other
template content are unchanged.

**Rollout:** publish the updated template through the normal release
process, then update and restart affected workspaces to pick up the
environment. No template deployment, Terraform apply, live
infrastructure, or Mux configuration changes were performed.

> Xum acted on behalf of Michael Suchacz (@ibetitsmike).
2026-09-07 17:00:04 +00:00
Hugo Dutka dc1faecbf8 test: bind more server tests to loopback (#29042)
Follow up to https://github.com/coder/coder/pull/28980. The tests
modified in this PR have the same flake potential as the test fixed in
#28980.

Fixes
https://linear.app/codercom/issue/PLAT-583/flake-testserveryamlwritethenreadconfig
2026-09-07 15:24:33 +02:00
Hugo Dutka 1ecb834300 test(cli): bind GitHub OAuth tests to loopback (#28980)
On macOS, the Coder test server listening on all addresses could share a
port with another test’s loopback listener. Go enables `SO_REUSEADDR` by
default, allowing overlapping addresses such as `[::]:61025` and
`127.0.0.1:61025`. The OAuth test’s SDK connects to `127.0.0.1:61025`,
so its requests could reach the other server and report GitHub
authentication as disabled despite the intended server being correctly
configured.

Bind the GitHub OAuth default-provider tests to `127.0.0.1:0`, matching
the SDK’s address and preventing this overlap. Remove the retries
introduced in #28358 and #28622: they were unnecessary to fix the flake.

To test this fix, I had an agent connect to a live GitHub macOS runner
with [wush](https://github.com/coder/wush), reproduce the flake, and
verify the new changes actually resolve it.

Refs
https://linear.app/codercom/issue/ENG-3285/flake-testserveroauth2githubdefaultprovidernewdeployment

<sub>Generated by Coder Agents on behalf of @hugodutka.</sub>
2026-09-07 13:09:14 +00:00
Jake Howell 60f1582239 chore(site/src/pages/AgentsPage): removal barrel exports (#29038)
Using barrel-exports goes against best practice in this codebase.

```
Do not use barrel files. Imports should be directly from the file that defines the value
```


https://github.com/coder/coder/blob/a89f41dadfb6698e2a38622c954fc2c5ca2ccd58/docs/about/contributing/frontend.md?plain=1#L68-L69


[FRONTEND.md](https://github.com/coder/coder/blob/a89f41dadfb6698e2a38622c954fc2c5ca2ccd58/docs/about/contributing/frontend.md?plain=1#L68-L69)
2026-09-07 21:33:56 +10:00