mirror of
https://github.com/coder/coder.git
synced 2026-12-04 13:48:26 +08:00
970ec0ccd3fca7106b92ca2ccfe7b6eedeeb634a
3351
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f6fe51a852 |
docs: warn that chats sharing a workspace are not isolated (#32754)
Chats attached to the same workspace share its files and don't know about each other. If two chats use the same path, one overwrites the other, so content from a private repository can end up in another repository, including a public one. This adds a short section on the risk and how to avoid it to the Coder Agents architecture page, and links to it from the overview where it mentions choosing a workspace. |
||
|
|
19da85b5d3 |
docs: turn the install landing pages into cards (#32405)
## Summary Rework the install landing pages so a reader can see where to go at a glance, without reading the planning material first. The install landing page is now a hub of ten cards in three groups that point to the high-impact and most searched pages, modeled on the GitLab and Mattermost install pages, and the planning material moves to a new Production deployment process page. Every existing page URL stays the same; the sidebar gains two pages. #31869 (the air-gapped K3s tutorial), which this PR links to, has merged, and this branch is rebased onto `main`. The cards need coder/docs-engine#388 to render as cards; without it, the docs engine, GitHub, and the classic offline docs render the same block as a plain link list, so the two PRs can merge in either order. The docs home page cards moved to #32714. Refs [DOCS-1568](https://linear.app/codercom/issue/DOCS-1568) and [DOCS-1570](https://linear.app/codercom/issue/DOCS-1570). ## Changes - `install/index.md`: a one-sentence intro, a tip that points to the Quickstart and the CLI download, and three groups of cards. - Install the control plane: Installation requirements, Air-gapped K3s quickstart, Install on Kubernetes, and Installation methods. - Run Coder in production: Production deployment process and Upgrade Coder. - Common tasks: Air-gapped deployments, Use an external database, TLS and reverse proxies, and Image pull secrets. - New `install/production-deployment.md` (Production deployment process), the first child of Install: the five phases table with its "When you can skip it" column, Move from evaluation to production, Decisions worth making deliberately, and Who does the work, all moved from the landing page. Move from evaluation to production keeps the setup token sentence from #32324. - New `install/server/requirements.md` (Installation requirements), the first child of Install the control plane: control plane CPU and memory, PostgreSQL, platform versions, network, internet access, and license, each traced to code or the existing platform pages. - `install/server/index.md`: takes the three platform questions, the offline notes, and the first air-gapped workspace build note from the landing page. The platform table gains a "Where the control plane runs" column, with Rancher and OpenShift listed as Kubernetes. - `install/server/kubernetes/index.md`: intro names EKS, AKS, GKE, K3s, and OpenShift, and points offline clusters to the air-gap page and the K3s tutorial. - `install/server/cloud/index.md`: sends existing EKS, AKS, and GKE clusters to the Kubernetes guide, notes that the AWS Marketplace guide creates a new EKS cluster, and fixes the Azure tab, which said GKE instead of AKS. - `install/plan/index.md` and `install/prepare/index.md`: planning reads as a recommendation, not a requirement, and Prepare links to the requirements page. ## Decisions for review 1. **Card syntax.** Each card is one item in a plain link list, `[Title](link): one-sentence description`, inside `<div class="cards">`. The corpus compiles as `.md`, so it can't use JSX; this is the same approach as `<div class="tabs">`, and it degrades to a readable list wherever the plugin isn't present. 2. **The first six cards** come from the Nov 20 review with Ben. Two card titles are shorter than their target page titles: "Air-gapped K3s quickstart" opens "Install Coder on K3s in an air-gapped environment", and "Installation methods" opens "Install the control plane". The 1-hour target from the Nov 4 review still isn't stated, because it needs a timed run. 3. **The Common tasks cards come from search data, not page views.** No page-view source was available (Search Console is on a personal account, and Vercel analytics needs credentials). The four cards are the install pages with the most result impressions in Algolia over the 30 days to Nov 18: image pull secrets, air-gapped deployments, the external database, and the NGINX and Apache reverse proxy pages, which match the frequent `proxy` and `certificate` searches. Semrush also shows "nginx reverse proxy" at 4,400 searches a month. The TLS card opens the TLS & Reverse Proxy section of the control plane setup page, which links Apache, Caddy, and NGINX, instead of one proxy page. Docker is left out because the Installation methods card already covers it. Swap any card if page views tell a different story. 4. **"Choose your path" is gone.** Every row now has a card or the tip, and Move from evaluation to production is a section of the new page. The Architecture link that row carried now lives only on Plan your deployment. 5. **Classic offline docs get no card styling.** They render the plain list until the offline docs move to the docs engine. 6. **Rancher and OpenShift read as Kubernetes options.** This reverses what I proposed in the Nov 4 install review (Rancher with container runtimes, OpenShift with Linux). Both guides install the Helm chart on a cluster, so a reader looking for Kubernetes needs to find them. This PR only changes the table labels; no pages move. ## Previews Both previews are built from this branch at `e1d00f4f10`. A screenshot of the docs engine version of the install page is on coder/docs-engine#388. - **Docs engine:** check out coder/docs-engine#388 (`vigilante/coder-docs-cards`), and in `apps/docs` run `DOCS_VERSION_ID=main DOCS_VERSION_REF=e1d00f4f10 DOCS_VERSION_ROOT=1 DOCS_ROOT=<this checkout>/docs pnpm sync`, then the same variables with `pnpm exec next dev -p <port>`, and open `/install/`. The cards sit in a two-column grid and stack to one column on a phone. - **Classic offline docs:** in `offlinedocs/`, run `pnpm install`, `pnpm copy-images`, and `pnpm exec next dev -p <port>`, and open `/install/`. The cards render as a bulleted link list with descriptions, and the tip renders as an alert. ## Not in this PR - Cards on the docs home page: #32714 ([DOCS-1904](https://linear.app/codercom/issue/DOCS-1904)). - New pages that need a tested run first: create your first template ([DOCS-1783](https://linear.app/codercom/issue/DOCS-1783)), an air-gapped Helm install on EKS or AKS ([DOCS-1798](https://linear.app/codercom/issue/DOCS-1798)), and a small reference architecture ([DOCS-1572](https://linear.app/codercom/issue/DOCS-1572)). - Sidebar moves and renames ([DOCS-1569](https://linear.app/codercom/issue/DOCS-1569)). - Pre-existing issues on `prepare/airgap.md`, which this PR links to: it says the built-in database downloads PostgreSQL from `repo1.maven.org`, but `cli/server.go` uses `repo.maven.apache.org`, and its first sentence says all features are supported offline without the hosted-service exception this PR adds to the requirements page. Known tradeoff: platform versions (Kubernetes 1.19, Helm 3.5, and so on) appear on both the requirements page and each platform page, so a version bump has to update both. ## Testing - `make gen/docs-manifest` and `make fmt/markdown`. - `make lint/emdash lint/docs-html lint/docs-manifest lint/markdown lint/docs-redirects`: all pass. - Vale on the changed pages: 0 errors and 0 warnings on added lines. - Links and anchors on the changed pages resolve, including `admin/setup#tls--reverse-proxy` on the docs engine, and no page in `docs/` links to an anchor this PR removed from the landing page. - The docs engine single-version sync of this branch passes strict. - In headless Chromium, the docs engine renders ten cards on the install page with the expected titles and links, in light and dark at 1440px and in one column at 390px; the classic offline docs render the same links as lists. - doc-check skill in author self-check mode at `eaab2994c4`, with fixes in `e1d00f4f10`: - Fixed: the requirements page and the platform chooser said every feature works without internet access; both now say Coder runs offline, and that features that call a hosted service, such as a hosted AI provider, need it reachable. - Fixed: the phase 5 "When you can skip it" cell now reads "Never", like phase 3. - Rejected: a finding that no setup token exists. #32324 adds it (`cli/setuptoken.go`, the `Setup token:` prompt in `cli/login.go`, and `setup_token` in `SetupPageView.tsx`). - Not applied: renaming the "Air-gapped K3s quickstart" card, which is the name from the Nov 20 review. - An earlier run flagged the Helm chart default resources on the requirements page as wrong, but `helm/libcoder/templates/_coder.yaml` sets 2 CPU cores and 4 GiB as both requests and limits when `coder.resources` is empty, so the sentence stands. <details> <summary>Plan and decision log</summary> **Request.** Add pages where they're needed, and update the existing landing pages so it's obvious where to go to install the control plane right away. Don't rearrange the sidebar or rename pages. **Inputs.** - The install section skeleton IA draft in Notion (Docs proposals), which recommends Kubernetes as the golden path and air-gap first. - Feedback from the Nov 4 install docs review with Stephen Kirby and Ben, the Nick and Ian 1:1 (Nov 4), and the Nick and Ben 1:1 (Nov 5). - The Nick and Ben weekly (Nov 20): the landing page still read as text-heavy and didn't tell a reader where to go. The bar is the GitLab and Mattermost install pages. Agreed: cards at the top, the text moved to an intro page, and air-gapped and production paths visually distinct. **What the feedback changed.** - Kirby's three questions (network-gapped, cloud or on premises, VMs or containers) open the platform chooser, Install the control plane. - Kirby's point was "plan once, deploy once": planning matters, but most of the lost time comes after IT approval. So readers can install first, and Plan and Prepare stay visible as recommendations, with a "When you can skip it" column, on the Production deployment process page. - The review called out the missing path from evaluation to production, which is now a section of the Production deployment process page. - Kirby's golden path is an enterprise past approval installing with Helm on air-gapped EKS or AKS. The K3s tutorial covers single-node evaluation only, so that gap is filed as DOCS-1798 instead of being written here without a tested run. - Nov 20: the landing page became six cards in two groups, following GitLab's install page (requirements, methods, offline, reference architectures, upgrades) and Mattermost's evaluate-to-production journey. The prose moved inward rather than being cut: planning to the new page, platform choice and offline notes to the chooser. - Nov 24: Nick asked for cards for the high-traffic pages on the install landing page. With no page-view data reachable, a third group, Common tasks, follows the install pages with the most Algolia result impressions, and Ben's caution against card sprawl keeps it to four. Cards for the docs home page, built first by mistake, moved to their own PR, #32714. #31869 had merged, so the branch is rebased onto `main` without its commits. **Choices made.** - Requirements traced to code: Helm chart default resources (`helm/libcoder/templates/_coder.yaml`), Kubernetes version (`helm/coder/Chart.yaml` `kubeVersion`), built-in PostgreSQL download (`cli/server.go`), and the Kubernetes starter template's code-server install (`examples/templates/kubernetes/main.tf`). - Cards are a docs-engine remark plugin over a plain link list (DOCS-1795, coder/docs-engine#388), not JSX, so the page reads the same on GitHub and in the classic offline docs. Each card description is one sentence and avoids abbreviations that would need expanding. - The new page is the first child of Install, so the sidebar reads as the process followed by its five phases. - Ian's suggestion to use includes for repeated content (such as the air-gap Dockerfile) is deferred. This PR repeats only short routing sentences. </details> --- _This PR was generated by Coder Agents on behalf of @nickvigilante._ --------- Co-authored-by: Ian Evans <5760366+ianjevans@users.noreply.github.com> |
||
|
|
5f4bb0ddc1 |
docs: add side padding to Agent Relay architecture diagram (#32694)
The labels on the left of the Agent Relay architecture diagram sit right against the frame on [the Agent Relay page](https://coder.com/docs/ai-coder/agent-relay). The image had only 4px of margin on the sides, so the docs frame clipped close to the text. This adds 36px of background on the left and right of `agent-relay-stack.png` to match the top margin. No markdown changes. | Before | After | | --- | --- | |  |  | "After" is the live page with the new image swapped in. --- _Generated by Coder Agents on behalf of @bpmct._ |
||
|
|
59e3889656 |
docs: redirect Customize your template pages to Template Fundamentals course (#31639)
Removes the four Quickstart "Customize your template" pages, their sidebar entries, and their seven screenshots, and redirects the old URLs to the Get started page. Closes DOCS-1476. coder/coder#31133 was closed for this reason. The Get started page's **What's next?** section now has two cards: one for the Template Fundamentals course at `https://coder.com/learn/coder-quickstart`, which replaces the removed pages, and one for the full course catalog at `https://coder.com/learn`. The cards use the `<div class="cards">` syntax from coder/docs-engine#388, and GitHub renders the same source as a plain link list. The image-management guide links to the course too. | Old page | Destination | |---|---| | `/docs/get-started/customize-your-template` | `/docs/get-started` | | `/docs/get-started/customize-your-template/add-a-language` | same | | `/docs/get-started/customize-your-template/install-command-line-tools` | same | | `/docs/get-started/customize-your-template/authenticate-to-github` | same | The rules use the relative format from #30805 (`get-started/customize-your-template...` to `get-started`), which also blocks removed routes without a redirect. The course defers the private-repository (`coder_external_auth`) lesson, so the Get started page keeps a short numbered procedure for it: edit the template, add the data source, publish, authenticate on the create-workspace form, and clone over HTTPS. Generated by Coder Agents on behalf of @nickvigilante. --------- Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> |
||
|
|
267f1d8c9e |
fix: stop lint/docs-redirects depending on the live docs site (#32739)
`lint` has failed on every push to `main` and `release/2.40` since the docs site was republished on the 24th, e.g. https://github.com/coder/coder/actions/runs/45560160492/job/139021802160 coder/docs-engine#273 has the docs site generate one page per REST API endpoint from `coderd/apidoc/swagger.json`, at `reference/api/<section>/<endpoint>`, and list them in `llms.txt`. `lint/docs-redirects` downloads that list, and treats any page on it that isn't in `docs/manifest.json` as a page we removed, so it reported all 389 endpoint pages: ``` docs route "reference/api/agents/authenticate-agent-on-aws-instance" no longer resolves (from the live page list https://coder.com/beta-docs/@main/llms.txt). Add a rule to docs/redirects.json, for example: {"source": "reference/api/agents/authenticate-agent-on-aws-instance", "destination": "/"} ``` Nothing is broken on the site, those pages are live, and I don't think the docs engine is doing anything wrong either. The actual problem is that `make lint` depends on whatever coder.com is serving at the time, so a docs site release can turn `main` red without a commit here. It also fails where nobody can act on it: a PR only downloads the list when it changes `docs/manifest.json` or `docs/redirects.json`, whilst every push to `main` downloads it, and that run is after the merge. So PRs kept passing lint and merging onto a red `main`. To fix, `lint/docs-redirects` now runs with `-offline`, and only compares the manifest and redirects against the base branch. A PR that moves or removes a page without a redirect still fails, as that comparison never needed the download. I think this is the right fix, rather than just teaching the check about endpoint pages, because the download wasn't catching anything. The site is built from the manifest, so a page can only be on the live list and missing from the manifest if a PR removed it, in which case the base comparison already fails that PR, or if the docs engine made the page itself. Today 391 live pages aren't in the manifest, and all of them are the second kind: the 389 endpoint pages, plus 2 pages the site serves with hyphens for dots, which the check already special-cased. Endpoint pages would be the second special case of that kind, and the next docs engine change that adds pages would need a third. What we lose is a second failure on `main` when a page removal is merged past a failing lint, and that failure clears by itself once the site is republished without the page. On a push there's no base branch to compare against, so only the rules themselves are validated there. Alternatives I considered: - Only skipping the endpoint pages, which is what this PR did at first. It fixes today's failure and leaves the cause in place, as above. - Deriving the endpoint pages from `swagger.json` in the check, so they're compared like any other page. That means copying the docs engine's URL rules into this repo and keeping the two in step, in order to catch renamed or removed endpoints. In the last 90 days on `main` that was one removal and no renames. - Deleting the live comparison outright. I've kept it, as it's still useful to run by hand without `-offline`, e.g. after a change to how the docs engine builds its routes. So that it's usable, the first commit stays: routes of the endpoint page form are left out of that comparison whilst their section page is still in the manifest, and it prints how many were skipped. `go run ./scripts/docsredirectscheck -branch main` goes from 389 failures to passing. - Comparing against the previous commit on push runs, so that `main` keeps a removed-route check. That's the comparison the PR already ran, and a failure there comes after the merge. The URL of an endpoint page changes whenever its `@Summary` or tag does, and nothing here will notice. Catching that would mean requiring a redirect on those API changes, which I've left out of this PR. This also needs backporting to `release/2.40`. |
||
|
|
255a9884d2 |
Revert "docs: update Agent Relay docs for GA and v0.17.0" (#32708)
Reverts coder/coder#32552 |
||
|
|
005d5a87c0 |
docs: update Agent Relay docs for GA and v0.17.0 (#32552)
Updates the Agent Relay docs for general availability and for agent-relay v0.17.0, and adds the version requirements table from RELAY-61. - **Beta to GA:** the sidebar state goes from `[premium, beta]` to `[premium]`, and every page drops its beta callout. The monitoring and SIEM notes now say metric names, log messages, and fields can change between releases, and tell readers to review alerts when they upgrade. Anthropic's own "public beta" line for self-hosted environments stays, because Anthropic's docs still say public beta. - **Version requirements:** `setup.md` gets one table of minimum versions for Coder, Agent Relay, the Terraform provider, both modules, and the Claude Code CLI. The "v0.16.0 or later" qualifiers across the pages are removed, because the table sets a single GA baseline. Module examples move to 1.0.1, the latest tag. Its only change from 1.0.0 is in the README. - **v0.17.0, Claude Code poll loop** ([agent-relay#189](https://github.com/coder/agent-relay/pull/189)): after it handles a session, a pool claims the next one right away and waits 5 seconds only after an empty or failed poll. The "one session every 5 seconds" claim and the provisioner sizing formula that depended on it are replaced in `claude-code.md`. `siem.md` lists the renamed `backoff` log field, which replaces `interval`. - **v0.17.0, redelivery** ([agent-relay#165](https://github.com/coder/agent-relay/pull/165)): if Anthropic redelivers a session while its previous workspace still has a start build or a delete in progress, Agent Relay fails the session instead of building again. This is covered in the build budget, setup failure, and reap delay text, plus a new troubleshooting entry. - **`install_cli`:** the docs no longer say `install_cli = true` removes the Claude Code CLI minimum. The modules skip the install when a CLI is already on `PATH` and never upgrade it. ## Open questions - **GA versions (Steven Masley, per RELAY-61):** the table uses the latest versions as of today: Coder 2.39, Agent Relay v0.17.0, Terraform provider v2.20.0, and modules 1.0.0. If GA ships with newer releases, the table, the early access upgrade steps, and the `claude-code.md`/`cursor.md` module notes need the new numbers. - **Stability at GA:** should the monitoring and SIEM pages promise anything about metric and log stability, or does "can change between releases" stay? - **Backport:** the v0.16.0 docs were backported to `release/2.39` (#32122). This PR probably needs the same once the GA versions are settled. Related: #32519 adds a section to `claude-code.md` in a different part of the page. It shouldn't conflict. <details> <summary>Verification notes and decision log</summary> Verified against agent-relay `v0.16.0...v0.17.0`: - `serviceclaudecoderunners/poller.go` `pollLoop`: `drain` polls again right after each handled hint (`maxHintsPerPoll = 1`). `pollIntervalDefault` (5s) is the startup delay and the backoff after `ErrEmptyPoll`, a retryable poll error, or a license lapse. The relay sets no limit on concurrent builds (README, Claude Code pools). - `workspacedispatcher/dispatcher.go` `reconcile`: with `TerminalOnUnfinishedBuild` (set to `redelivered(hint.Attempt)` in `serviceclaudecoderunners/dispatch.go`), `blocksRedelivery` (START or DELETE pending, starting, or canceling, or deleting) sends the non-retryable nack `agent-relay: the previous workspace was not ready for this session; send a new message to retry` and logs `redelivery found a predecessor build or delete in progress, failing current work order`. `retirePredecessorLocked` runs only for a START that isn't deleting. It cancels the build through `settleBuild`, then deletes the workspace. A running delete is left alone. - A new message is a first delivery, and `AwaitDeleting: true` makes it wait for the delete and then build fresh. - `poller.go`: the `poll loop started` record's field is now `backoff`. No other code emits `interval`. - No CLI flags, environment variables, Helm values, or metric names changed between v0.16.0 and v0.17.0. - Registry `agent-relay-{claude-code,cursor}` v1.0.1 `main.tf` `install_cli`: "A CLI already in the image is used as is and never upgraded." Decisions: - The table states one GA baseline instead of a matrix with one row per relay release. RELAY-61 narrowed the scope to "latest versions as of GA", and the relay doesn't check module pairing at runtime, so older rows couldn't be verified. - The Claude Code CLI minimum of 2.1.224 is kept. Neither the relay nor the module checks it, so it's left as stated policy. - Not documented: the example image bumps (#156, #181, #183), the mock-clock refactor (#166), and the test-only PRs, because users see no change. Checks: `make lint/emdash`, `make lint/docs-manifest`, `make lint/docs-html`, markdownlint, and Vale (no new alerts compared with `main`). A `doc-check` self-check found 3 blocking accuracy findings: the `install_cli` wording twice, and the redelivery cleanup wording. All 3 are fixed. </details> Refs DOCS-1797, RELAY-61 > Generated by Coder Agents on behalf of @nickvigilante. |
||
|
|
7c7dd8fb63 |
chore: remove the retention start from the AI spend users response (#32687)
## Description Only the old spend page read `retention_start` from the per-user AI spend response, to limit its date picker. That page is gone, and the AI Gateway retention endpoint now serves this purpose, so the field is removed. The server still narrows a default period to the retention and rejects an explicit one that starts before it. Related to AIGOV-729 ## Changes - Remove `RetentionStart` from `codersdk.OrganizationAISpendReport`. - Keep the retention start local to `aiSpendRetainedPeriod`, its only reader. - Regenerate the API docs and TypeScript types, and update the tests and mocks. Depends on #32686. > [!NOTE] > Generated by Coder Agents on behalf of @ssncferreira. |
||
|
|
dfe6402910 |
feat: add an AI Gateway data retention endpoint (#32659)
## Description Pages that read raw AI Gateway data and have a date picker don't handle data retention consistently. AI Sessions allows start dates whose data is already purged. AI spend only learns the retention after a request. The new AI spend page reads aggregated data, which is never purged, in some views and raw data in others. For consistency, the Overview and Detailed report tabs should accept the same date range, so both are limited to the retention. The retention is in the deployment config, but only Owners can read it. This adds an experimental endpoint that returns only the retention, so these pages can offer only retained dates. ## Changes - Add `GET /api/experimental/ai-gateway/retention`, returning `retention_ms`. Zero means data is never purged. - Any authenticated user with the AI Gateway feature can read it, since it holds no usage data. - Add `codersdk.AIGatewayRetention` and the `ExperimentalClient.AIGatewayRetention` method. > [!NOTE] > Generated by Coder Agents on behalf of @ssncferreira. |
||
|
|
933efa59c4 |
docs: add disaster recovery page (#32356)
## Summary Adds a disaster recovery page. Customers keep asking for more than the one-paragraph disaster recovery note in the validated architecture docs. The incident response content moved to #32402. ## Changes - New `docs/install/operate/disaster-recovery.md` (explanation), covering: - database backups, including the encryption keys that live outside the database; - restore testing; - what HA does and doesn't cover; - region outages: why Coder can't fail over across regions, failing over to a cold standby database, and what happens to workspaces in the failed region; - outage impact for direct and relayed connections; - orphaned resources after a restore. - Sidebar entry, plus links from the sizing page's disaster recovery paragraph and the Operate landing page. ## Notes for reviewers - The source draft says the workspace agent buffers activity while it's disconnected. The code shows only a reconnect loop (`agent/agent.go`, `runLoop`), so the page says the agent keeps running and reconnects, and makes no claim about buffering. - The claim that direct sessions survive an outage comes from `tailnet/configmaps.go`. When the coordinator connection drops, peers are marked lost and removed only after `lostTimeout` (15 minutes) passes with no WireGuard handshake. The page leaves the constant out. - The access URL step in the region failover procedure relies on agents getting `CODER_AGENT_URL` from the access URL at build time (`provisionersdk/scripts/bootstrap_linux.sh`, `coderd/provisionerdserver/provisionerdserver.go`), so keeping the URL lets agents in surviving regions reconnect without a rebuild. - The single-region database claim rests on Coder taking one PostgreSQL connection URL with no read-replica option, plus the latency guidance in `docs/admin/networking/high-availability.md`. - The PDF doesn't mention that a restored database still lists workspaces that were deleted after the backup. The page covers this and how to remove them with `coder delete --orphan`. ## Testing - `make lint/emdash`, `make lint/docs-manifest`, `make lint/docs-html`, and `make lint/docs-redirects` (offline) pass. - markdownlint and Vale on the new and edited pages: 0 findings. - Relative links and anchors resolve. <details> <summary>Plan and decision log</summary> - Source: the "Coder Disaster Recovery" PDF attached to DOCS-1214. Its sections cover backup, restore validation, HA, multi-region, workspace impact, and orphaned workspaces after a restore. - Placement: Install > Operate, next to Upgrade, because these are day-two operations. - Verified against code: - Terraform state is stored in `workspace_builds.provisioner_state`. - The built-in PostgreSQL data lives under the config root (`cli/server.go`). - `coder delete --orphan` removes a workspace without deleting its resources. - Corrected from the PDF: removed the agent "buffers activity" claim, and added the case of workspaces that were deleted after the backup. - Review feedback (@bpmct): added a "Plan for a region outage" section covering no automatic cross-region failover, the single-region database, a cold standby in a recovery region, and disk replication for workspaces in the failed region. It replaces the two-sentence cross-region note under the HA table. - Split: the incident response page that this PR first included now lives in #32402 (DOCS-1796), following review feedback that asked for a generic incident response page. </details> --- _This PR was generated by Coder Agents on behalf of @nickvigilante._ --------- Co-authored-by: Ian Evans <5760366+ianjevans@users.noreply.github.com> |
||
|
|
1465f64d86 |
docs: list what air-gapped templates and workspaces download (#32457)
## Summary List what a default deployment and the Docker and Kubernetes starter templates download from the internet, what fails when each download is blocked, and the offline replacement for each. The most common place an air-gapped install stalls is the first workspace build, not the control plane, and the air-gapped deployments page didn't cover it. Refs [DOCS-1782](https://linear.app/codercom/issue/DOCS-1782). ## Changes All changes are in `docs/install/prepare/airgap.md`. - **Component table:** - Fixes the PostgreSQL row: the built-in database downloads from `repo.maven.apache.org` (`cli/server.go`), not `repo1.maven.org`. - Adds four rows: trial license (`v2-licensor.coder.com`), the access URL tunnel (`*.try.coder.app`), the default GitHub sign-in and external auth providers, and the template builder (`registry.coder.com`). - **New section, "What templates and workspaces download":** a table for the Docker and Kubernetes starter templates that covers Terraform providers, Coder Registry modules, JetBrains IDE version lookups, the workspace image and `image_pull_policy = "Always"`, code-server, and code-server extensions. - **Firewall exceptions:** the old list said code-server.dev was "install via Arch User Repository (AUR)" and v2-licensor.coder.com was for "developing Coder in Coder". The new list separates what the Coder server and provisioners reach from what workspaces reach, and adds `registry.coder.com`. ## Notes for review - **Base:** this branch is based on `main`, not stacked on #31869. `main` has changed this page six times since #31869 branched, including the table rows and the firewall section this PR edits. #31869 adds only two lines to this page, in the Kubernetes tab, which this PR doesn't touch, so the two shouldn't conflict. - **Not covered:** templates other than the Docker and Kubernetes starters, AI features, and IDE marketplaces beyond the existing JetBrains and VS Code sections. The page tells readers to check their own templates for the same kinds of downloads. - **Follow-up:** once this merges, the install landing page in #32405 can link the new section's anchor instead of the top of the page. ## Testing - `make fmt/markdown` and `make lint/emdash lint/docs-html lint/markdown`: all pass. - Vale on `airgap.md`: 0 errors, 0 warnings, 0 suggestions. - A relative link and anchor check on the page: no broken links. - doc-check skill in author self-check mode. I fixed its four blocking findings: the providers row was missing `hashicorp/http`, the JetBrains IDE version lookup was missing, the page wrongly said that creating a template from a starter works offline, and it used "the Coder server" instead of "the control plane". The firewall intro is now narrowed to what the list covers. <details> <summary>Evidence for each new claim</summary> | Claim | Source | |---|---| | Built-in PostgreSQL downloads from `repo.maven.apache.org` | `cli/server.go`, `BinaryRepositoryURL("https://repo.maven.apache.org/maven2")` | | A trial requests a license from `v2-licensor.coder.com` | `enterprise/trialer/trialer.go` (`LicenseRequestURL`), called from `coderd/users.go` when the first user starts a trial | | No access URL means a tunnel through a Coder-hosted server | `cli/server.go` (`devtunnel.New` when `AccessURL` is empty), `wg-tunnel-host` flag description | | Default GitHub sign-in and external auth providers on new deployments | `cli/server.go`, `getGithubOAuth2ConfigParams` and `maybeAppendDefaultGithubExternalAuthProvider`, which apply only when no users exist at first start and no explicit providers are set | | Template builder resolves modules from `registry.coder.com` | `codersdk/deployment.go`, template builder registry default | | Starter templates ship in the binary | `examples/examples.go`, `//go:embed` | | Docker starter: `kreuzwerker/docker`, `code-server` and `jetbrains` modules, `codercom/example-base:ubuntu` | `examples/templates/docker/main.tf` | | Kubernetes starter: `hashicorp/kubernetes`, `curl` of `code-server.dev/install.sh`, `image_pull_policy = "Always"` | `examples/templates/kubernetes/main.tf` | | The `jetbrains` module needs `hashicorp/http` and looks up IDE versions from `data.services.jetbrains.com` unless `ide_config` is set | coder/registry `registry/coder/modules/jetbrains/main.tf` | | Provider downloads come from `github.com` (`coder/coder`, `kreuzwerker/docker`) and `releases.hashicorp.com` (`hashicorp/kubernetes`, `hashicorp/http`) | `registry.terraform.io/v1/providers/<provider>/<version>/download/linux/amd64` responses | | Creating a template from a starter still runs `terraform init` | `coderd/templateversions.go` creates an import job, which `provisioner/terraform/provision.go` initializes | | `code-server` module offline mode runs `${install_prefix}/bin/code-server` and can't install extensions | coder/registry `registry/coder/modules/code-server/main.tf` and `run.sh` (v1.6.0) | | code-server's install script downloads from GitHub | `https://code-server.dev/install.sh` (api.github.com and github.com releases) | </details> --- _This PR was generated by Coder Agents on behalf of @nickvigilante._ |
||
|
|
74a15cbcaa |
feat: adopt OpenTelemetry GenAI semantic conventions for Coder Agents traces (#32411)
Aligns Coder Agents traces with the [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) so customers can ingest per-user model usage, spend, and tool activity without custom mapping. Scope follows the requesting team's Slack ask: agent spans, inference spans with token usage, GenAI attributes, per-user attribution, and visibility into tools that cannot be reached. Closes CODAGT-1523. ## Changes - Span names follow the conventions: `chat_turn` becomes `invoke_agent coder`, `stream` becomes `chat {model}`, and `tool_call` becomes `execute_tool {tool}`. Every stage span now carries a `stage` attribute with the old stage name, which matches the Prometheus `stage` label. Metrics are unchanged. - GenAI spans carry `gen_ai.operation.name`, `gen_ai.conversation.id` (the chat ID), `user.id` (the chat owner), and `coder.organization.id`, `coder.workspace.id`, `coder.chat.parent_id`, `coder.chat.root_id`. - `chat` spans are `CLIENT` spans with the provider, request model, and `gen_ai.request.stream` set at creation (so samplers can see them), plus requested max tokens and temperature, response ID (including OpenAI Responses metadata on non-streaming calls), the finish reason the provider reported (omitted when none, kept when Coder rejects the response), `gen_ai.output.type=json` for native OpenAI structured output, and token usage with cache read/write (only when nonzero) and reasoning breakdown. `gen_ai.usage.input_tokens` includes cached tokens, as the spec requires. Fantasy reports them separately (Google providers use the OpenAI-compatible client, which does the same). - `execute_tool` spans carry the tool name, call ID, and type (`function` for built-in tools, `extension` for MCP and caller tools), all set at creation. - Every model call records a `chat` span: assistant streams (`stage=stream`), and, as `stage=model_call`, the advisor, compaction summaries plus titles, status labels, and chat summaries (via `StageTracer.TraceModelCalls` in `resolveModelCall`). `model_call` has no histogram, so the `stream` metric is unchanged. - Failed spans get `error.type`. A tool that returns an error result, as MCP clients do for an unreachable server, ends its span with `error.type=tool_error` without recording the result text. - GenAI attributes carry metadata only; prompts, responses, and tool payloads are not recorded. The docs note that other spans and events in the trace, such as AI Gateway spans and server log events, can contain content. - Docs state known limits: Anthropic server-tool responses undercount input tokens in both spans and AI Gateway cost control (the client keeps first-iteration occupancy), the OpenAI-compatible client drops reported cache writes, request attributes are what Coder requested, and the exporter is OTLP/gRPC, plaintext unless a certificate is configured. - New docs page: `docs/coder-agents/platform-controls/opentelemetry-tracing.md`. - `coderd/x/chatd/ARCHITECTURE.md` gains a GenAI semantic conventions subsection under Lifecycle tracing. Existing attributes (`provider`, `model`, `chat_id`, `tool_name`, ...) are kept so current queries on attributes keep working. Queries on span names need to switch to the `stage` attribute or the new names. <details> <summary>Decision log</summary> - **Convention version:** semconv v1.41.0, the last core release that ships the GenAI attributes. Later releases moved them to `semantic-conventions-genai`. The PR uses the Go constants from `go.opentelemetry.io/otel/semconv/v1.41.0`, which is already in the module graph. No experiment gate: chatd is already under `x/`, and the docs page notes that the conventions may change. - **Rename vs. attributes only:** spans are renamed because the conventions define the span names. The `stage` attribute keeps lifecycle identity stable for dashboards and tests. - **Agent name:** `gen_ai.agent.name=coder` for root chats and subagents alike. `chat_kind` and `coder.chat.parent_id` tell them apart. - **Provider name mapping:** configured provider type to well-known values (`openai`, `anthropic`, `azure.ai.openai`, `aws.bedrock`, `gcp.gemini`). Anthropic providers with Bedrock settings report `aws.bedrock`. The `invoke_agent` span gets the provider after `prepare` resolves the turn's model, since the turn span starts first. Other types (`openrouter`, `openai-compat`, `vercel`, `copilot`) are passed through as-is. - **No content capture:** `gen_ai.input.messages`, `gen_ai.output.messages`, and tool arguments/results are opt-in in the conventions and not needed for usage and spend attribution, so they are left for a follow-up behind an explicit deployment flag. - **Out of scope:** GenAI metrics (`gen_ai.client.token.usage`, `gen_ai.client.operation.duration`), an aggregated token total on the `invoke_agent` span, a cost attribute, span links between subagent and parent traces, and correlation IDs with AI Gateway interceptions (an open question in the issue). Subagent turns join the parent only through `coder.chat.root_id`; a span link needs the spawning span context persisted across chats and runners. Spans carry tokens, not cost; cost stays in the existing cost API. - **Identity snapshot:** chat identity is taken when the turn opens. A workspace created mid-turn appears on spans from the next turn. </details> --- Generated by Coder Agents on behalf of @f0ssel. |
||
|
|
e28931cfb1 |
docs: add how-to for rolling out a security update to every workspace (#31982)
Adds an admin how-to that walks through getting a patched package (for example an updated `ca-certificates` after a certificate authority is compromised) into every new and existing workspace. Until now the steps were spread across image management, template versioning, update policies, automatic updates, and bulk operations. The new page `docs/templates/managing-templates/roll-out-security-updates.md` covers: 1. Rebuilding the image and pinning a new tag or digest, and why a re-pushed mutable tag can be skipped. 2. Publishing and promoting a template version (dashboard and CLI). 3. Making future starts use the active version: template update policy (Premium), automatic updates, and autostop requirement (Premium). 4. Updating existing workspaces with a `coder list` | `coder update` loop (first, because the dashboard handles 25 workspaces per page) or bulk **Update…**. It warns that bulk **Start** keeps the current version and that dormant workspaces are skipped. 5. Confirming with the `outdated:true` filter and checking the package with `coder ssh`. 6. Other places to update, outside the image: dev containers, `envbuilder` caches, persistent home volumes, and persistent VM disks. It also covers prebuilt workspaces. It also adds the page to the sidebar (`docs/manifest/templates/managing-templates.yml`, regenerated `docs/manifest.json`) and links to it from `image-management.md` and the Bulk operations section of `workspace-management.md`. The page links to existing pages instead of repeating them. The CLI commands and their output were run against a local dev deployment: `templates push`, the `coder list --search ... outdated:true` table, the JSON/`jq`/`xargs coder update -y` loop, the empty result, and `coder ssh ... -- dpkg-query`. Dashboard steps are checked against the UI code only. **Verified against** - `site/src/pages/WorkspacesPage/WorkspacesPage.tsx`, `WorkspacesPageView.tsx`, `WorkspacesTable.tsx`, `BatchUpdateModalForm.tsx`, `batchActions.ts` (Bulk actions labels, bulk Start uses the current version, bulk Update skips dormant and starts stopped workspaces, default `user:me` filter) - `site/src/api/api.ts` (`updateWorkspace`, `changeWorkspaceVersion`, `startWorkspace`) - `site/src/pages/TemplatePage/TemplatePageHeader.tsx`, `TemplateLayout.tsx`, `TemplateVersionsPage/TemplateVersionsPage.tsx`, `VersionRow.tsx`, `TemplateVersionEditorPage/TemplateVersionEditor.tsx`, `PublishTemplateVersionDialog.tsx` (Edit files, Build, Publish, Promote to active version, Promote…) - `site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx`, `Sidebar.tsx` (Operations section, require-active-version label, Premium badge, Save) - `site/src/pages/WorkspaceSettingsPage/WorkspaceSettingsForm.tsx`, `Sidebar.tsx` (Automatic Updates, Update Policy) - `site/src/modules/workspaces/actions.ts`, `site/src/utils/workspace.tsx` - `coderd/database/dbauthz/dbauthz.go` (`InsertWorkspaceBuild` require-active-version check, exemption for users who can update the template) - `enterprise/coderd/coderd.go`, `enterprise/coderd/dbauthz/accesscontrol.go`, `codersdk/deployment.go` (`access_control` Premium gating; bulk actions not license-gated) - `coderd/autobuild/lifecycle_executor.go`, `coderd/workspaces.go` (autostart uses the active version under the policy or `always`) - `coderd/rbac/roles.go`, `docs/admin/users/groups-roles.md` (Template Admin has workspace read only) - `cli/templatepush.go` (`--activate` default true), `cli/templateedit.go`, `cli/update.go`, `cli/start.go` (dormant activation, active-version selection), `cli/list.go`, `cli/cliui/filter.go` (`--all` ignores `--search`), `cli/ssh.go` - `coderd/searchquery/search.go` (`outdated` filter) - `examples/templates/docker/main.tf`, `examples/templates/kubernetes/main.tf` - `docs/templates/extending-templates/prebuilt-workspaces.md`, `docs/admin/integrations/devcontainers/envbuilder/envbuilder-security-caching.md`, `docs/workspaces/devcontainers/working-with-dev-containers.md` **Open questions for the reviewer** - `envbuilder` caching: `envbuilder` isn't in this repo, so I couldn't confirm that changing the base image reference (for example to a new digest) always avoids a cached image. The page says to change the reference and links the upstream caching doc. An `envbuilder` expert should confirm. - Docker and Kubernetes pull behavior for re-pushed mutable tags is described from the vendors' documented defaults and the example templates. I didn't test it on a real cluster. - `workspace-management.md` Bulk operations still says "top-right **Actions** dropdown", but the UI label is **Bulk actions**. I left it alone to avoid conflicting with #31137, which edits the same section. Should it be fixed there or here? - The template update policy has several names: "Template update policies" in the docs, the UI checkbox "Require workspaces automatically update when started.", and `--require-active-version`. `index.md` still tells readers to enable "**Template Update Policies**", which doesn't match the UI. Not changed here. - Doc-check suggestion not applied: adding links to the new page from `change-management.md` and `index.md#update-templates`, which is outside this change's scope. - Dashboard steps were checked against the UI code, not run in a browser. > Generated by Coder Agents. Closes DOCS-1354 Supersedes #31810, reopened under a human author for attribution. --------- Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com> |
||
|
|
c484ad2be4 |
fix: keep the provisioner key secret out of request paths and logs (#32532)
Linear: [PLE-94](https://linear.app/codercom/issue/PLE-94). One of three independent PRs split out of the original masking change. ## Root cause `codersdk.Client.GetProvisionerKey` sent the real provisioner key secret in the URL path (`/api/v2/provisionerkeys/<key>`) as well as in the `Coder-Provisioner-Daemon-Key` header. The path ends up in proxy/access logs, the server request logger (`path`, `params_provisionerkey`) and the SDK's `sdk request` debug log. The server ignores the path value: the route uses `ExtractProvisionerDaemonAuthenticated` and `fetchProvisionerKey` returns the header-authenticated key. Nothing reads `{provisionerkey}` on that route (`ExtractProvisionerKeyParam` is only mounted on the org-scoped route, where the value is a key name). ## Fix - The SDK now sends a fixed placeholder segment, `/api/v2/provisionerkeys/me`; the secret travels only in the header. Old servers ignore the path, and old clients still work with new servers. - `loggermw` masks the `provisionerkey` route param (keeping at most a 4 character prefix) in `params_*` and `path` as a backstop for old clients. It only applies when the route pattern is the top-level `/provisionerkeys/{provisionerkey}`; the org-scoped `/organizations/{organization}/provisionerkeys/{provisionerkey}` carries a key name and is left alone. - Swagger annotation and generated docs now describe the path param as an ignored placeholder (edited by hand, not via `make gen`). Sibling PRs (independent, disjoint files): - https://github.com/coder/coder/pull/32526 - https://github.com/coder/coder/pull/32533 ## Follow-ups not included - AI Gateway prompt, tool and thought content logged in `aibridgedserver.go` (~511-613) and `aibridge/recorder/log_recorder.go` - `rich_parameter_values` in `runner.go` (~443) - Proxy `response_body` in `aibridgeproxyd.go` (~1102) - Terraform `TF_LOG` output relayed to logs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
326a0bd4a8 |
fix: close silent ssh connections when keep-alives stop (#32601)
Bump the gliderlabs/ssh fork to coder/ssh#8, which runs one keep-alive per connection and closes the whole connection when the client stops answering, instead of only the session channel. Connections whose session had ended, or that only carried port forwards, were never probed and could stay Ongoing in the connection log indefinitely. - Keep probing every third of CODER_AGENT_SSH_MAX_TIMEOUT (24h by default) - Report connections that end with a read error, such as the tailnet TCP retry limit after a client vanishes, or that the keep-alive closes, as network_error with the read error as disconnect_detail - Keep reporting a clean client close as client_closed - Wrap the agent's connection to record its first read error while still forwarding the client session ID - Document when a vanished client's connection closes and the tradeoff of lowering the timeout Closes CLIENT-1113 |
||
|
|
4a7d214f53 |
feat(site): show AI spend per organization (#32204)
Users in more than one organization can now pick an organization in the avatar menu and see their AI spend and budget there. Before, the menu showed one figure from a site-wide effective group, so these users couldn't see their spend in their other organizations. The menu now polls two endpoints every 60 seconds: `GET /users/me/ai/spend` for the site-wide spend, as before, and `GET /users/me/ai/spend/organizations` (#32202) for the per-organization breakdown. The menu can't know that a user is in more than one organization until the second request returns, so it always makes both requests. - **Organization selector:** appears only when the per-organization response lists more than one organization. It's a menu item that expands a `DropdownMenuRadioGroup` inside the existing menu, so the menu stays open while the user switches. Each organization shows a warning or exceeded badge with a screen reader label, in API order, and typeahead matches the organization name. The selection lives in local component state. It starts on the entry that matches `organization_id`, or on the first entry if none matches. If a refetch drops the selected organization, it falls back the same way. - **Avatar badge:** the badge on the avatar, and its screen reader label, follow the selected organization. - **Single organization, or no breakdown:** users in one organization see the site-wide spend, as before. The menu also shows the site-wide spend, without a selector, while the per-organization request has no data, for example when it fails or the server predates it. - **Exceeded state:** any user at or over their limit, single-organization users included, sees an "AI spend" header with a red "Limit exceeded" label. Below the bar, the menu says when AI requests resume: "AI requests are paused until {period end}". A $0 budget counts as exceeded even with no spend, because AI Gateway blocks requests once spend reaches the limit. The shared `getSeverity` helper is unchanged, so other views still show $0 of $0 as normal. The normal and warning states look the same as before. - **Invalid values:** if the shown organization reports a negative spend or limit, the menu keeps the selector and shows "AI spend unavailable", so the user can still switch. A single-organization user with invalid values sees no spend section, as before. - **Failed polls:** when a refetch fails, the menu keeps the last spend and adds "Couldn't refresh AI spend:" followed by the server's error message, for whichever endpoint it's showing. Before, it hid the section, which would close an open selector while the user was choosing. `UsageIndicator` still hides spend on error. A pure helper, `getUserMenuSpend` in `viewedSpend.ts`, decides which spend to show. The severity map moved into `severityIndicators.tsx`, next to a shared `SeverityBadge`. The cost controls page now describes the selector and the exceeded state. Stacked on #32203. Review only the last three commits here. ### Open questions A $0 budget blocks every AI Gateway request, but the shared `getSeverity` helper in `site/src/utils/budget.ts` still shows $0 of $0 as normal. This PR only changes the user menu. Two other screens use the shared helper: - The AI usage indicator on the Agents page (`UsageIndicator`) shows users their own spend. Should a $0 budget show as exceeded there too, to match the menu? - The group budget amounts (`AIBudgetAmount`) show admins each group's budget. Should a group with a $0 budget, where AI is deliberately off, show as exceeded or stay neutral? Out of scope, tracked in AIGOV-738: organization search, the count badge on the collapsed row, sorting organizations by severity, the workspace quota row, and a shared app-wide current organization. `UserDropdown.test.tsx` checks the exceeded text because the ticket asks for it. A Pixel story also covers that state. The failed-poll state has a Vitest test but no story yet. Refs [AIGOV-766](https://linear.app/codercom/issue/AIGOV-766) <details> <summary>Screenshots</summary> #### Multiple organizations <img width="2530" height="1800" alt="image" src="https://github.com/user-attachments/assets/8b29ca6b-78b8-4a50-a5d8-0f1892bfb509" /> #### Organization picker with severity badges <img width="2530" height="1800" alt="image" src="https://github.com/user-attachments/assets/58ecc2b2-d7f0-4517-aaa0-bac6306f7ffe" /> #### Selected organization over its limit <img width="2530" height="1800" alt="image" src="https://github.com/user-attachments/assets/e4ef8647-db88-44dd-9f7a-22111f92527c" /> #### AI spend unavailable for the selected organization <img width="2530" height="1800" alt="image" src="https://github.com/user-attachments/assets/bbd51bd1-c250-4e0a-ae86-819185855f89" /> </details> --- *Generated by Coder Agents on behalf of @SasSwart.* --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
dcbe84a23b |
feat: add organization member AI spend endpoint (#32203)
Adds `GET /api/v2/organizations/{organization}/members/{user}/ai/spend`,
which returns a user's effective AI budget and current-period spend
inside one organization. Admins, and users themselves, can use it to
look up spend in a specific organization.
The endpoint resolves the budget inside that organization only, the same
way AI Gateway resolves a request made there. The response has the same
shape as the user spend endpoint, plus `organization_id`.
Users can read their own spend, and admins can read the spend of a user
whose membership in that organization they can read. The endpoint
returns 404 when the user isn't a member of the organization, or when
the caller can't read the user. It requires the AI Governance license.
Organization admins can read every user, so only the organization and
membership checks keep them out of other organizations. The tests cover
both sides: an organization admin reading a member of their own
organization (200) and of another organization (404).
Also adds `Client.OrganizationMemberAISpendStatus` to `codersdk`, and
links the endpoint from `cost-controls.md`.
Stacked on #32202, which adds `GET
/users/{user}/ai/spend/organizations`. Review only the last two commits
here.
Refs [AIGOV-766](https://linear.app/codercom/issue/AIGOV-766)
---
*Generated by Coder Agents on behalf of @SasSwart.*
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
1b9f2d8181 |
feat!: add the client to the AI spend CSV export (#32474)
## Description
Adds the client to the stable `GET
/api/v2/organizations/{organization}/ai/spend/export` CSV export, so the
Detailed report page (https://github.com/coder/coder/pull/32482) can
export the same data with the same filters.
## Changes
- `ExportOrganizationAISpend` groups rows by client as well, and takes a
`client` filter. Usage without a recorded client is reported as
`Unknown`, like `/ai/spend/users`.
- The export accepts a `client` query parameter, and adds a `client`
column at the end of the CSV, so existing columns keep their position.
- `OrganizationAISpendDetailsFilter` takes a `Client`.
- Update the Spend export docs and the query and handler tests.
## Breaking change
The AI spend CSV export (`GET
/api/v2/organizations/{organization}/ai/spend/export`) now has a
`client` column at the end, and splits rows by it.
If you rely on one row per user, group, model and provider, sum
`cost_micros` and the token columns across clients to get the previous
totals.
Closes AIGOV-733
> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
|
||
|
|
c236edcb8d |
feat: add per-organization AI spend endpoint (#32202)
Adds `GET /api/v2/users/{user}/ai/spend/organizations`, which returns a
user's AI budget and current-period spend in each of their
organizations. The avatar menu uses it to show spend to users who belong
to more than one organization (#32204).
The response lists each organization the user is a current member of and
the caller can read, sorted by name. Each entry has the effective group,
budget, and spend that AI Gateway resolves for a request in that
organization. When no group budget applies, the effective group is the
organization's `Everyone` group. `organization_id` names the
organization of the user's site-wide effective group, so the menu opens
on the numbers the user sees today. It's null when that organization
isn't in the list.
`GET /users/{user}/ai/spend` is unchanged. Its API docs now say that it
resolves the site-wide effective group, and point to the new endpoint
for the per-organization breakdown.
dbauthz filters the user's organizations to those the caller can read,
so an organization-scoped admin only sees the organizations they
administer. The handler queries spend only for those organizations. A
new query, `GetUserAISpendByEffectiveGroupsSince`, reads the spend for
all of them in one call. It reads existing tables, so there's no
migration, and dbauthz checks it the same way as `GetUserAISpendSince`:
the caller must be able to read the user.
Refs [AIGOV-766](https://linear.app/codercom/issue/AIGOV-766)
<details>
<summary>Decisions</summary>
- **Separate endpoint.** An earlier version of this PR added
`organizations` and `organization_id` to `GET /users/{user}/ai/spend`.
Following review, the breakdown moved to its own route ([AIGOV-766
comment](https://linear.app/codercom/issue/AIGOV-766/show-spend-per-org-to-users-in-several-orgs#comment-6855c55c)).
Because the breakdown depends on who is asking, a dedicated route keeps
the existing endpoint's response the same for every caller.
- **`organization_id` on the new response.** The comment's schema left
it out, but its frontend notes and its test rely on it, so the response
includes it.
- **Existing endpoint left as on `main`.** An organization-scoped admin
can still see a user's site-wide effective group, budget, and spend
through `GET /users/{user}/ai/spend`, even when that group is in another
organization. The earlier version of this PR hid those fields; this
version keeps the existing behavior, as the review asked.
- **Authorization check.** dbauthz post-filters
`GetOrganizationsByUserID` with `read` on each organization. The
endpoint itself requires read on the user, as the existing spend
endpoint does.
- **Empty result.** A caller who can read the user but none of their
organizations gets `200` with an empty `organizations` list and a null
`organization_id`, so the response doesn't reveal that memberships
exist.
- **Per-organization spend.** Each entry reports spend on the user's
current effective group in that organization, which is what budget
enforcement compares.
</details>
---
*Generated by Coder Agents on behalf of @SasSwart.*
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
eb922f8a9c |
docs: describe support channels and what to include in a support request (#31992)
Expands the Support landing page, which currently only points to GitHub issues and Discord: - Splits **Community support** (GitHub, Discord) from **Premium support** (the [Coder support portal](https://help.coder.com) and the account team). - Adds **What to include in a support request**: version (`GET /api/v2/buildinfo`), support bundle and logs, reproduction steps, impact, and **deadlines**. Deadlines matter most here: knowing a customer's event or rollout date early changes how we prioritize. - Notes that a proposed fix is welcome but doesn't replace reproduction details. The manifest description already mentions premium support, so no manifest change is needed. ## Needs Support / CS confirmation before merge - [ ] OK to publish help.coder.com as the Premium support entry point - [ ] Wording for contacting the account team, and whether to mention shared Slack channels - [ ] Wording of the proposed-fix paragraph Linear: DOCS-1731 Supersedes #31945, reopened under a human author for attribution. --------- Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> Co-authored-by: Rowan Smith <rowan@coder.com> Co-authored-by: coderagents[bot] <254784001+coderagents[bot]@users.noreply.github.com> |
||
|
|
aa8a770ea3 |
docs: use provisioner key env var in VM and Docker provisioner examples (#32626)
## Summary The VM and Docker examples on the external provisioners page set `CODER_SESSION_TOKEN`, so a reader who follows the page's recommended scoped-key path and pastes a key from `coder provisioner keys create` gets an auth failure. This switches both examples to `CODER_PROVISIONER_DAEMON_KEY`, which matches the Scoped Key and Helm sections on the same page. Fixes #30066 ## Changes - `docs/install/operate/provisioners/index.md`: the VM and Docker examples now set `CODER_PROVISIONER_DAEMON_KEY=<your-provisioner-key>`, with one line explaining where the key comes from and that a user token still works through `CODER_SESSION_TOKEN`. ## Testing - Ran a throwaway CLI test (not committed) against `enterprise/cli` with a real provisioner key: - `CODER_SESSION_TOKEN=<provisioner key> coder provisioner start` fails with `must provide a pre-shared key or provisioner key when not authenticated as a user`. - `CODER_PROVISIONER_DAEMON_KEY=<provisioner key> coder provisioner start` logs `starting provisioner daemon`. - `markdownlint-cli2`, Vale, `make lint/emdash`, `make lint/docs-html`, and `make lint/docs-manifest` pass. <details> <summary>Investigation notes</summary> - Provisioner keys and session tokens travel in different headers: `Coder-Provisioner-Daemon-Key` (`codersdk/client.go`) versus `Coder-Session-Token`. `coder provisioner start` only reads a key from `--key` or `CODER_PROVISIONER_DAEMON_KEY` (`enterprise/cli/provisionerdaemonstart.go`). - Without a key or PSK, the CLI treats the session token as a user API key and selects an organization, which returns 401 for a provisioner key. - The two examples date from March 2023 (#6443), before provisioner keys existed (`--key` landed in #14002, July 2024), so they were written for user tokens. User tokens still work, so the examples were outdated rather than broken, but they contradicted the page's recommended path. - No other page under `docs/` pairs `CODER_SESSION_TOKEN` with `coder provisioner start`. `docs/admin/users/organizations.md` already uses `CODER_PROVISIONER_DAEMON_KEY`. </details> --- _Generated by Coder Agents on behalf of @nickvigilante._ |
||
|
|
54fc9e3e14 |
ci: remove the workflow that updated coder.com's own docs renderer (#32560)
## Merge order
Merge this together with coder/coder.com#1231, which removes coder.com's
own docs renderer and its `/api/algolia-docs-sync` endpoint, ideally
just before it. Merged earlier, coder.com's Algolia docs index and its
build-time docs redirects stop updating while that renderer still
exists; merged later, the `algolia-and-isr` job fails on every `docs/**`
push because its endpoint is gone. coder/coder.com#1231 itself follows
coder/coder.com#1230 and the docs-engine changes that move code-server's
docs into the engine.
## Summary
`deploy-docs.yaml` kept coder.com's classic docs renderer up to date.
Its `algolia-and-isr` job POSTed every `docs/**` push to coder.com's
Algolia docs sync, which reindexed the Algolia `docs` index and
revalidated the static pages, and its `vercel-rebuild` job fired a full
coder.com rebuild when `docs/manifest.json` or `docs/redirects.json`
changed. coder.com/docs has been served by the docs engine since
October, and coder/coder.com#1231 removes the renderer, the sync
endpoint, and coder.com's build-time reading of the manifest and
redirects. After that, the first job fails on every docs push and the
second rebuilds coder.com for nothing, so the whole workflow goes.
This removes `deploy-docs.yaml` and the two test scripts that only
exercised its logic (`test-deploy-docs-diff.sh` for the surgical-reindex
diff parser, `test-deploy-docs-release.sh` for the release-tag step
inside the Algolia job). It drops the three paths from doc-check's path
filter and from CODEOWNERS, and rewrites the short "How exclusion from
coder.com works" section of `docs/.style/README.md`, which described
exclusion through coder.com's old renderer, to describe the docs
engine's manifest-driven sync.
After merge, the `ALGOLIA_DOCS_SYNC_SECRET` and
`DEPLOY_DOCS_VERCEL_WEBHOOK` repository secrets are unused and can be
deleted.
## Verification
Nothing else in the repository references what this removes. A code
search on `main` for `deploy-docs`, `test-deploy-docs`,
`DEPLOY_DOCS_VERCEL_WEBHOOK`, `ALGOLIA_DOCS_SYNC_SECRET` and
`algolia-docs-sync` finds only the six files this PR changes. No CI job
runs the two test scripts; doc-check only lists them in a path filter.
The branch is one commit on `main` (
|
||
|
|
11f72a8ae9 |
ci: publish release images and charts through coder/ghcr-publisher (#32566)
GitHub grants package write access to a whole repository, not to a workflow, branch or environment. Today `ghcr.io/coder/coder`, `coder-base` and the OCI charts list coder/coder with Write, so any workflow on any branch here can request `packages: write` and overwrite a release tag with this repository's `GITHUB_TOKEN`. The `release` environment and the tag rulesets don't stop that. GHCR accepts neither App tokens nor OIDC, so the repository boundary is the only way to separate who publishes. With this change, releases push to `*-staging` packages and trigger **coder/ghcr-publisher**, a locked repository that will be the only one with Write on the public packages. Before copying a digest, it verifies three things: - this `release.yaml` attested it, - on `release/X.Y` (or `main` for an RC), with the signer being `release.yaml` at that same ref, - built from the commit the `vX.Y.Z` tag points to. It copies by digest and never moves an existing version tag. It moves `latest` only to the highest stable version. ### Changes - **release.yaml** - Images, the base image and the OCI charts are pushed to `coder-staging`, `coder-base-staging` and `chart-staging/*`. - The charts get attestations for their OCI manifest digests. The existing `.tgz` attestations don't cover those digests. - The base and image attestations no longer `continue-on-error`, because promotion depends on them. - The final image is built on the fresh base image **by digest**. - A `repository_dispatch` is sent with a `coder-ghcr-dispatch` token (`contents: write` on `ghcr-publisher` only). - The job waits until every public tag serves the expected digest, before the GitHub release is published. - `latest` is no longer built here. The separate latest SBOM asset is dropped; it described the same image. - **docker-base.yaml** - Only checks, on PRs that touch them, that `Dockerfile.base` builds for every platform. It no longer publishes, and no longer needs `packages: write`. - Non-release and local builds keep using `ghcr.io/coder/coder-base:latest`. coder/ghcr-publisher moves it to the base of each new highest stable release (roughly weekly for 2.39), instead of the Monday/Wednesday/Friday rebuild. So preview images and the `coder-preview:main` scan see Alpine updates about weekly, and a `Dockerfile.base` change reaches preview images at the next stable release. Release images always build a fresh base. - **verify-releases.md** - Releases since 2026-11-16 (#32212) are built on `release/X.Y`, so the documented `--source-ref refs/tags/vX.Y.Z` and cosign identity fail for current releases. - Checked: `gh attestation verify` on v2.39.4 fails with the tag ref and passes with `refs/heads/release/2.39`. v2.39.1 still passes with its tag. Cosign verifies v2.39.4 with the new identity. ### Review fixes (second commit set) Two independent reviews (one functional, one adversarial) found the following, now fixed: - **A writer could get a real release to attest their image.** The index was built from, and its digest read back from, mutable staging tags. A writer moving `coder-staging:vX` mid-release could get their image attested. Now every digest comes from the registry's response to our own push (`docker push`, `docker manifest push`, depot, `helm push`), the index is built from per-arch **digests**, and syft and cosign run on `image@digest`. Tested against a local registry with Docker 29: each parsed digest matches what the registry stores, and the index contains exactly the pushed children. - **Commit binding.** The provenance commit field is the dispatched branch head, not the released commit (which differs whenever an older commit is released). Each artifact now gets a release attestation (`https://coder.com/attestations/release/v1`) stating version, commit and target package, and the publisher requires it, plus an approved `release` environment on the run. - **Re-runs:** a tag an earlier attempt promoted is accepted, and the publisher keeps that build. - **Tokens:** the tagging and promotion App tokens are revoked right after use. - **Docs:** `SOURCE_REF` is now correct for RCs (checked in bash and PowerShell). Image *provenance* attestations are best-effort again, as before; the publisher relies on the release attestations instead. ### Prerequisites (all done 2026-11-22) 1. coder/ghcr-publisher#1 and coder/ghcr-publisher#2 merged (#2 checks the release attestations this PR now produces). 2. The staging packages exist (created 2026-11-20), with coder/coder **Write** and `ghcr-publisher` **Read** set under Manage Actions access: `coder-staging`, `coder-base-staging`, `chart-staging/coder`, `chart-staging/coder-provisioner`, `chart-staging/coder-ai-gateway`. 3. The `coder-ghcr-dispatch` App exists and is installed on `ghcr-publisher` only (coder/gcp#472, coder/github-org-terraform#206), and `CODER_GHCR_DISPATCH_APP_ID` and `CODER_GHCR_DISPATCH_APP_KMS_KEY` are set in the `release` environment. `coder-release-publisher` is uninstalled from `ghcr-publisher`. ### After merge - Backport to release/2.39, 2.38, 2.37, 2.34 and 2.29. Each branch runs its own `release.yaml`. - After one real release promotes successfully, switch the five public packages to coder/coder **Read** and ghcr-publisher **Write**. Only then is the overwrite path closed. Tested: - The publisher's checks against the real v2.39.4 attestations: pass on the right ref, fail on a wrong ref, wrong commit or wrong signer. - The anonymous digest lookup against live image, base and chart tags (matches crane). - actionlint and zizmor are clean. - No release has run with this yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
013d00e8ea |
docs: list AI Gateway before Agent Firewall in the AI Governance sidebar (#32554)
## Summary Lists AI Gateway before Agent Firewall under AI Governance in the docs sidebar. The sidebar now matches the AI Governance landing page, which already introduces AI Gateway first. ## Changes - `docs/manifest/ai-governance.yml`: swap the order of the two child includes, and reorder the section description to "AI Gateway, Agent Firewall, and reporting." - `docs/manifest.json`: regenerated with `make gen/docs-manifest`. No page content, paths, or redirects change. ## Testing - `make gen/docs-manifest`, `make lint/docs-manifest`, `make lint/docs-html`, and `make lint/emdash` pass. - Checked that the regenerated `docs/manifest.json` differs from `main` only in the AI Governance children order and its description. Closes [DOCS-1858](https://linear.app/codercom/issue/DOCS-1858/move-ai-gateway-above-agent-firewall-in-the-ai-governance-docs-sidebar) --- _Generated by Coder Agents on behalf of @nickvigilante._ |
||
|
|
eabd63b0fc |
docs: add an air-gapped K3s install tutorial (#31869)
Adds a tutorial that installs Coder on a single-node K3s cluster in a
fully air-gapped environment. It stages every artifact on an
internet-connected workstation, builds a Coder image with a Terraform
provider mirror and a workspace image with code-server preinstalled,
carries everything to the host on removable storage, runs every host
command on the host itself, and ends with a workspace that has no
outbound access. The page is added under the Kubernetes install pages in
the sidebar and linked from the air-gapped deployments page.
The commands were first run end to end on an arm64 Raspberry Pi 4 Model
B with 4 GB of memory running Ubuntu Server 26.04 LTS, with SSH from the
workstation. After review moved the page to a strict air gap, the whole
page was run again on amd64: staging on a Linux workstation, then the
host steps on an Ubuntu Server 26.04 systemd container on a network with
no internet access and no route to the workstation. The starter
Kubernetes template needs three changes to work in this environment (the
hardcoded `amd64` agent architecture, the `Always` image pull policy,
and the code-server install in the startup script), and the chart's
default 2 CPU and 4Gi memory request does not schedule on a 4 GB host.
The page makes each change with a command and states the expected
output.
Maintenance and limits for the reviewer:
- Versions are pinned in the page (K3s, Coder, both Terraform providers,
code-server, Helm, PostgreSQL). The release automation in
`scripts/releaser/docs.go` only updates
`docs/install/server/kubernetes/index.md`, so these will not update on
release.
- The architecture is set once with `ARCH` and `K3S_BINARY`. The current
host steps were run on amd64 only. The arm64 run on the Pi predates the
move to removable storage.
- A host with no default route can't start K3s, so the page checks for
one and adds the black-hole route from the K3s air-gap docs. The test
sandbox can't load kernel modules, so a `veth` interface stood in for
the `dummy` interface type. `dummy.ko` ships in Ubuntu 26.04's base
`linux-modules` package.
- The Dockerfiles and the PostgreSQL manifest are new content that
overlaps with the example Dockerfile on the air-gapped deployments page.
I left that page's Dockerfile alone because it has separate problems,
which are tracked outside this PR.
- No identifiers were stripped from the page. Every host address, user
name, and host name is a placeholder.
- The doc-check review suggestion about the `wget` command in the final
verification step is not applied. The workspace image includes `wget`,
so a failure means the request did not succeed.
---
🤖 Built with AI assistance.
|
||
|
|
462b474729 |
fix: refuse unknown built-in PostgreSQL data versions (#32489)
<!-- Authored with Coder Agents on behalf of @Emyrk --> Refs https://linear.app/codercom/issue/CORE-634/upgrade-embedded-postgresql-to-a-non-eol-version. Precedes #32144. Refuse to start built-in PostgreSQL when an existing data directory has a missing or unsupported version, rather than letting embedded-postgres replace its data. - An existing `PG_VERSION` other than 13, including 18 or 19, now returns an error without starting PostgreSQL. - A missing marker also returns recovery guidance instead of initializing over existing data. - Fresh databases and existing PostgreSQL 13 databases keep their current behavior. - Development database recovery uses the same guard. <details><summary>Agent context</summary> The bundled embedded-postgres v1 library can delete an existing data directory whose version does not match its PostgreSQL 13 binary. This change checks the directory before invoking the library, without changing the binary version or migrating data. Only Coder builds containing this guard gain the protection; already-released older binaries remain unchanged. </details> --- <sub>Coder Agents on behalf of @Emyrk.</sub> |
||
|
|
d3a57ec1ca | fix(site/src/pages/AgentsPage/AgentSettingsPage/AgentSettingsSkillsPage): keep organization skills visible across many organizations (#32410) | ||
|
|
13381e306d |
feat: paginate the organization unpriced AI models endpoint (#32170)
## Description
Paginates the experimental `GET
/api/experimental/organizations/{organization}/ai/model-prices/unpriced`
endpoint from #31753. The list is keyed by the requested model, which
clients set, so it has no upper bound.
## Changes
- `GetUnpricedAIModels` takes `limit_opt` and `offset_opt`, and each row
carries the `count` of every model. A zero limit returns every model, so
the unpriced models notification is unchanged.
- The endpoint reads `limit` and `offset` with
`parseOrganizationAISpendPage` (default 10, maximum 100), as the other
AI spend endpoints do.
- `count` is now the number of models over every page.
- `ExperimentalClient.OrganizationUnpricedAIModels` takes an
`OrganizationAISpendPage`.
- Add query and handler tests for pagination.
Related to AIGOV-730
> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
|
||
|
|
d807abc2e3 |
feat: honor --use-keyring together with --global-config (#32392)
An explicit --use-keyring flag or CODER_USE_KEYRING value now selects the keyring backend even when --global-config points at a custom directory. When --use-keyring is left at its default, a custom --global-config still selects file storage so existing callers keep finding <dir>/session. Removes the test-only RootCmd.UseKeyringWithGlobalConfig override and the duplicate clitest.NewWithDefaultKeyringCommand helper. Closes CLI-1, #29105 |
||
|
|
35bd24ee3b |
feat(site/src): show organizations on the AI Gateway session summary (#32313)
Adds an **Organization** row to the Session summary card on the AI Gateway session detail page, using the `organizations` field added to the session response in #32057. Each organization is a badge linking to `/organizations/<name>` and showing `display_name || name`, as in the Connection Logs details popover. Sessions with no organization recorded, which only exist from before v2.39, show "Not recorded". The row is shown only when `useDashboard().showOrganizations` is true, so single-organization deployments see no change. The AI Gateway audit docs mention the new row. Refs AIGOV-754. Stacked on #32260. ## Notes for reviewers - **Several organizations:** all are listed, wrapping like the Provider row. The label stays singular ("Organization"), matching "Provider". - **Cost** is still the whole session's cost, as agreed for AIGOV-754. - **Tests:** stories only, since the change is visual. `SessionSummaryTable` has `OneOrganization`, `MultipleOrganizations` and `OrganizationNotRecorded`; `Default` covers the hidden row. `SessionThreadsPageView` has `WithOrganizations`, which covers the page passing the organizations through. New shared fixtures: `MockAIBridgeSessionOrganization` and `MockAIBridgeSessionOrganization2` in `testHelpers/entities.ts`. <details> <summary>Decisions and plan</summary> - **Scope (Sas, 16 Nov):** the detail page organization row is a separate PR after the list filter, built this sprint if time allows. There is no design, so it follows existing patterns. - **Behavior:** no row on single-org deployments; "Not recorded" for an empty list; one linked badge per organization. - **Badge link:** `<Badge asChild hover>` around the router link, as in `WorkspacesTable.tsx`, so the focus ring is not clipped and long names truncate with an ellipsis and a `title`. - **Stack:** #32057 (backend) → #32260 (list filter) → this PR. - **Checks run:** `pnpm lint:types`, Biome, `frontend-deep-review` (all findings fixed), and doc-check on `audit.md` (no blocking findings). </details> --- Code written by @mollymaefraser, with Coder Agents used as a guide: explaining the existing code path, reviewing each step, and running reviews. |
||
|
|
88d3494b9a |
feat: require a setup token to create the first user on a tunnel (#32324)
fix(security): require setup token for first user on tunnels Prevent unauthorized users from claiming Owner access on public `try.coder.app` tunnels before initial setup. - Generate a setup token at startup when using a tunnel with no existing users. - Require the token for first-user creation via the API, web UI, and CLI. - Block GitHub/OIDC first-user signup until setup is complete. - Support custom tokens via `--setup-token` / `CODER_SETUP_TOKEN` and non-interactive CLI setup. - Update development scripts, documentation, and tests. - Preserve existing behavior for deployments with an access URL or existing users. Validated with automated tests and 23/23 manual scenarios using a real tunnel. Refs CORE-784 |
||
|
|
feb6e809c4 |
docs: add provisioner metrics and a metrics signpost page (#31977)
## Summary Admins who start from the External provisioners docs had no way to find out which Prometheus metrics exist for provisioners, or how to turn them on for standalone provisioner daemons. This PR documents both, and turns the deployment metrics page into a signpost to the monitoring docs for each area. ## Changes - **`docs/install/operate/provisioners/index.md`:** expands the "Prometheus metrics" section. The heading and its `#prometheus-metrics` anchor are unchanged. - It explains which metrics each provisioner daemon reports and which the control plane reports. For built-in provisioners, the control plane also reports the daemon metrics. - Two tables list each metric's purpose and link to the generated [Available metrics](https://coder.com/docs/admin/integrations/prometheus#available-metrics) table for types and labels. - It explains how to read the queue wait metric. Jobs whose tags no provisioner matches don't appear in it until a provisioner acquires them. - It shows how to turn on the daemon's Prometheus endpoint with `--prometheus-enable` / `CODER_PROMETHEUS_ENABLE` and `--prometheus-address` / `CODER_PROMETHEUS_ADDRESS`. It corrects the stated default address from `localhost:2112` to `127.0.0.1:2112`. - It covers the `coder-provisioner` Helm chart: the fixed `0.0.0.0:2112` address, the `prometheus-http` container port, and the missing Service. It adds a Pod discovery example with `coder.podAnnotations` and a `PodMonitor` alternative. - **`docs/install/operate/provisioners/manage-provisioner-jobs.md`:** links from the troubleshooting section to the metrics section. - **`docs/admin/monitoring/metrics.md`:** becomes a signpost page. - It keeps the control plane setup links and the `#setting-up-metrics` anchor. - It adds a table of monitoring pages per area (provisioners, workspace proxies, prebuilt workspaces, AI Gateway, Agent Relay), and notes which areas serve metrics on their own endpoint. - It links to the full metrics list. No new pages, so `docs/manifest.json` is unchanged. ## Testing - `make lint/emdash`, `go run ./scripts/docshtmlcheck`, markdownlint, and `markdown-table-formatter` are clean on the changed files. - Vale reports 0 errors and 0 warnings. Its 4 suggestions are on lines this PR doesn't change. - The pre-commit hook (`pre-commit-light`, including `lint/docs-redirects`, `lint/markdown`, and `lint/style-claims`) passed. - A script resolved every relative link and anchor in the changed files. <details> <summary>Verified against</summary> - `provisionerd/provisionerd.go` (`NewMetrics`): names of the five provisioner daemon metrics. - `provisionerd/runner/runner.go`: where the job and build metrics are recorded. - `cli/server.go:1273-1296`: the control plane registers the daemon metrics only for built-in provisioners, and sets `num_daemons` to the built-in count. `cli/server.go:385-389` registers the provisioner server metrics. - `coderd/provisionerdserver/provisionerdserver.go:1011-1019`: `coderd_provisioner_job_queue_wait_seconds` is recorded only when a provisioner daemon acquires a job. `coderd/coderd.go:2602` and `enterprise/coderd/provisionerdaemons.go:365` pass the same metrics to built-in and external provisioners. - `coderd/jobreaper/detector.go:26-28`: a pending job that nothing acquires is failed after 30 minutes, without a queue wait observation. - `coderd/wsbuilder/metrics.go` and `coderd/wsbuilder/wsbuilder.go:357-373`: `coderd_workspace_builds_enqueued_total`. - `enterprise/cli/provisionerdaemonstart.go:204-218, 371-383`: the flags, env vars, and `127.0.0.1:2112` default. A standalone daemon sets `num_daemons` to 1 and registers the Go, process, and `promhttp` collectors. - `cli/agent.go:603-611`: the metrics handler serves every path, so the default `/metrics` scrape path works. - `helm/provisioner/templates/_coder.tpl:40-41, 81-96`: the fixed address, and the `prometheus-http` port that appears only when `CODER_PROMETHEUS_ENABLE` is `"true"`. The chart has no Service template. - `helm/libcoder/templates/_coder.yaml:24-33`, `helm/libcoder/templates/_helpers.tpl:20-22`, and `helm/provisioner/tests/testdata/labels_annotations.golden`: `coder.podAnnotations` and `coder.podLabels` land on the Pod template, which carries the `app.kubernetes.io/name` and `app.kubernetes.io/instance` labels. - `enterprise/cli/proxyserver.go:243-250`: workspace proxies serve metrics on their own listener. - Tests that pin these claims: `coderd/workspaces_test.go` (queue wait), `helm/provisioner/tests/testdata/default_values.golden` (fixed address), and `enterprise/cli/testdata/coder_provisioner_start_--help.golden` (CLI default). </details> <details> <summary>Decision log</summary> - **Kept the `## Prometheus metrics` heading.** Renaming it gained nothing and would break external links to `#prometheus-metrics`. The AI Gateway and Agent Relay pages that the signpost table links to use the same heading. - **Kept `<a id="setting-up-metrics"></a>` on `metrics.md`.** External links to that anchor keep working, and `scripts/docshtmlcheck` passes with it. - **Dropped the Type and Labels columns.** `scripts/metricsdocgen` fills one marked block in `prometheus.md`, so it can't generate these tables. Types and labels drift the most, so the page now points to the generated table for them. Extending the generator, or adding a check that metrics named in `docs/` exist in `scripts/metricsdocgen/generated_metrics`, would need a separate PR. - **Rewrote the queue wait guidance.** The earlier text said a rising value can mean no provisioner matches a job's tags. The code records the value only when a provisioner acquires a job, so unmatched jobs never reach the metric. The page now links to the existing troubleshooting steps for finding them, instead of restating a command. - **Reworded the signpost intro.** The workspace proxies page explains how to turn on metrics but doesn't list them, so the table describes each linked page as covering monitoring, not listing metrics. - **"Separate endpoint" column.** Checked in code for workspace proxies. Agent Relay has no server code in this repo, so its "Yes" comes from `docs/agent-relay/monitoring/index.md`. </details> <details> <summary>Related gaps not edited</summary> - `docs/admin/integrations/prometheus.md:14` and `docs/admin/networking/workspace-proxies.md:221` still say `localhost:2112`. The server and proxy default is `127.0.0.1:2112` (`codersdk/deployment.go:2658`). - `docs/workspaces/speed-up-templates.md:42-44` implies that control plane metrics include `coderd_provisionerd_job_timings_seconds`. That holds only for built-in provisioners. - `docs/admin/networking/workspace-proxies.md#observability` explains how to turn on the endpoint but doesn't list any proxy metrics. - `docs/admin/networking/` (DERP and tailnet, for example `coder_derp_server_*` and `coder_servertailnet_*`) has no metrics section. - `docs/admin/monitoring/health-check.md` links to the database metrics flag but doesn't list the `coderd_db_*` metrics. - `docs/admin/monitoring/notifications/` doesn't list the `coderd_notifications_*` metrics. - `docs/admin/users/` (`coderd_api_active_users_duration_hour`, license metrics) and `docs/admin/security/audit-logs.md` have no metrics sections. - `docs/templates/extending-templates/prebuilt-workspaces.md#available-metrics` lists metrics without types or labels, and doesn't say how to turn them on. </details> Disclosure: these changes were generated by Coder Agents. Closes DOCS-892 Supersedes #31804, reopened under a human author for attribution. --------- Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com> |
||
|
|
01b0a234e8 |
docs: add Verify Coder releases page (#31983)
Adds a how-to page, `docs/admin/security/verify-releases.md` (sidebar:
**Administration > Security > Verify releases**). It shows Coder
deployment administrators how to check release artifacts with the
evidence each release already publishes:
- GPG verification of `coder_<version>_checksums.txt` with its `.asc`
signature, then a SHA-256 check of the artifact (Linux `sha256sum`,
macOS `shasum`, Windows `Get-FileHash`).
- GPG verification of the standalone CLI binaries on
`releases.coder.com/coder-cli/<version>/` using their detached `.asc`
signatures.
- `gh attestation verify` for SLSA build provenance on release files,
Helm charts (including charts pulled from `oci://ghcr.io/coder/chart`)
and `oci://ghcr.io/coder/coder:v<version>`, pinned to `release.yaml` and
the release tag.
- `cosign verify-attestation --type spdxjson` for the image SBOM, with
the keyless certificate identity and steps to extract the SPDX document.
- Short macOS (`codesign`, `spctl`) and Windows
(`Get-AuthenticodeSignature`) code-signature checks.
The attestation steps in `release.yaml` use `continue-on-error`. The
page therefore calls provenance best-effort, does not promise every
artifact is attested, and gives a fallback when `gh attestation verify`
returns `HTTP 404: Not Found`.
Verified against:
- `.github/workflows/release.yaml`: build targets, attestation steps and
subject globs, the SBOM steps (`syft`, `cosign attest`), the `latest`
tag logic, the `releases.coder.com` upload, Helm publishing
- `scripts/release/publish.sh`: checksum file name and GPG signing of
the checksum file
- `scripts/sign_with_gpg.sh`: detached armored signatures
- `scripts/build_go.sh`, `scripts/build_windows_installer.sh`,
`scripts/archive.sh`, `scripts/sign_windows.sh`,
`scripts/sign_darwin.sh`, `scripts/notarize_darwin.sh`: which files are
code-signed and notarized
- `scripts/image_tag.sh`: image name and tag format
- `Makefile`: slim binary and `.asc` handling
- `mise.toml`: the release pipeline uses cosign 2.4.3
- `release.key`: the public key in the repo root
- Every command except the macOS and Windows code-signature checks was
run against release v2.38.6: Linux and macOS commands in a shell,
Windows commands in PowerShell 7 on Linux. GPG checksum and binary
signatures, `gh attestation verify` on files, Helm charts and the OCI
image, and Cosign 3.1.4 SBOM verification all succeeded. Cosign 2.4.3
without the flag also succeeded.
<details>
<summary>Decision log</summary>
- Placed under `admin/security/` because the Security section lists its
child pages automatically, and the page is meant to be linked from the
trust center.
- PowerShell variables are case-insensitive, so `${VERSION}` works in
both shells. Single-line commands are shared, and tabs appear only where
commands really differ.
- Cosign 3 needs `--new-bundle-format=false` to find the SBOM
attestation. Without it, it reports "none of the attestations matched
the predicate type: spdxjson". Cosign 2 rejects the flag, so the page
tells Cosign 2 users to remove it.
- The `gpg --import` example output uses `<key ID>` rather than the real
key ID, to stay consistent with the fingerprint placeholder.
- Dropped Cosign's first output line because it ends in a spaced `--`,
which the punctuation rules ban.
</details>
Open questions for the reviewer:
- **Security: GPG fingerprint.** The page has a `TODO(security)`
placeholder. For reference, `gpg --show-keys release.key` reports
primary key `21C9 6B1C B950 7188 74F6 4DBD 6A5A 671B 5E40 A3B9` (`Coder
Release Signing Key <security@coder.com>`, expires 2029-01-18,
encryption subkey expired). That key signed the v2.38.6 checksums.
Please confirm this is the fingerprint to publish, and whether
`raw.githubusercontent.com/coder/coder/main/release.key` is the right
place to download it.
- **Security: signing identities.** Placeholders remain for the Apple
Developer ID / Team ID and the Windows EV certificate subject. The page
publishes the Sigstore certificate identity
`https://github.com/coder/coder/.github/workflows/release.yaml@refs/tags/v<version>`
with issuer `https://token.actions.githubusercontent.com`. Both come
from the public workflow path and were seen in real verification output.
Please confirm that is acceptable to publish.
- **Not run:** the macOS `codesign -dvv` / `spctl --assess -t install`
steps and Windows `Get-AuthenticodeSignature` come from script comments.
They need a check on real macOS and Windows machines, including expected
output.
- **Cosign format risk:** the SBOM attestation uses the older cosign
format, which Cosign 3 has deprecated. Consider a release-workflow step
that runs the documented verify command so a format change gets caught.
- **Public URL:** is `releases.coder.com/coder-cli/<version>/` meant to
be a documented download location?
- **Trust center link:** the trust center is outside this repo, so
someone needs to add the link to this page there.
- **Likely merge conflict:** open PR #31806 also edits
`docs/manifest/admin/security.yml` and `docs/manifest.json`.
Generated by Coder Agents.
Closes DOCS-1219
Supersedes #31811, reopened under a human author for attribution.
---------
Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com>
|
||
|
|
5f61a045ab | docs: refocus sandbox agents intro on Coder's approach (#32451) | ||
|
|
8705d80fe0 |
feat: add provider, model, and client spend to the AI spend users endpoint (#32330)
## Description
Extends the experimental `GET
/api/experimental/organizations/{organization}/ai/spend/users` endpoint
with the per-user details behind the AI spend overview and the detailed
report. Each user now returns their spend per provider, model, and
client, and whether each has unpriced usage.
## Changes
- Rewrite `ListOrganizationAISpendUsers` with `GROUPING SETS`, returning
one row per user and provider, model, or client:
- Adds the `user_ids` and `group_id` filters.
- Pages, counts, and totals users, not their rows.
- Reads the provider display name, icon, and type from `ai_providers`,
including deleted providers. The live provider wins when a name was
reused, like `GetAIProviderFilterOptions`.
- Update the SDK and handler:
- Each user returns `provider_spend`, `model_spend`, and `client_spend`,
most expensive first, each with `has_unpriced_usage`.
- `totals` returns `has_unpriced_usage`.
- Remove the `providers`, `clients`, and `models` name arrays and
`unpriced_usage_count`.
- Accept `user_ids` (comma-separated, maximum 100) and `group_id`.
- Return more than 100 `user_ids` on the group members AI spend endpoint
as a validation error, like `/ai/spend/users`.
- Switch the Spend page to the new fields, with no UI changes.
- Update the query and handler tests.
<details>
<summary>Dogfood performance</summary>
- Benchmarked on **dogfood**, comparing the existing query on **main**
with the updated query in **this PR**.
- Tested **1, 7, 15 and 30-day windows**, ending at **November 18, 2026,
00:00 UTC**, exclusive.
- Each query ran **five times per window**, one at a time, with query
order and window order rotated across rounds to reduce ordering bias.
The table shows PostgreSQL execution time in **seconds, average
(min-max)**.
| Days | Main | This PR |
|------|-----:|--------:|
| 1 | 0.288 (0.199-0.501) | 0.223 (0.184-0.275) |
| 7 | 11.413 (4.076-40.003) | 4.107 (3.529-4.828) |
| 15 | 9.961 (8.053-16.917) | 7.253 (6.873-7.736) |
| 30 | 14.979 (12.276-23.177) | 8.499 (7.813-9.169) |
All five runs are included. Main's first seven-day run took **40.003s**
with unusually high read I/O time, which raises its average. Cache and
concurrent load can affect these results.
</details>
Closes AIGOV-734
> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
|
||
|
|
690d107fdb |
docs: explain how to keep a workspace running without a connection (#32315)
The answer to "how do I keep a workspace up while a long job or coding agent runs?" only lived in the [reference page](https://coder.com/docs/reference/#workspace-agents), which is hard to find. This adds a **Keep a workspace running without a connection** section to the scheduling page under Activity detection: - Background processes (Claude Code in `tmux`, Herdr, `nohup` jobs) don't count as activity. - `coder schedule extend` from the CLI, and `PUT /extend` from a script with a user token. - **Keep coding agents running:** template examples for Claude Code and Herdr. A `coder_script` uses the owner's build session token once to mint a token scoped to `workspace:read` + `workspace:update` and allow-listed to the workspace. It also installs a `coder-keepalive` helper. Claude Code calls the helper from `managed_settings` hooks, and Herdr calls it from a `post_start_script` loop. Neither needs a module change. Matching README examples: coder/registry#1262. This deliberately avoids app status / AgentAPI reporting. <details> <summary>Validation</summary> On a local v2.38.8 deployment, I used three Docker workspaces with no IDE, SSH, or terminal connection. Autostop was 2m, and Claude Code went through dogfood's AI Gateway running about 30 sequential tool calls over about 11 minutes. The template used the snippets from this page verbatim, with the unmodified modules from registry `main`. | Workspace | Result | | --- | --- | | Control (no keep-alive) | Stopped about 1 minute after its deadline while Claude worked | | Claude Code hooks | Deadline moved to now + 1h at 13:32, and again at 13:43. No changes after Claude finished | | Herdr loop | Deadline moved to now + 1h at 13:32. No changes after the agent went idle | The scoped token from inside the workspace: `PUT /extend` returns 200. Stopping or deleting the workspace returns 403. Other workspaces, `/users/me`, and token creation return 404. A full `GET /workspaces/{id}` is forbidden with the allow list, which is why the helper uses `?include_related=latest_build`. </details> --- 🤖 Generated with Coder Agents using Claude. |
||
|
|
7f245d8296 |
chore!: remove legacy AI Gateway metric aliases (#32381)
Removes the deprecated `coder_aibridged_*` and `coder_aibridgeproxyd_*` Prometheus metric aliases, which were scheduled for removal in v2.37. The embedded AI Gateway and AI Gateway Proxy now emit only `coder_ai_gateway_*` and `coder_ai_gateway_proxy_*`. - Replace `NewMetricAliasRegisterer` with `prometheus.WrapRegistererWithPrefix` in `cli/server.go` and `enterprise/cli/aibridgeproxyd.go`. - Delete `coderd/prometheusmetrics/metricalias.go` and its test (no remaining callers). - Drop alias support from the metrics docs scanner. - Update the AI Gateway monitoring and rebranding migration docs: legacy names are removed as of v2.40. **Breaking:** dashboards and alerts that still use the legacy names stop matching. The monitoring docs show a temporary `metric_relabel_configs` bridge. Closes AIGOV-447. <details> <summary>Implementation plan</summary> | File | Change | |---|---| | `cli/server.go` | Remove the `TODO(deprecation)` comment; register embedded gateway metrics with `prometheus.WrapRegistererWithPrefix(aibridgemetrics.PrometheusMetricPrefix, ...)`. | | `enterprise/cli/aibridgeproxyd.go` | Same swap with the `coder_ai_gateway_proxy_` prefix; drop the unused `prometheusmetrics` import. | | `coderd/prometheusmetrics/metricalias.go`, `metricalias_test.go` | Delete; the two call sites above were the only callers. | | `scripts/metricsdocgen/scanner/prefix.go` | Remove `NewMetricAliasRegisterer` from `prefixFuncs`. | | `scripts/metricsdocgen/scanner/scanner_test.go` | Remove the alias fixture and the legacy-alias assertion; the remaining literal-prefix case already covers plain `WrapRegistererWithPrefix`. | | `scripts/metricsdocgen/README.md` | Drop the `NewMetricAliasRegisterer` mention. | | `docs/ai-governance/ai-gateway/monitoring.md` | State that legacy names are no longer emitted as of v2.40; reword the relabel snippet as a temporary bridge and explain its cost. | | `docs/ai-governance/ai-gateway/rebranding-migration.md` | Mark metrics as "No (removed in v2.40)"; rewrite the Metrics section; remove the now-obsolete "dropping the old names" section. | Release note: the `!` title applies `release/breaking`, so the change is listed under breaking changes in the v2.40 release notes. Verification: `make gen` (no metrics reference changes), `make lint`, `pnpm run format-docs`, `pnpm run lint-docs`, doc-check and test-audit self-review, and targeted tests for `enterprise/cli` (AI Gateway / proxy), `cli` (AI Gateway), `scripts/metricsdocgen`, and `coderd/prometheusmetrics`. </details> Code written by @mollymaefraser, with Coder Agents used as a guide. |
||
|
|
a50d929128 |
feat(site/src): add organization filter to AI Gateway sessions list (#32260)
Adds an organization filter to the AI Gateway sessions list, using the `organization` search key added in #32057. Choosing an organization adds `organization:<name>` to the sessions query, so the list shows sessions with at least one interception attributed to that organization. The filter is a new `OrganizationFilter` in `pages/AIBridgePage/filters/`, shaped like the provider, client and model filters, with options from the shared `getOrganizationFilterOptions` helper (the same source as the Connection Logs and Audit filters). The shared `useOrganizationsFilterMenu` it first reused was removed in #32367. It is shown only when `useDashboard().showOrganizations` is true, so single-organization deployments see no change. The AI Gateway audit docs mention the new filter. Refs AIGOV-754. Stacked on #32057. ## Open questions for reviewers - **Permission behind the org list:** the menu lists only organizations where the user can read **audit logs** (`organizationCheck` in `filters/OrganizationFilter.tsx`), not AI Gateway interceptions. Owners and auditors, who can see this page today, have both. A custom role that can see sessions but not audit logs would get an empty list. Connection Logs has the same behavior. Is this acceptable, or should it check AI Gateway interceptions instead (a one-line change)? - **#31040 (Tracy):** that draft reworks this filter bar and already has an Organization option. This PR adds the filter to the current bar; if #31040 lands first, this moves into it. ## Notes for reviewers - **Tests:** `ListSessionsPage.test.tsx` checks that picking an organization sends `organization:<name>` in the request. The `WithOrganizations` story shows the opened menu, and `Default` shows the bar without it. Hiding the filter on single-org deployments has no Vitest test, because FE1 does not allow presence assertions. It is the same one-line `showOrganizations` check as Connection Logs. - The filter starts at "All organizations", not the default organization. - The cost shown for a session is the whole session's cost, even with the filter on, as agreed for AIGOV-754. <details> <summary>Decisions and plan</summary> - **Scope (call with Sas and Susana, 13 Nov):** filter only, no Organization column. No backend change for cost: show the whole session's cost, not per org. Org logic is per page. - **Approach:** build on the current filter bar rather than wait for #31040, which is a draft and conflicts with `main`. Follow the Connection Logs pattern (`ConnectionLogPage.tsx`, `ConnectionLogFilter.tsx`). - **Stack:** #32057 (backend) → this PR (list filter) → follow-up PR for the organization row on the session detail page (`SessionSummaryTable.tsx`). - **Single-org:** no UI change on single-org deployments. - **Checks run:** `pnpm lint:types`, Biome, the `ListSessionsPage` Vitest suite, `frontend-review` (FE1 to FE10), `frontend-deep-review` (all findings fixed), and doc-check on `audit.md` (no blocking findings). </details> --- Code written by @mollymaefraser, with Coder Agents used as a guide: explaining the existing code path, reviewing each step, running tests and reviews, and writing parts of the test setup. |
||
|
|
4bccdc4ed6 |
feat: show and filter by organization in AI Gateway sessions API (#32057)
Adds an `organization` filter to `GET /api/v2/ai-gateway/sessions` (and its `/api/v2/aibridge/sessions` alias) and returns the organization an interception was attributed to, and how it was chosen, on sessions, threads and agentic actions, as proposed in the surface definitions on AIGOV-754. No migration: `aibridge_interceptions.organization_id` and `organization_source` already exist (000634). The filter accepts an organization name or ID and keeps sessions with at least one interception in that organization; the count uses the same rule so pagination totals match. Each session, on the list and detail responses, lists the organizations its interceptions were attributed to, ordered by name, with the distinct sources used for each, or `[]` when none was stored. Each thread carries the organization of its root interception and each agentic action carries its own, or null when none was stored. The new filter is listed in the AI Gateway monitoring docs. Refs AIGOV-754 ## Open questions for reviewers - **Multi-org sessions** (AIGOV-776): the filter is row-level, like provider and model. A session spanning two orgs is listed under each org's filter, and with the filter on, `threads`, `started_at` and `ended_at` only cover the matching interceptions, while providers, models, tokens and `organizations` cover the whole session. Is that the desired behavior? - **Unknown org ID:** an unknown org name returns 400, but an unknown org ID returns an empty page, because `parseOrganization` does not look up UUIDs. This matches workspaces and templates, but the spec says 400. ## Notes for reviewers - `aiBridgeSessionOrganizations` returns an empty list if the organizations JSON from the query can’t be decoded, rather than failing the whole request. The field is supplementary, so a decoding problem shouldn’t take down the sessions list, but it does mean a SQL bug here would show up as empty data rather than an error. The alternative is to log the error before returning the empty list. - A thread’s organization is taken from its root interception only. If later requests in the same thread were attributed to a different organization, that shows on each agentic action’s own organization field. <details> <summary>Implementation notes</summary> - `coderd/database/queries/aibridge.sql`: - `@organization_id` filter in `CountAIBridgeSessions` and the `session_page` CTE of `ListAIBridgeSessions`. - New `sorg` lateral in `ListAIBridgeSessions` that groups the session's interceptions by organization, collects distinct sources, joins `organizations` (deleted orgs still resolve) and returns a JSON array. - `ListAIBridgeSessionThreads` resolves the organization name, display name and icon through a `LEFT JOIN LATERAL` in the final `SELECT`. A plain join on `organizations` is not safe there: the query has two `@authorize_filter` placeholders, and the injected filter can reference a bare `id`, which would be ambiguous next to `organizations.id`. The lateral only exposes the three selected columns. This answers the authorize-filter open question from the surface proposal. - `coderd/database/modelqueries.go`: the hand-written `ListAuthorizedAIBridgeSessions`, `CountAuthorizedAIBridgeSessions` and `ListAuthorizedAIBridgeSessionThreads` gain the new argument and scan columns. The compiler does not catch a mismatch here; it fails at runtime. - `enterprise/coderd/aibridge.go`: pass `OrganizationID` into `CountAIBridgeSessionsParams`, which is built field by field, and list the `organization` key in `@Param q`. - `coderd/searchquery/search.go`: `organization` key via `parseOrganization`. - `codersdk/aibridge.go`: `AIBridgeInterceptionOrganizationSource` enum, `AIBridgeInterceptionOrganization`, `AIBridgeSessionOrganization`, new response fields and `AIBridgeListSessionsFilter.Organization`, per the proposed Go definitions. - `coderd/database/db2sdk/db2sdk.go`: decode the session organizations JSON, never returning nil; `AIBridgeInterceptionOrganizationSource` converter; build one organization per interception while grouping thread rows, and use it for the thread (root interception) and each agentic action. - `site/`: add `organizations: []` to two frontend mocks, now that the field is required in the generated types. - `docs/ai-governance/ai-gateway/monitoring.md`: `organization` added to the sessions API query filters. - Tests: `TestAIBridgeSessions` (name and ID parsing), `TestAIBridgeListSessions/Filters` (by name and ID, checks count and page), `FilterErrors/UnknownOrganization`, `TestAIBridgeListSessions/Organizations` (multi-org ordering and sources, no-org session returns `[]`, filtering by either org returns the multi-org session and never the no-org one), `TestAIBridgeGetSessionThreads/Organizations` (thread uses the root's org, each action its own, null when none, session `organizations` on the detail endpoint), and `TestAIBridgeInterceptionOrganizationSource` (every database source maps to an SDK value). - Remaining files are generated by `make gen`. </details> --- Code written by @mollymaefraser, with Coder Agents used as a guide: explaining the existing code path, reviewing each step, and running tests. |
||
|
|
734a0cae07 |
feat: scope browser-only connections to a template (#30578)
Add per-template `browser_only` enforcement while preserving `CODER_BROWSER_ONLY` as a deployment-wide override. Refs #29157. Supersedes #29204 (closed by stale bot). Rebased onto current `main`, with migration renumbered to `000643`. ### Changes - Add `templates.browser_only` (default `false`) to the database, SDK, and template create/update APIs. - Require the `browser_only` entitlement to enable the setting, but allow disabling and continue enforcement after license expiry. - Reject agent coordinate connections with 409 and enforce per-template tunnel restrictions through `AuthorizeTunnel`. - Return non-fatal tunnel policy errors in both AGPL coordinator and pgcoord, preserving other active tunnels on shared connections. - Exclude browser-only workspaces from Desktop workspace updates and enforce the restriction in MCP agent connections. - Fix `TestMigration000617ConnectionLogsMethod` to use raw SQL, avoiding schema compatibility issues. ### Open questions - **Naming:** Keep `browser_only` or use `require_browser_connections`? - **Performance:** `AuthorizeTunnel` adds a database query under the coordinator mutex. Consider a narrower query if needed. - **Feature reporting:** Should the feature report as enabled when any template uses it? ### Out of scope Dashboard UI, CLI flag, and Terraform provider support (requires a separate `coder/terraform-provider-coderd` change). ### Verification - Relevant unit and integration tests passed, including coordinate rejection, tunnel isolation, workspace filtering, and non-fatal policy errors in both coordinators. - `golangci-lint` passed with no issues. - Regenerated database, SDK TypeScript, Swagger/API reference, and audit-log artifacts. - Not manually verified with Coder Desktop, multi-node deployments, workspace proxies, or UI. ### AI disclosure Most changes and the rebase were completed with Claude Code (Opus 5/5.5), following the [AI contribution guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING). |
||
|
|
579b9995e8 |
fix: document WebSocket routes as 101 responses in the Swagger spec (#30125)
Six WebSocket routes were documented as `200` responses: `chats/watch`,
`chats/{chat}/stream`, `chats/{chat}/stream/git`,
`chats/{chat}/stream/parts`, `workspaces/{workspace}/watch-ws`, and
`workspaceagents/{workspaceagent}/watch-metadata-ws`.
Mark them `@Success 101`, matching the other WebSocket routes, and
describe each message. `chats/{chat}/stream` and `stream/parts` send a
JSON array batch of events per message, so they keep `{array}`; the
others send one event per message.
Also document that the previous template version route returns `204`
with no body when there is no previous version.
Part of DOCS-1122, split from #30121.
<details>
<summary>CI flakes unrelated to this change</summary>
On `d23267b7c3`, two checks failed in code this PR does not touch.
-
[`TestChatTurnStopsAtStepLimit/Default`](https://github.com/coder/coder/actions/runs/40809166900/job/123235512188)
in `coderd/x/chatd` (test-go-pg, ubuntu): this PR changes only Swagger
comment annotations and generated docs, and does not touch the `chatd`
package.
-
[`updateWorkspace.spec.ts:76`](https://github.com/coder/coder/actions/runs/40809166900/job/123235512158)
(test-e2e): this PR changes no UI code, and the test exercises workspace
parameter updates.
</details>
---
🤖 Built with AI assistance.
---------
Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
|
||
|
|
3617b3d384 |
docs: document 2-second sandbox startup with prebuilt workspaces (#32391)
Follow-up to #32280. The sandbox agents guide said sandbox runtimes boot in milliseconds but didn't say how fast a Coder workspace can be. - `sandbox-agents.md`: some sandboxes advertise millisecond startup, but about 2 seconds is good enough and worth the infrastructure flexibility. Links the [Improving Coder Workspace Startup Times](https://www.youtube.com/watch?v=-xcVJQWVCxs) video (1.5 min to 2 seconds on Kubernetes) in Fast startup. - `speed-up-templates.md`: links the same video in the intro. > Generated by Coder Agents on behalf of @bpmct. --------- Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com> |
||
|
|
df7f2076fd |
docs: explain how the init script obtains the workspace agent (#31976)
## Summary Adds a short note to the base image guidance on the image management page, so template authors don't expect a speedup the init script can't deliver: - The init script downloads the agent from the Coder server on every workspace start, which keeps the agent at the server's version. - An agent binary already in the image isn't used by the init script, so adding the agent to the image doesn't skip the download. - To skip the download, the note links to [Build tools into the image](https://github.com/coder/coder/blob/main/docs/workspaces/speed-up-templates.md#build-tools-into-the-image), which describes starting `coder agent` directly. Refs DOCS-1323. Supersedes #31803, reopened under a human author for attribution. > Generated by Coder Agents. <details> <summary>Verified against</summary> - `provisionersdk/scripts/bootstrap_linux.sh`: always downloads `${ACCESS_URL}bin/coder-linux-${ARCH}` with curl, wget or busybox and retries until it succeeds. `BINARY_DIR` only changes where the binary is downloaded to. - `provisionersdk/scripts/bootstrap_darwin.sh`: always downloads into a new `mktemp` directory. - `provisionersdk/scripts/bootstrap_windows.ps1`: always downloads to `$env:TEMP\sshd.exe`. - `provisionersdk/agent.go`: these scripts are the only init scripts given to the Terraform provider. - `cli/agent.go`, `cli/root.go`: `coder agent` is a hidden command. It reads `CODER_AGENT_URL`, `CODER_AGENT_TOKEN` and `CODER_AGENT_AUTH` (default `token`). - `docs/workspaces/speed-up-templates.md` on `main` (from #32280) already documents installing the agent in the image and starting it directly. </details> <details> <summary>History</summary> This branch was originally stacked on the sandbox agents guide. That guide landed on `main` in #32280 under a different name, so the merge with `main` kept main's version and the PR now contains only the image management note. </details> --------- Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com> Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> Co-authored-by: Ben Potter <me@bpmct.net> |
||
|
|
b2474d19d7 |
feat: own the docs accessibility checks the axe Linter doesn't run on Markdown (#30905)
## Merge order This PR was stacked on #30879, which has merged. It now targets `main` and has no remaining dependency. ## Summary The axe Linter checks only one rule in Markdown, `heading-order`, and markdownlint `MD001` already covers it for Markdown headings. This PR adds owned checks for the raw HTML in docs Markdown that neither tool sees, so the coverage stays when the licence ends. - `Coder.HeadingOrder` (Vale) flags heading-level skips and counts raw `<hN>` headings, such as the `<h3>` headings `scripts/apidocgen` emits, which `MD001` ignores. - `Coder.EmptyHeading` (Vale) flags headings with no text, in Markdown and raw HTML. - `Coder.LinkName` (Vale) flags links with no text: `[](url)`, links whose only content is an image with empty alt text, and empty `<a href>`. - `docshtmlcheck` now rejects `aria-*`, `role`, `tabindex`, and `lang` attributes, and `iframe`, `object`, `area`, `form`, `input`, `select`, `textarea`, `button`, and `meta` elements. No docs page uses any of them, so the 32 axe HTML rules that check them have nothing to check, and this keeps it that way. - The style guide's decorative-image example changes from ``, which `MD045` rejects, to `<img src="…" alt="">`. No docs page used the old form. - The style guide's checks table gains a row per new check, and the coverage counts move the descriptive-link-text section from planned to tool-checked (22 of 90 rules tool-checked, up from 21 on `main`). ## Design All three Vale rules are `script` rules on `raw` scope, because heading levels, empty headings, and links with no text only show up in the raw source. Raw scope also reaches YAML front matter, fenced code, HTML comments, and inline code, so the scripts skip those themselves. Fence tracking matches the opening marker's character and length, so a four-backtick fence holding a three-backtick one stays closed correctly. The patterns use only capture groups that always participate, because Tengo's `text.re_find` panics on a group that didn't match. `Coder.HeadingOrder` is built to agree with `MD001` without reporting the same skip twice. It tracks the previous heading of any kind and the previous Markdown heading. It stays quiet on a Markdown heading that `MD001` already reports (a skip measured against the previous Markdown heading) and reports the skips `MD001` can't see: a raw HTML heading that skips, and a Markdown heading that skips only because a raw HTML heading sits before it. On a probe file covering each case, the two tools reported disjoint lines. The one remaining divergence is by design: after `## A`, `<h3>B</h3>`, `#### C`, `MD001` reports C (it sees H2 to H4) while this rule sees a clean H2, H3, H4 sequence and stays quiet, so the author still gets exactly one finding. The `docshtmlcheck` guard is a separate `guard.go` that runs on each start tag the existing tokenizer already walks. The elements stay in `allowedElements`, so authors get a message explaining why the element doesn't belong rather than the generic unknown-element one, and a closed `<button>` still balances. Guard findings get their own kinds (`disallowed-element`, `disallowed-attribute`) and their own summary footer. I included `form` alongside the form controls the issue lists, since a form with no controls has no use either. Known gaps, documented in each rule's header and none hit by the current corpus: setext headings, headings inside block quotes or list items, raw HTML headings or links split across lines, reference-style links, and inline code delimited by more than one backtick. There is no Vale rule test harness in the repository, so the hit and non-hit probe files used below live outside the tree. ## QA I ran each Vale rule against a probe file with hits and non-hits, with the repository `.vale.ini` and the pinned Vale 3.7.1. - `Coder.HeadingOrder`: reported the raw `<h4>` after an `##` and the `###` that follows a raw `<h1>` after a `###`. It stayed quiet on the two skips `MD001` reports, on `#` lines in front matter, fenced code, and an HTML comment, and on a clean sequence. markdownlint on the same file reported only the two `MD001` lines, so no line got both. - `Coder.EmptyHeading`: reported `##`, `### ###`, `<h2></h2>`, `<h3> </h3>`, and `<h4> <br/> </h4>`. It stayed quiet on text headings, seven `#` marks, an empty `<h2>` in inline code, and lone `#` lines in front matter, fences, and comments. - `Coder.LinkName`: reported all 7 hit cases (empty, whitespace, `![]()` inside a link, raw empty-alt `<img>` inside a link, empty `<a href>`, `<a href>` around an empty-alt image, `<a href>` holding only ` `). It stayed quiet on all 9 non-hit cases, including a bare decorative image, `<a id>` anchors, inline code, comments, and fenced code. Findings on the current corpus (`docs/`, excluding the exempt style guide): `Coder.HeadingOrder` 0, `Coder.EmptyHeading` 0, `Coder.LinkName` 0, `docshtmlcheck` guard 0. The other Vale findings are unchanged from before the PR. No corpus pages changed. ## Testing - `go test ./scripts/docshtmlcheck/ ./scripts/styleclaims/`: 140 passed. The guard tests were written first and failed before `guard.go` existed. They cover each element, each attribute (including case-insensitive names and attributes wrapped across lines), lookalike names such as `data-role`, code and comment exclusion, the reported line and message, and the `run` exit code and footer. - `make lint/docs-html`: clean. - `make lint/style-claims`: clean, so the checks table, the coverage counts, and the annotations agree with `.vale.ini` and the rule files. - `make lint/emdash`: clean. - `pnpm check-docs` (markdownlint and table formatting): 0 errors across 515 files. - Vale 3.7.1 over `docs/` with `--no-exit`, run directly rather than through `make lint/prose` because the worktree's mise config isn't trusted: no findings from the new rules. ## Upstream Not applicable. These checks are specific to the Coder docs corpus and its style guide, so there's nothing to send to Vale, markdownlint, or goldmark. ## Linear https://linear.app/codercom/issue/DOCS-1318 --- 🤖 Built with AI assistance. |
||
|
|
2c96f05186 |
feat: show the overview card in Coder Agents chats (#31412)
Shows the overview card container from #31590 in Coder Agents chats. The card sits in the chat's top-right corner, and a list button in the chat top bar shows and hides it, as in the Codex desktop app. The card and the button exist only while the right panel is closed, the transcript is not full width, and the page is not an embed. Both show only from an 84rem chat, so the card never covers the transcript and the transcript never moves. Below 84rem the card does not mount, so its cost and attachment requests do not run. Phones and narrow windows do not show the card. The card shows by default and stays open until the user hides it. The choice is stored in localStorage under `agents.overview-card-open`, for every chat. The right panel keeps its own saved preference. A row opens the right panel on its tab, which hides the card. The card returns when the panel closes. The Repositories section lists every repository the git watcher reports, by folder name with its branch below. A clean repository shows `+0 −0`, so a chat keeps a Repositories row when AI Gateway turns cost off. The card reads the attachments through `useChatAttachments` from #31411, so it shows the Summary panel's list and shares its query. When the earlier attachments fail to load, the card shows the error and a **Retry** button in Attachments, as the Summary panel does. The docs describe the card in the Coder Agents overview and add it to the places that show spend. #31260 (do not merge) stays the hands-on reference. 1600px chat with the card open:  1600px chat after the user hid the card:  960px chat, no card and no button:  ## Decision and open questions for Jaayden Decision you can reverse: a clean repository row is plain text, not a button. The Git panel lists only repositories with changes, so a click on a clean row used to open the default Git view. To reverse it, give the clean row its `onClick` back in `ChatOverviewCardView`. 1. Should a new chat show the card instead of the Summary panel? This PR keeps the right panel's saved preference as it is. 2. A chat with no repository and no cost shows "Nothing to show yet". Is that the placeholder you want? 3. Subagents (#31410): the heading says "not idle" instead of "active" because errored subagents stay in the list, and the ones that need the user sort first. Do that wording and order work for you? 4. A row click (#31478) moves focus to the active right panel tab. Do you prefer the Git view switcher instead? ## How to test 1. Open Storybook at `pages/AgentsPage/AgentChatPageView`, stories `OverviewCardBesideTranscript`, `OverviewCardHiddenWhenNarrow`, `OverviewCardHiddenInFullWidth`, and `OverviewCardHiddenByUser`. 2. Run `pnpm exec vitest run --project=unit src/pages/AgentsPage/AgentChatPage/AgentChatPage.test.tsx src/pages/AgentsPage/hooks/useChatOverview.test.ts` in `site/`. The page tests set the chat width with the repo's `MockResizeObserver`. They check that a narrow chat requests none of the card's data, and that **Retry** in the card requests the earlier attachments again. 3. In a dev deployment, open a chat in a window at least 84rem wide. Hide the card with the list button, reload, and check that it stays hidden. ## What to look at first 1. `hooks/useChatOverview.ts`: one `canShow` value gates both the toggle and the card, so the page only renders what the hook returns. The hook measures the chat's outer element with a `ResizeObserver` through `observeChat`, and `OVERVIEW_MIN_CHAT_WIDTH_REM` holds the 84rem value in one place, so the button and the card cannot disagree. 2. `AgentChatPageView.tsx`: the page passes `observeChat` as the chat element's ref and destructures it from the hook result. The React Compiler treats an object that holds a ref callback as a ref, so the page keeps it apart from the other values. 3. `components/ChatOverviewCard.tsx`: this PR adds `ChatOverviewToggle` to the container from #31590. <details> <summary>Review history</summary> The repository's frontend-deep-review ran three rounds on the first version, a clean-context advisor ran once, then one strict code quality review ran, then a polish pass and one final review round ran on the whole stack. Polish pass changes: - Split `ChatOverviewCard.tsx` into the container plus `ChatOverviewToggle`, with the view in `ChatOverviewCardView.tsx` (#31409). The `getOverviewCost` tests moved to `ChatOverviewCard.test.tsx` unchanged. - Added `useChatOverview`, which owns the visibility gate and the open state. - The card builds repository rows with `repoLabel`, the repository's branch, and `countRepoChanges`. Before, it filtered repositories through `computeRepoStats` only to add the clean ones back. - The docs say that you cannot select a clean repository row. Final round fixes: renamed the top bar prop `overview` to `overviewToggle`, inlined the toggle value in the hook, and corrected three doc comments. Follow-up fixes, after the final round: - The card no longer mounts below an 84rem chat. Before, it stayed mounted and CSS hid it, so its queries kept running. The repo has no element-size hook, so `useChatOverview` observes the chat element itself. The `@container/chat` class and the `@min-[84rem]/chat` classes are gone. - The card wires the earlier attachments request into the view, so a failure shows its error and a retry. - New tests: the hook test checks the 84rem boundary on both sides, and two page tests check the narrow chat's requests and the card's retry. Each fails without its fix. The existing page tests now set a 1600px chat width before they look for the card. Their assertions did not change. - The container moved to #31590, because this PR grew past 600 changed lines. GitHub cannot insert a PR in the middle of a stack, so I removed stack #31413 and linked the six PRs again as stack #31591. - Safari: Playwright 1.63.0 downloaded WebKit, but WebKit does not start on this host, because system libraries such as `libsoup-3.0` and `libGLESv2` are missing. I did not check the narrow right panel or the card in WebKit. The `@container/chat` wrapper that the check was about no longer exists. Skipped in the polish pass: passing the card's placement class from the page. That keeps the 84rem breakpoint in one file with the toggle, and moving it adds a pass-through prop. Declined: - The page test checks that the card is gone while the right panel is open (`toBeNull`). That unmount is the behavior under test, and no callback or request captures it. - `@container/chat` traps the right panel's `fixed inset-0` overlay below the `lg` breakpoint. I rendered `NarrowWithSidebarPanel` at 390px and 900px in Chromium, and the panel still covers the viewport. The follow-up fixes removed `@container/chat`. - `try`/`catch` around `localStorage` in `overviewCardStorage.ts`. The file follows `sidebarTabStorage.ts`. - Final round: move `ChatOverviewToggleProps` into the hook. The hook imports only a type from the component file, so no runtime cycle exists. </details> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ --------- Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com> |
||
|
|
17a2b62205 |
feat: add an API to attach templates to chat projects (#30754)
Adds the API for attaching workspace templates to a chat project, on the schema and queries in #32309. A project can attach templates, turn on a limit that restricts its chats to them, and set a default template with either a default preset or default parameter values. Attaching a template never grants access to it: every reader is checked against the template's own sharing. This PR stores and returns `limit_templates`; #32310 enforces it. - The limit is opt-in. `limit_templates` is off unless a request turns it on, which is what every existing project gets. - Templates are attached and detached one at a time with `PUT` and `DELETE /chats/projects/{project}/templates/{template}`, so a caller never replaces a list they can only partly see. Attaching needs project `update` and template `use`. Detaching needs project `update` and template `read`, and a template the caller cannot read is reported as not found. `POST /chats/projects` accepts `template_ids`, `limit_templates`, and `default_template` for the new project. - `PATCH /chats/projects/{project}` sets `limit_templates` and `default_template`, and no longer changes which templates are attached. The default must be an attached template the caller can read, and its preset must belong to the template's active version. Default parameter names and values are checked against that version for templates on the classic parameter flow; dynamic parameters are checked when a workspace is built. Detaching the default template clears the default. - Project responses list only the attached templates the caller can read, as `templates`, and count the rest as `hidden_template_count`. `default_template` is omitted when the caller cannot read it. Deleted, deprecated, and agent-disabled templates are left out and are not counted as hidden. - Editing uses `chat_project:update`, which the project owner and the project `admin` ACL role have. - Attaching and detaching are audited as writes to the project, with the template list before and after, including the templates attached while creating a project. Changes to `limit_templates` and the default template are part of the project's own audit diff. Not included: showing which project members lack access to an attached template, and MCP server attachments. Stack (merge top to bottom): - #32309 - #30754 👈 - #32310 - #30755 - #32371 - #32372 - #30756 - #32373 - #32374 - #32375 - #30898 - #32376 - #32377 - #32378 - #32379 |
||
|
|
7c7e2e73cf |
feat: honor disable-model-invocation in uploaded skill content (#31159)
Addresses @ethanndickson's [review comment on #30882](https://github.com/coder/coder/pull/30882#discussion_r4344815088): the same `SKILL.md` file could be manual-only in Claude Code and the project dialog but automatic in Coder, because the server and the browser each handled `disable-model-invocation` in their own way. The server now owns the key for personal, organization, and project skills: - When a create or update request leaves `model_invocable` unset, `disable-model-invocation: true` in the content turns automatic use off, and `false` turns it back on. The key is read with the function workspace skills use, so a file gets the same setting in both places. Only YAML booleans count, so a quoted `"true"` is ignored. - An explicit `model_invocable` in the request always wins. - New content without the key leaves the setting unchanged, so editing text never turns it back on. - Content is stored as uploaded. Every API response returns content whose key agrees with `model_invocable`: when the stored file says otherwise, the server replaces the value of the key or adds the key before the first one, and leaves every other byte alone. - **Download** and **Export all** save the content the API returns, so the browser no longer edits the file. `withDisabledModelInvocation` is removed. - An upload is rejected with a 400 when the key holds a value the server can't replace with a boolean, such as a list. A later change to `model_invocable` can then always reach the file. Two edges: - Adding the key makes the returned file about 30 bytes larger, so a file at the 64 KB upload limit can be too large to upload again. - A skill stored before the upload check with a value the server can't replace is returned as stored. Workspace skills already honor the key since #31147. #31160, the frontend PR on top of this one, adds the switch to the personal and organization skill editors. > Generated by an agent on behalf of the user --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com> |
||
|
|
d1a58b9f5d |
feat: add script to check for title case (#21484)
Historically, much of the UI used title case. This PR adds a lint check
that reports title case UI text so it can be converted to sentence case,
and converts the existing text.
- `site/scripts/check-sentence-case.mjs` runs as `pnpm
lint:sentence-case` and is part of `pnpm lint`. It reads JSX text and
string/template literals from the TypeScript AST and skips literals that
are code rather than UI text (imports, types, property names, tagged
templates, values of JSX attributes that are not displayed such as
`className` or `style`, and operands of `===`/`case` comparisons). JSX
text across inline elements and conditional JSX is checked as one
phrase. `--fix` lowercases the reported words. The checker is a
heuristic: it is not meant to model every code shape, so use a
`sentence-case-expect` comment where it guesses wrong.
- Proper nouns (Coder products, role names, third-party products,
protocols, font names) live in `PROPER_NOUNS`. For other deliberate
exceptions, a `sentence-case-expect` comment on the line above
suppresses the report and fails when that line no longer needs it.
- Existing UI text is converted to sentence case, and tests that assert
on it are updated.
- Deployment option lookups (`useDeploymentOptions`) now use CLI flags
instead of display names, so they do not depend on UI wording.
## Performance
`pnpm lint:sentence-case` takes **1.6 s** and is 2% to 4.5% of `pnpm
lint`. Measured on
|
||
|
|
935e0b5735 |
fix(site): migrate template filters to FilterCombobox (#31781)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell. Replace the legacy template filter controls with the shared `FilterCombobox` on both the Templates page and AI Settings → Templates, matching the workspace filtering UI. - Combine author, organization, deprecated, and compatibility-mode filters in one input with removable chips while retaining URL-backed filter queries. - Keep `author:me` available to users without permission to list other users, without fetching the user list. - Update the compatibility-mode documentation and Storybook stories for the new controls. <img width="538" height="312" alt="image" src="https://github.com/user-attachments/assets/c7b541eb-0f4e-4456-b31c-70dd85cfe0e9" /> |
||
|
|
e0b74e6817 |
docs: add Migrate to Coder section and Microsoft Dev Box migration guide (#31979)
> [!NOTE] > Coder Agents generated this PR. Adds a "Migrate to Coder" group to the docs sidebar with a short index page, and a guide for teams moving from Microsoft Dev Box to Coder. - `docs/install/plan/migrate.md` (new): says who the guides are for and lists them. - `docs/install/plan/migrate/dev-box.md` (new): who it's for, what carries over, a concept-mapping table, 11 numbered migration steps, and **Learn more**. The steps cover the inventory, the control plane, Entra ID (OIDC), templates on Azure (image, network, persistence, access, quotas), customizations and dotfiles, Git auth and secrets, RDP, editors, schedules and hibernation, Intune, and the pilot and cut-over. Each step links to existing Coder docs instead of repeating them. - `docs/install/plan/migrate/ona.md` (moved from `migrate-from-ona.md`): relative links only, plus a redirect from `install/plan/migrate-from-ona` in `docs/redirects.json`. - `docs/manifest/install/plan/migrate.yml` (new) and `docs/manifest/install/plan.yml`: the new group, with the Ona guide under it. This follows the existing `upgrade.md` plus `upgrade/` layout. `docs/manifest.json` is regenerated. Microsoft retirement dates come from Microsoft's own [Dev Box retirement guide](https://learn.microsoft.com/azure/dev-box/dev-box-retirement-guide): the closing-down period started September 14, 2026, and the service retires September 18, 2028. ### Follow-ups outside this PR - **Starter template is broken today.** The registry `azure-windows` template pins `windows-rdp` at `~> 1.0`, which now resolves to 1.4.0. That version requires `agent_name`, so `terraform plan` fails with `agent_name must be set when enable_native_rdp is true.` The copy in `examples/templates/azure-windows/main.tf` also passes `resource_id = null`, which 1.4.0 rejects at `terraform init`. The guide tells readers to set `agent_name = "main"` until both templates are fixed. - **Activity detection docs.** `docs/workspaces/workspace-scheduling.md` and `docs/templates/managing-templates/schedule.md` say only some session types count as activity, but the code counts any connection through the agent (`agent/agent.go` `Collect`, `coderd/workspacestats/reporter.go`). The guide follows the code. Those pages need a separate fix, and an SME should confirm RDP end to end. - **Comparison page.** The coder.com comparison page compares Coder with Windows 365 and VDI, not Dev Box, and still says Dev Box is in "maintenance mode". The guide no longer links to it, so DOCS-1414's comparison-link item waits until the page is corrected. <details> <summary>Reusable outline for future migration guides (DOCS-1414)</summary> The repo has no place for page templates, so the outline lives here. ```md --- title: Migrate from <Platform> to Coder --- <1 to 2 sentences: who it's for (persona and current setup) and the outcome.> <Optional: dated facts about the platform, citing the vendor's own announcement.> ## Before you begin <Access, licenses (mark Premium), cloud permissions.> ## What carries over <Architecture difference in 2 to 3 sentences. "You can keep" list, then "You rebuild" list.> ## Concept mapping | <Platform> (link to the vendor's docs for each concept) | Coder (link to Coder docs) | ## Step 1: Inventory your <Platform> resources ## Step 2: Deploy the Coder control plane ## Step 3: Connect your identity provider ## Step 4: Replace <environment definition> with templates ## Step N: Bring your devcontainer.json (Codespaces, Ona, DevPod) ## Step N: Configure Git authentication and secrets ## Step N: Set up editors (and remote desktops, if relevant) ## Step N: Speed up workspace startup (prebuilt workspaces) ## Step N: Replace schedules and cost controls ## Step N: Move agent workloads ## Step N: Pilot and cut over <One neutral link to the coder.com comparison page, if one exists and is current.> ## Learn more ``` Rules: facts only, with no scoring or positioning language. Check every mapping row against the vendor's current public docs and record the date checked in the PR. Link to Coder docs rather than repeating them. Mark Premium features inline. </details> ### Verified against Microsoft docs checked November 5 and November 10, 2026, in the MicrosoftDocs/azure-docs source (`articles/dev-box/`) and on learn.microsoft.com: - `dev-box-retirement-guide.md` (dates, workload deletion) - `overview-what-is-microsoft-dev-box.md`, `concept-dev-box-architecture.md` (dev centers, projects, pools, definitions, network connections, Microsoft-hosted network, Intune enrollment, Entra join, Windows 10 and 11 client editions) - `how-to-manage-dev-box-pools.md` (local admin or standard user setting) - `concept-what-are-dev-box-customizations.md`, `how-to-configure-team-customizations.md`, `how-to-configure-user-customizations.md` (WinGet, PowerShell, Git-Clone tasks, Key Vault secrets) - `how-to-configure-azure-compute-gallery.md` - `how-to-configure-stop-schedule.md` (one stop time per pool), `how-to-configure-stop-on-disconnect.md`, `how-to-configure-dev-box-hibernation.md`, `how-to-auto-delete-dev-box.md`, `tutorial-dev-box-limits.md` (maximum dev boxes per developer) - `concept-dev-box-role-based-access-control.md`, `how-to-install-dev-box-cli.md`, `how-to-set-up-dev-tunnels.md`, `quickstart-create-dev-box.md`, `how-to-enable-single-sign-on.md` - Intune [supported operating systems](https://learn.microsoft.com/intune/fundamentals/ref-supported-platforms) (Windows client editions, no Windows Server) Coder side: - Registry `azure-windows` template (`main.tf`, `README.md`) and `examples/templates/azure-windows/`: azurerm resources, Windows Server 2022 image, one resource group, virtual network, and storage account per workspace, VM deleted on stop, persistent `F:` disk, `windows-rdp` module, generated admin password shown in metadata, no Entra join, no `daily_cost` - Registry `windows-rdp` module at `release/coder/windows-rdp/v1.4.0`: **Web RDP** (subdomain app) and **RDP Desktop** (Coder Desktop) apps, `agent_name` validation, Devolutions Gateway install from PowerShell Gallery on every start. Reproduced the plan failure with Terraform 1.17.1. - Registry `dotfiles` module: Bash script only - `cli/dotfiles.go`, `cli/dotfiles_windows.go` (`install.ps1`, `bootstrap.ps1`, `setup.ps1`, run with PowerShell, cloned with Git) - `enterprise/coderd/workspacequota.go` (build denied when consumed plus cost exceeds budget), `docs/admin/users/quotas.md` - `coderd/schedule/autostop.go` (autostop requirement stops at the start of quiet hours), `docs/reference/cli/server/index.md` (`CODER_QUIET_HOURS_DEFAULT_SCHEDULE`, `CODER_ALLOW_CUSTOM_QUIET_HOURS`) - `docs/workspaces/workspace-access/remote-desktops.md`, `docs/admin/networking/index.md` (agents must reach the access URL) - `docs/admin/users/oidc-auth/microsoft.md`, `docs/admin/users/idp-sync.md`, `docs/admin/users/organizations.md`, `docs/admin/users/groups-roles.md`, `docs/templates/template-permissions.md` (Premium markers, organization roles) - `coderd/workspacestats/reporter.go`, `coderd/agentapi/stats.go`, `agent/agent.go` (any connection through the agent extends the autostop deadline) - `docs/admin/external-auth.md` (Azure DevOps via Entra ID), `docs/admin/security/secrets.md` - `agent/usershell/usershell_windows.go` (scripts run with PowerShell on Windows) - No hibernation feature exists in the Coder codebase. Checks run: `make gen/docs-manifest`, `make pre-commit-light` (markdownlint, `lint/emdash`, `lint/docs-redirects`, typos), Vale (0 alerts on the new pages), `lint/docs-html`, `lint/docs-manifest`, `docsredirectscheck -base origin/main -branch main`, a check that all 159 relative links and anchors in the three pages resolve, and a `doc-check` self-review. ### Open questions for the reviewer - **Intune and Entra join:** the guide says Coder doesn't enroll workspaces in Intune, that Intune needs a Windows client image, and links Microsoft's Entra VM sign-in docs. Should a separate guide cover setting up Intune with Coder? - **Windows client editions:** the guide tells readers to check Microsoft licensing before using Windows 10 or 11 images on Azure VMs. It makes no licensing claim itself. - **Windows support in registry modules:** the guide now says the `dotfiles` module is Bash only. Whether `git-clone` and other modules work on Windows is unverified. Closes DOCS-1414, Closes DOCS-1416 Supersedes #31807, reopened under a human author for attribution. --------- Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com> Co-authored-by: Ian Evans <5760366+ianjevans@users.noreply.github.com> |