mirror of
https://github.com/coder/coder.git
synced 2026-11-22 03:18:31 +08:00
dependabot/github_actions/github-actions-fe5f304cd8
3320
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
ed9e9a84ec |
docs: add sandbox agents guide and startup time tips (#32280)
Adds a "Sandbox agents" guide under Extending templates, and adds startup time tips from the [Improving Coder Workspace Startup Times](https://www.youtube.com/watch?v=-xcVJQWVCxs) livestream to the speed-up templates guide. **Sandbox agents** (`docs/templates/extending-templates/sandbox-agents.md`) is organized around three traits: kernel, network, and secrets isolation, plus fast startup. Each trait has a short methods table with tradeoffs, plus examples and references. - Starts with the coder-labs registry templates (agent-sandbox, Plain Sandbox, OpenShell) that implement all three, and calls out [agent-sandbox](https://agent-sandbox.sigs.k8s.io/). - Explains what the sandbox covers for CLI Agents, Coder Agents, and Agent Relay. - Shows how to define sandbox profiles as immutable parameters with one preset each, and how to control which profile an agent gets. - Kernel: gVisor, Kata, and EKS Nitro Sandboxes (`isolated-sandbox` RuntimeClass in EKS Auto Mode). - Network: separate proxy Pod vs. sidecar, example rules using an internal GitHub and artifact store, and a cloud firewall layer (AWS Network Firewall, Route 53 Resolver DNS Firewall) that also limits DNS. - Secrets: `api_key_scope = "no_user_data"`, a scoped AI Gateway token (skipped for prebuilds, optional `lifetime`), per-workspace EKS Pod Identity, and just-in-time credentials from Vault. **Speed up templates** (`docs/workspaces/speed-up-templates.md`) gets new sections for pre-warming Kubernetes nodes (with GKE, EKS, and AKS alternatives), building tools into the image, prebuilt workspaces (including one preset for each configuration), and skipping the Kubernetes rollout wait (with coder-logstream-kube to surface Pods that can't start). It links the [fast-workspaces-lab](https://github.com/coder-contrib/fast-workspaces-lab) repo for the sample base image, node schedule, and prebuild templates. **Agent Firewall** gets a notice on its index page and in the glossary that it is being phased out, pointing to the sandbox guide. The sandbox guide doesn't mention Agent Firewall. Two diagrams in the speed-up templates guide come from the talk's slide deck, cropped to the diagram. Notes for reviewers: - The scoped AI Gateway token (`user:read_personal`) isn't tied to a workspace, so with several organizations, AI Gateway uses the user's effective group for budgets. The page doesn't mention this. - The Nitro (coder/registry#1253) and Cilium (coder/registry#1254) registry templates are still open, so they aren't linked yet. <details> <summary>Decisions and checks</summary> - **Structure:** three traits, several ways to get each, and simple tradeoffs. - **Sysbox** is not listed as kernel isolation, because system calls still reach the node's kernel. - **Deployments** stay the recommendation over bare Pods, because `wait_for_rollout` and coder-logstream-kube cover the startup and error cases. - **Token lifetime** is left commented out in the example: Coder can't revoke the token at stop, and a lifetime shorter than autostop breaks running workspaces. - **Process logging** wording: the eBPF sidecar runs inside the sandbox with gVisor, Kata, or Nitro, so the page asks readers to test it. - **"CLI Agents"** is kept as the term for agents that run fully in the workspace. - **Verified in code:** - `mutable = false` is enforced on later builds (`coderd/dynamicparameters/resolver.go`). - Presets match by subset, also without a `preset_id` (`coderd/database/queries/prebuilds.sql`, `coderd/workspaces.go`). - `no_user_data` blocks the Git SSH key and external auth (`coderd/gitsshkey_test.go`, `coderd/externalauth_test.go`). - Token creation is rejected for the prebuilds system user (`coderd/apikey.go`), and the default token lifetime is 7 days (`codersdk/deployment.go`). - No Coder code sets `CODER_SESSION_TOKEN` in a workspace; registry modules such as `coder-login` do. - **Checks run:** `make lint/emdash`, `make lint/docs-html`, `make lint/docs-manifest`, markdownlint, markdown-table-formatter, Vale (0 errors), and the pre-commit hook. </details> 🤖 This PR was generated by Coder Agents on behalf of @bpmct. |
||
|
|
da64286fe3 |
docs: fix GerundHeading, Semicolons, and UnitSpacing findings (#31990)
Fixes the `warning`-level findings that the Vale findings spike review marked valid: - **`Coder.GerundHeading`**: `docs/.style/styles/Coder/README.md`, "Authoring a new rule" is now "Author a new rule". Nothing links to the old anchor. - **`Coder.Semicolons`**: `templates/extending-templates/docker-in-workspaces.md`. Each semicolon is now a sentence break, with the new sentence on its own line. - **`Coder.UnitSpacing`**: added ` ` between number and unit in `get-started/index.md` (10 minutes), `mcp-server.md` (5 minutes), `ai-governance/ai-gateway/setup.md` (60 days), and `reference/feature-stages.md` (60 seconds). These three rules now have 0 findings in `vale docs/`, and the changed files have no new findings from other rules. --- AI-generated by Superblink on behalf of @nickvigilante. Supersedes #31877, reopened under a human author for attribution. Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> |
||
|
|
3211ca066e |
feat: add organization unpriced AI models endpoint (#31753)
## Description
Adds the experimental `GET
/api/experimental/organizations/{organization}/ai/model-prices/unpriced`
endpoint behind the "N models not set up" warning on the organization AI
spend page
([Figma](https://www.figma.com/design/6TkixpkUIM5Qv6I7qhM3xZ/AI-Gov---user-spend?node-id=70-11964&t=KQwENGjcQvVT9qkh-4)).
It lists the models used in the period that still hold no price in the
organization, using the query from this stack.
## Changes
- Add the `organizationUnpricedAIModels` handler and
`ExperimentalClient.OrganizationUnpricedAIModels`:
- Reuses `aiSpendRetainedPeriod`, since token usage is subject to data
retention.
- Returns the applied period, `count`, and `models` (provider name,
display name, icon and type, model, token count), most unpriced tokens
first.
- Requires read on the organization's model prices (owners and
organization admins), so the UI only requests it for users who can set
prices.
- Add handler tests for the response, period validation, organization
scoping and role access.
Note: pagination will be added in a follow-up.
Closes AIGOV-730
> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
|
||
|
|
1f1aa6ae3c |
feat: add chat project template schema and queries (#32309)
Adds the database layer for attaching workspace templates to chat projects: the schema, the queries, their authorization, and the audit type. Nothing calls the new queries yet, and the existing create and update handlers pass the new parameters unset. The API, the limit's enforcement, and the agent tools follow in the PRs above. - Attachments live in a `chat_project_templates` table (`project_id`, `template_id`, `created_by`, `created_at`), deleted with the project or the template. `chat_projects` gains `limit_templates` (default `false`), `default_template_id`, `default_template_version_preset_id`, and `default_parameters jsonb`. A project stores a default preset or default parameter values, not both. - `InsertChatProjectTemplates` needs project `update` and `use` on every template. It skips templates that are already attached, and templates outside the project's organization, so an attachment never crosses organizations. `DeleteChatProjectTemplate` needs project `update` and template `read`, and clears the project's default when it detaches the default template. Both checks are in dbauthz. - `GetChatProjectTemplatesByProjectIDs` is authorized through the project, and leaves out deleted, deprecated, and agent-disabled templates. It does not check the caller's access to each template, so callers do that before they expose one. - `UpdateChatProjectByID` changes the template settings only when the request sets them, so an update that omits them cannot write back a stale snapshot. - `AuditableChatProjectTemplates` is the audit form of a project's attached templates, logged as a write to the project. The new `chat_projects` columns are tracked in the project's own audit diff, with the default parameter values masked because they may hold credentials. **NOTE**: the migration adds one table and four columns and changes no existing rows. Existing projects keep unlimited template access. Stack (merge top to bottom): - #32309 👈 - #30754 - #32310 - #30755 - #30756 - #30898 |
||
|
|
4866d0fb1f |
feat: add display names to project skill actions (#31747)
closes CODAGT-1506 Project skill action chips show the skill's slug (`deploy-bot`, `security-review`), because skill names must be kebab-case. This adds an optional display name that labels the chip instead. Project skills get a `display_name` column, set through `display_name` on the create and update requests. It is limited to project skills (the same rule as `action`), trimmed, single line, and at most 64 Unicode code points. The chip, its tooltip, and the "More" menu show the display name, sort by it, and fall back to the skill name when it is empty. When a display name is set, the tooltip and the menu item also show the `/name` slash command, so actions that share a display name stay distinguishable. Clicking an action still inserts `/name`, and the `/` menu is unchanged. The project skill editor shows a **Display name** field under **Show as action** only while that switch is on. Turning the switch off hides the field but keeps its value, and saves omit `display_name` while the action is off, so the stored value stays. The display name lives in the database rather than SKILL.md frontmatter, so downloading and re-importing a skill does not carry it. To share the code-point length check with the editor, `countCharacters` and `maxCharacters` move from `ChatProjectDialog.tsx` into `site/src/utils/formUtils.ts`. <img width="637" alt="Project skill editor with the Display name field under Show as action" src="https://raw.githubusercontent.com/coder/coder/assets/pr-skill-action-display-name/pr/edit.png" /> <img width="520" alt="Action chips labeled with display names, with the tooltip open" src="https://raw.githubusercontent.com/coder/coder/assets/pr-skill-action-display-name/pr/chips.png" /> Refs CODAGT-1506 |
||
|
|
4ac8f0a2aa |
docs: document how AI Gateway assigns a request's organization (#31925)
Documents how AI Gateway assigns every request to one organization, and how that organization now decides the effective group, budget, overrides, and spend. Adds a **Request organization** page and corrects pages that still described budget resolution as deployment-wide. Refs AIGOV-753. Describes behavior merged in #30902, #31118, #31119, #31120, #31121, #31583, and #31584. ## Changes - New page `docs/ai-governance/ai-gateway/request-organization.md` (sidebar, after Cost control): resolution order, the effective group fallback, rejected requests, what the organization controls, a multi-org worked example, reports that still resolve across all orgs, and the caveat for standalone gateways older than v2.40. - `cost-controls.md`: removes "the effective group is deployment-wide", scopes overrides and effective group resolution to the request's organization, and adds the reporting caveat. - `standalone.md`: older replicas check budgets across all organizations. - `coder-agents/platform-controls/{index,spend-management}.md`: these said an override beats every group budget, which is no longer true for chats in another organization. ## For reviewers - **Mismatch rejection is not documented.** The ticket and RFC describe rejecting a workspace/chat org mismatch. A chat can only bind a workspace in its own org (`coderd/exp_chats.go`), chatd requests resolve to the chat's org even with a workspace, and no client request can carry both inputs. The page says the two always agree instead. - **"v2.40" is inferred.** `release/2.39` is on aibridged API v1.5 and `main` is on v1.6, so v1.6 ships in v2.40. A 2.39.x backport would make this wrong. - **Custom prices.** The price lookup reads per-org prices, but no API or CLI can set them yet, so the page says custom prices apply in every org. This needs an update when per-org prices ship. - **Site-wide reports.** The avatar menu, Agents usage indicator, `GET /api/v2/users/{user}/ai/spend`, Members tab budget, Groups page combined limit, and `blocked_users` metric still resolve across all orgs (`TODO(AIGOV-527)`), so they can disagree with what was enforced. ## Release note draft ```markdown - AI Gateway budgets and spend follow the request's organization (#31119, #31120, #31121, #31583, #31584) > Every AI Gateway request now belongs to one organization: the workspace's organization for workspace session tokens, the chat's organization for Coder Agents, and otherwise the organization of the user's effective group. Budgets, user overrides, and spend apply within that organization only, instead of across all of the user's organizations. Users in one organization see no change. Users in several organizations can hit a smaller budget, or have no limit at all, in another organization's workspaces and chats. Requests are rejected when the user is no longer a member of the workspace's or chat's organization, or of any organization. > > Migration: Set budgets in every organization your users send AI requests from. Upgrade standalone AI Gateway replicas to v2.40. Older replicas keep checking budgets across all organizations until upgraded. ``` ## Validation `make pre-commit-light`, Vale on the changed files, and `make lint/docs-manifest` pass. A `doc-check` author self-check found 13 blocking findings, all fixed. Not applied: a suggested test pinning the site-wide spend endpoint (code change, out of scope for this docs PR). <details> <summary>Decision log and verified behavior</summary> Sources: AIGOV-753, epic AIGOV-749 and its delivered tickets (AIGOV-712 to 716), the canceled AIGOV-717, and the RFC "AI Gateway Model RBAC and Org-Scoping" (Phase 1). Verified against `main` (`a3aab79775`): | Claim | Evidence | |---|---| | Order: workspace session token, chat org, site-wide effective group | `coderd/aibridgedserver/orgresolver.go` `resolveOrganization` | | Workspace session token = `coder_workspace_owner.session_token` | `provisionerdserver.WorkspaceSessionTokenName`, `workspaceAttribution` (API tokens excluded) | | Rejections return `403 unauthorized` | `coderd/aibridged/http.go` IsAuthorized failure path | | Rejected: deleted workspace, not a member of the workspace/chat org or org deleted, no live org | `orgresolver.go` `ErrUnknownWorkspace`, `ErrUnknownOrganizationMember`, `ErrNoOrganization` | | Chat request takes chat org even with a workspace | `enterprise/aibridged_integration_test.go` "delegated organization with workspace" | | With an org, only that org's groups, override, and Everyone group count | `coderd/aibridge/budget/budget.go`, #31119 | | Fallback with no budgets: default org, then earliest membership | `GetUserEveryoneFallbackGroup` | | Budget counts only spend recorded against its group | `GetUserAISpendSince` keyed on `effective_group_id` | | Notifications use the per-request effective group | `coderd/aibridgedserver/notifications.go` | | Per-org prices not settable | `UpsertOrganizationAIProviderModelConfig` has no non-test caller | | v2.39 gateways: site-wide budget check, no org recorded | `release/2.39` `coderd/aibridged/http.go`, `aibridge/recorder/drpc_recorder.go` | Page vs. section: a dedicated explanation page, because `cost-controls.md` is already long and RFC Phases 3 and 4 (model RBAC, "require organization scope") will build on the same resolution rules. </details> --- *This PR was generated by Coder Agents on behalf of @SasSwart.* |
||
|
|
6e2ff20d00 | docs: document patch release and backport policy (#31993) | ||
|
|
3795d72713 |
fix: search AI Gateway models and clients by substring (#32159)
Closes AIGOV-801 Typing `hai` into the model filter on the AI Gateway sessions page shows the haiku models for a moment, then "No models found". Whilst the debounced request is pending, the menu filters the options it already has by a case-insensitive substring, but `GET /api/v2/ai-gateway/models` only matched a case-sensitive prefix, and Bedrock identifiers start with `anthropic.`. The client filter matched the same way, so it had the same problem. To fix, both endpoints now match a case-insensitive substring. This needed one change to the model menu. When the page loads with a model already in the filter, the menu used to look that model up on the server, by searching for its name and taking the first result. That's the same pattern as the user filter, where the lookup fetches the avatar, but a model option needs nothing from the server, so all it did was check that the model exists. With a substring search, the first result for `claude-3-5-sonnet-20241022` can be `anthropic.claude-3-5-sonnet-20241022-v2:0`, so the check would fail for a model that does exist. The menu now skips the lookup and just shows the model from the filter as selected. The only visible difference is that a model name in the URL that doesn't exist now shows as selected, instead of "All models". The client menu has the same lookup, which still works, as no client name contains another, so I've left it alone. The prefix match was added in #22230 (models) and #22694 (clients) so the queries could use the B-tree indexes. That only works on a C collation database, and only for models, as the clients query wraps the column in `COALESCE`. On an `en_US.utf8` database it's a plain filter either way. On a C collation database a model search with no matches does get slower, from instant to a few seconds with 5M synthetic rows, but I think that's worth it for a search that works. |
||
|
|
0be6e7a034 | feat: add a setting for web terminal font size (#32027) | ||
|
|
b0ae8adab5 |
feat(coderd): protect pending jobs only while the provisioner queue is moving (#32099)
Stops the pending job reaper from failing jobs in a queue that's still moving. This is an alternative to #31469 that came out of Steven's [review](https://github.com/coder/coder/pull/31469#pullrequestreview-5847958482) asking whether 2h is enough, and it builds on George's work there. A pending job past 30m is now only protected while a matching online provisioner is making progress, meaning it finished a job in the last 30m or is running one that's still being updated. A moving queue never gets reaped and a frozen one still does at 30m like today. There's no absolute cap. No migration since it uses the existing `provisioner_jobs_worker_id_organization_id_completed_at_idx`. One tradeoff is that a stuck build whose provisioner keeps heartbeating counts as progress, so if every matching provisioner is stuck like that, the queue waits until that build is canceled. Still a draft so we can talk it through with Spike and Steven. Part of CORE-586 --------- Co-authored-by: George Katsitadze <george.katsitadze@gmail.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
acafa545ad |
feat(site): show cited sources in the message action bar (#32148)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell. Move cited web pages from the separate source-pill row into a compact Sources control in the message action bar, alongside Copy and Attachments. Stacked site icons open a list of cited page titles and hosts, while each search row keeps the pages that search found. Non-HTTP(S) sources remain unlinked. Collect and deduplicate citations across each completed turn so they appear with its final assistant output, including when steps are collapsed. Add regression tests, Storybook coverage, and documentation for the control. <img width="762" height="458" alt="image" src="https://github.com/user-attachments/assets/0bc59d13-6f42-48a6-8c38-46922bbdca50" /> Refs CODAGT-1476. <details> <summary>Review follow-up</summary> Long source titles wrap, non-web URLs remain fully visible, and new-tab links have visual and accessible indicators. Opening Sources focuses the first web link, with dialog fallback when no link exists. The action bar wraps on narrow screens. Attachments and citations share turn splitting, host selection, and completion checks. Folded-block source lookup skips row slicing when a row has no citations. A synthetic 10,000-row helper benchmark improved from 23.9 ms to 5.2 ms (median); this is not an end-to-end rendering measurement. </details> |
||
|
|
96e91a4d6a | chore(docs): update release docs for v2.37.14 (#32250) | ||
|
|
0d53f090d0 | chore(docs): update release docs for v2.34.21 (#32249) | ||
|
|
75e2519022 | chore(docs): update release docs for v2.39.4 (#32246) | ||
|
|
5645e68015 | chore(docs): update release docs for v2.38.10 (#32247) | ||
|
|
e45fe9d8dc |
chore(docs): update release docs for v2.29.29 (#32248)
Automated docs update for v2.29.29 release. Created by `releasetui`. |
||
|
|
6f169d86a9 |
chore(docs): update release docs for v2.29.28 (#32234)
Automated docs update for v2.29.28 release. Created by `releasetui`. |
||
|
|
a921700974 | ci: report only wrong, missing, and broken findings in CI doc-check reviews (#32199) | ||
|
|
1baff57cb0 |
fix: resolve docs and code conflicts found in the main docs audit (#32158)
## Summary Addresses 106 of the 113 conflicts between the docs and the code that the November audit of `main` found: 102 are fixed and 4 have an interim docs fix. Every finding was re-checked against the code before it was fixed. Most fixes are docs-only. Three are small code fixes where the docs described the intended behavior and the code was wrong, each in its own commits so it can be split out. No change in this PR alters template build or agent behavior. ## Changes Fixes by area (finding counts): templates 28, install 13, integrations and monitoring 13, auth and security 12, networking 11, Coder Agents 9, AI governance 7, reference 7, workspaces 6. Code fixes. Each needs a look from the code owner. If an owner prefers not to take one, drop its commits and I will change the docs to describe the current behavior instead. | Commits | Change | Risk to check | |---------|--------|---------------| | `fix: keep built-in listener defaults in packaged coder.env`, and three follow-up commits | `coder.env` comments out `CODER_HTTP_ADDRESS=` and the three `CODER_TLS_*` lines, so an untouched package install listens on `127.0.0.1:3000` as the docs say. Only the `CODER_HTTP_ADDRESS=` line changed behavior. The TLS options default to empty, so commenting them out is for consistency. The Lima examples rewrite the commented line and fail if the line is not found. A test compares every option that the file sets against the built-in defaults. | The deb and RPM packages were not built or installed. Every released package through v2.39.0 ships the empty line, and upgrades keep an existing file (`config\|noreplace`), so the upgrade pages now say how to fix it. | | `fix(cli/clilog): accept log sinks that are all disabled`, and three follow-up commits | `--log-human=/dev/null` with no other log location no longer fails with "no loggers provided". It is the documented way to disable logging. An empty location still fails with that error when no other sink is set, as before. | Behavior change: with `/dev/null`, the server and the provisioner daemon can start with no log output. | | `fix(cli): detect CODER_PROC_PRIO_MGMT by presence`, and a comment follow-up | Log line only. With the variable set to an empty value, the agent now logs that process priority management is enabled, which is what `agentexec` already does. No detection or behavior change. | Low. | Two option descriptions in `codersdk/deployment.go` are corrected, with the CLI reference, configuration reference, and golden files regenerated: the default quiet hours schedule (the max deadline is the quiet hours window on the next day that the template's autostop requirement applies) and `--experiments` (`*` opts in to the experiments marked safe, also in `enterprise/cli/provisionerdaemonstart.go`). ### Code fixes that were reverted after review Two code fixes from the first version of this PR are reverted in the branch. The net diff has no change under `agent/` or `coderd/`. The docs now describe what the code does, and both issues stay open for the owner. - **`error` merge strategy for `coder_env` (DOCS-1669).** The fix made `merge_strategy = "error"` fail whenever a name was set twice, whatever the resource order. Existing template versions that pair an `error` entry with a later `replace` or `append` entry would start to fail every build after `terraform apply`. That is a breaking change that needs its own PR and release note. The fix and its tests are in `dff8e7c6ce` and can be cherry-picked. `environment-variables.md` now says the check runs only when the `error` resource is processed. - **Nice value before the capability drop (DOCS-1687).** The fix let `coder agent-exec` apply a negative nice value by calling `setpriority` before it drops effective capabilities. The current order is deliberate: with the fix, any local process could run the agent binary with `--coder-nice=-20` when the binary has the `CAP_SYS_NICE` file capability. `process-priority.md` now says a nice value below the agent's own is not applied, and no longer tells admins to grant `CAP_SYS_NICE`. ## Not included Seven findings are left out. - DOCS-1629: covered by #31639. - DOCS-1703 and DOCS-1724: covered by #31980. - DOCS-1584, DOCS-1683, DOCS-1685, DOCS-1686: each needs an owner decision, and no neutral docs wording exists until that decision is made. The validation comment on each issue names the decision. Four fixes are interim, so their issues stay open: - DOCS-1600: the AI Gateway pages now agree that the legacy metric names are deprecated and "will be removed in a future release". The code still emits them, and its TODO names v2.37, which has shipped. The owner still needs to set the removal release. - DOCS-1689: the page now says **New Template** opens the builder only for users with the Owner role, because the page gates on read access to the deployment config. Whether Template Admins should get the builder is still open. - DOCS-1669 and DOCS-1687: docs-only for now. Refer to [Code fixes that were reverted after review](#code-fixes-that-were-reverted-after-review). ## Review notes - Claims that describe product intent and need an owner's yes: the Premium qualifier on per-organization workspace sharing (the API route has no license check, the dashboard needs multiple organizations), `organization` port sharing in OSS, the telemetry field list, and the `1-5` cron range in the prebuilds schedule example. - Not run end to end: the PostgreSQL TLS procedure on a cluster, the OpenShift and air-gapped examples, the BSD `date` and `tar` forms on macOS, the Windows command on the multiple Kubernetes clusters page, and the keep-alive script in `docs/reference/index.md` (only its comparison logic was run, against sample values). Nothing was checked on a live deployment. - Likely merge conflicts with open PRs: #31990 (`mcp-server.md`, `feature-stages.md`, `docker-in-workspaces.md`), #31982 (`workspace-management.md`), #31980 (`health-check.md`), #31977 (`manage-provisioner-jobs.md`), #31869 (`airgap.md`), #30486 (`add-envbuilder.md`), and #31326 and #31531 (`codersdk/deployment.go` and generated files). ## Testing - `make pre-commit` (gen, fmt, lint, slim build), before the PR opened and again after the review changes. - `go test` for `./cli/clilog/...`, `./codersdk/`, `./cli/` (`TestServer`, `TestAgent`, and golden files), and `./enterprise/cli/` (provisioner, server, and help golden files). `./agent/agentexec/...` and `./coderd/provisionerdserver/...` pass after the reverts. Linux only. CI covers macOS and Windows. - The `coder.env` test fails against the file on `main` and passes against the new one. It reads the file with `godotenv`, which accepts CRLF line endings. - An empty `CODER_HTTP_ADDRESS=` was confirmed end to end with a full build of the server (output below). - The new `sed` and `grep` lines in the Lima examples were run with GNU tools against the old and the new form of `coder.env`. The Lima VMs were not started. - `--log-human=/dev/null` and `CODER_LOGGING_HUMAN=` were confirmed with the same build (output below). - `coder agent-exec --coder-nice=-5 -- echo` from a full build, as a non-root user: `coder-agent: failed to adjust niceness to -5 ...: permission denied` on stderr, the command output on stdout, exit code 0. - `postgres-ssl.md` rendered with the GitHub Markdown API: two ordered lists with three and five items, where `main` has six lists. - markdownlint, the table formatter, `make lint/emdash`, `make lint/docs-html`, `make lint/docs-manifest`, `make lint/docs-redirects`, `make lint/style-claims`, and Vale on the changed lines. - A doc-check self-review of the docs diff by four independent reviewers. It found six problems, which are fixed. The accuracy and coverage lenses ran on every area. The language and structure lenses ran in full on only part of the diff. <details> <summary>Test and terminal output for the code fixes (Linux)</summary> ```console $ go test ./codersdk/ -run TestPackagedCoderEnvKeepsDefaults -count=1 -v --- PASS: TestPackagedCoderEnvKeepsDefaults (0.00s) ok github.com/coder/coder/v2/codersdk 0.071s $ go test ./cli/clilog/ -run TestBuilder -count=1 -v --- PASS: TestBuilder (0.00s) --- PASS: TestBuilder/NoSinks (0.00s) --- PASS: TestBuilder/NoSinks/JSONDevNull (0.00s) --- PASS: TestBuilder/NoSinks/StackdriverDevNull (0.00s) --- PASS: TestBuilder/NoSinks/NoConfiguration (0.00s) --- PASS: TestBuilder/NoSinks/HumanDevNull (0.00s) --- PASS: TestBuilder/WithHuman (0.00s) --- PASS: TestBuilder/WithFilter (0.00s) --- PASS: TestBuilder/WithJSON (0.00s) --- PASS: TestBuilder/Verbose (0.00s) --- PASS: TestBuilder/FromDeploymentValues (0.01s) --- PASS: TestBuilder/FromDeploymentValues/Defaults (0.00s) --- PASS: TestBuilder/FromDeploymentValues/EmptyHumanEnv (0.00s) --- PASS: TestBuilder/FromDeploymentValues/Override (0.00s) ok github.com/coder/coder/v2/cli/clilog 0.171s $ TMPDIR=$HOME/.cache/agentexec-tmp go test ./agent/agentexec/... ./coderd/provisionerdserver/... -count=1 ok github.com/coder/coder/v2/agent/agentexec 4.236s ok github.com/coder/coder/v2/coderd/provisionerdserver 2.404s # Full build of the server (go build ./cmd/coder). An empty value stops it before it connects to the database. $ CODER_HTTP_ADDRESS= coder server --postgres-url 'postgres://127.0.0.1:1/x?sslmode=disable' Encountered an error running "coder server", see "coder server --help" for more information error: TLS is disabled. Enable with --tls-enable or specify a HTTP address # With the variable unset, the server passes that check and goes on to the database. $ coder server --postgres-url 'postgres://127.0.0.1:1/x?sslmode=disable' 2026-11-13 02:19:41.901 [warn] ping postgres: retrying error="dial tcp 127.0.0.1:1: connect: connection refused" try=11 Encountered an error running "coder server", see "coder server --help" for more information error: connect to postgres: connect to postgres: unable to connect after 11 tries; last error: dial tcp 127.0.0.1:1: connect: connection refused # An empty log location with no other sink still stops the server. $ CODER_LOGGING_HUMAN= coder server --postgres-url 'postgres://127.0.0.1:1/x?sslmode=disable' Encountered an error running "coder server", see "coder server --help" for more information error: make logger: no loggers provided, use /dev/null to disable logging # /dev/null passes the logger check. The server prints no log lines and goes on to the database. $ coder server --log-human=/dev/null --postgres-url 'postgres://127.0.0.1:1/x?sslmode=disable' Encountered an error running "coder server", see "coder server --help" for more information error: connect to postgres: connect to postgres: unable to connect after 11 tries; last error: dial tcp 127.0.0.1:1: connect: connection refused ``` </details> ## Linear Fixes DOCS-1583, DOCS-1585, DOCS-1586, DOCS-1587, DOCS-1588, DOCS-1589, DOCS-1590, DOCS-1591, DOCS-1592, DOCS-1593, DOCS-1594, DOCS-1595, DOCS-1596, DOCS-1597, DOCS-1598, DOCS-1599, DOCS-1601, DOCS-1602, DOCS-1603, DOCS-1604, DOCS-1605, DOCS-1606, DOCS-1607, DOCS-1608, DOCS-1609, DOCS-1614, DOCS-1618, DOCS-1619, DOCS-1620, DOCS-1624, DOCS-1635, DOCS-1639, DOCS-1644, DOCS-1651, DOCS-1652, DOCS-1653, DOCS-1654, DOCS-1655, DOCS-1656, DOCS-1657, DOCS-1658, DOCS-1659, DOCS-1660, DOCS-1661, DOCS-1662, DOCS-1663, DOCS-1664, DOCS-1665, DOCS-1666, DOCS-1667, DOCS-1668, DOCS-1670, DOCS-1671, DOCS-1672, DOCS-1673, DOCS-1674, DOCS-1675, DOCS-1676, DOCS-1677, DOCS-1678, DOCS-1679, DOCS-1680, DOCS-1681, DOCS-1682, DOCS-1684, DOCS-1688, DOCS-1690, DOCS-1691, DOCS-1692, DOCS-1693, DOCS-1694, DOCS-1695, DOCS-1696, DOCS-1697, DOCS-1698, DOCS-1699, DOCS-1700, DOCS-1701, DOCS-1702, DOCS-1704, DOCS-1705, DOCS-1706, DOCS-1707, DOCS-1708, DOCS-1709, DOCS-1710, DOCS-1711, DOCS-1712, DOCS-1713, DOCS-1714, DOCS-1715, DOCS-1716, DOCS-1717, DOCS-1718, DOCS-1719, DOCS-1720, DOCS-1721, DOCS-1722, DOCS-1723, DOCS-1725, DOCS-1726, DOCS-1727 Part of DOCS-1600, DOCS-1689, DOCS-1669, DOCS-1687 <details> <summary>Decision log</summary> ### Scope - One PR for all findings, as agreed with the reviewer. The code fixes are separate commits so an owner can ask for any of them to move to its own PR. Nothing in the PR is a breaking change, so the title has no `!`. - A finding was skipped only when an open PR already covers it, or when every available wording would assert an undecided product behavior. - Each validation comment on the Linear issues records the evidence, the corrections to the original finding, and what was not verified. ### Docs or code - The default was a docs-only fix that describes what the code does. - A code fix was chosen when the docs describe a behavior the code plainly intended and the code change is small and testable: the packaged env file, the log sink check, and the log line for the environment variable presence check. - The `error` merge strategy and the nice value ordering started as code fixes and went back to docs-only after review. The first breaks existing template versions. The second weakens a deliberate security ordering. - The SCIM `userName` finding (DOCS-1609) took the docs path. The handler is unchanged. ### Wording choices worth a second look - `feature-stages.md` says `--experiments=*` enables only the experiments marked safe, and points to the "Get safe experiments" API. It does not list the other experiments, because the list would drift and those experiments are hidden on purpose. The `--experiments` flag help now says the same. - `agent-metadata.md` replaces the writes-per-second formula with a description of the batcher (each server replica writes one statement every 5 seconds, or sooner at 500 entries). - `extending-templates/index.md` no longer calls `startup_script` deprecated. The provider documents it as an alias for a `coder_script`. - `postgres-ssl.md` separates client verification from server verification, so the server verification steps work alone. - `rpm.md`, `upgrade.md`, and the 2.29 to 2.34 ESR upgrade page explain the empty `CODER_HTTP_ADDRESS=` line that older packages shipped, because upgrades keep the old file. The behavior changed in v2.34.0 with the serpent upgrade in #24926. - The keep-alive script in `docs/reference/index.md` reads the current deadline and skips the request when it is already later. The comparison is on text, so it applies only when the API returns a UTC timestamp, which needs the database to use the UTC time zone. Otherwise the script sets the deadline on every pass, as it did before, and the page says so. - `external-auth.md` anchors the new GitHub Enterprise regex example. The older unanchored examples on that page and on `git-providers.md` are not changed here. ### Self-review findings that were rejected - "The builder opens for Template Admins": the Templates page needs a successful deployment config read, which the Template Admin role does not have. - "Organization Admins can set AI model prices": the price write authorizes against a site-level object, which organization-scoped grants do not match. - "The provisioner chart sets no default resources": `helm/libcoder/templates/_coder.yaml` applies 2000m and 4096Mi when `coder.resources` is empty. ### Automated review, round 1 The `coder-agents-review` app left 45 findings on `8853332`. Fixed: the two reverts above, the anchored regex, the `coder.env` follow-ups (Lima examples, upgrade notes, a comment in the file, and a test that covers every option in the file), the clilog change, the two option descriptions, and the docs findings (CORS behavior, token lifetime example, keep-alive script, agent metadata, refresh token errors, `switch` form type, `dbcrypt` skip list, and a stray line in a YAML example). Declined, with the reason on each thread: - Refactoring the `agentexec` logging and renaming its log field: not related to a docs conflict. - Rewording the "process priority management not enabled (linux-only)" log message: the docs quote the message, and the wording predates this PR. - Problems in code and docs that this PR does not change (the `Capabilities` subtest, the Helm values comment, the AWS provider path in `airgap.md`, and others in the review's out-of-scope list). ### Automated review, round 2 The app left 14 new findings on `04925bd`, and accepted the three declined threads on `cli/agent.go`. All 14 are fixed. The main one: the round 1 change that removed the "no loggers provided" error went too far, because an empty log location would then start a server with no logs. The error is back for every case except `/dev/null`. Reported by the app as out of scope and not changed: the swagger annotation for `GET /api/v2/experiments/available` declares an array, but the handler returns an object with a `safe` array. Three Storybook fixtures keep the old `--experiments` description. ### Automated review, round 3 The app confirmed that all round 2 findings are fixed, and left 10 small findings on `f55cb6d` (8 P4, 2 Nit). All are fixed: the TLS condition and the release range in the `coder.env` notes, one place for the `/dev/null` rule in `clilog`, two test cases, a clearer test failure, and the CPU example in `agent-metadata.md`. ### Automated review, rounds 4 and 5 Round 4 left one P4 on `8fffb38` (name the `--trace` option in the logging note), which is fixed. Round 5 on `2ce754e` reports no new findings and says every earlier finding is fixed or closed. The app did not post an approval: it leaves its out-of-scope items and the code fixes to a human reviewer. Two threads on `cli/agent.go` stay open on purpose for the code owner. ### Doc-check review The doc-check workflow left 12 comments on `2ce754e` (10 blocking, 2 suggestions). All are fixed in `c888885`: "refer to" or "visit" in place of "see" for cross-references on the lines this PR added, the **New template** label as the dashboard shows it, one instruction per step in the server verification procedure of `postgres-ssl.md`, and two wording changes in `process-priority.md`. The `CAP_SYS_NICE` sentence keeps a short reason, which differs from the suggested text. The `coder-agents-review` app then reviewed that commit (rounds 6 and 7). Round 6 left two P4 findings, fixed in `30b2c79`: the `failed to adjust niceness` message is described once, in the troubleshooting entry, with where it appears, and the client verification steps in `postgres-ssl.md` render as one numbered list. Round 7 reports no new findings. `2a6035c` then softens one sentence from that fix, because the agent logs the stderr of devcontainer CLI commands. The app was not run again on that commit. ### Adjacent gaps found and not fixed here - `add-envbuilder.md` has the same `zip` command that `template-from-scratch.md` had. - `template-from-scratch.md` leaves the reader in `build/` after `cd $_`, before a step that runs from `template-tour`. </details> --- _Generated by Coder Agents on behalf of @nickvigilante._ --------- Co-authored-by: Ben Potter <me@bpmct.net> |
||
|
|
bd268cb28d |
feat: add output formats to coder organizations members edit-roles (#30145)
Uses the `cliui` output helpers from #30508. `coder organizations members edit-roles` printed only `Member roles updated to [...]`, while `members list` supports `-o table|json` and `-c`. It now accepts `-o text|table|json` and `-c`. Table and JSON show the updated member using the `members list` row type and columns. **Behavior change:** Additive. Default text output is unchanged. The command now fetches the member after updating roles, on every invocation; if that read fails, it exits with an error even though the roles were already updated. <details> <summary>Decisions</summary> - The update endpoint doesn't return user data, so the member is re-read to build the table and JSON rows. </details> Closes [CLI-27](https://linear.app/codercom/issue/CLI-27) _This PR was generated by Coder Agents on behalf of @nickvigilante._ |
||
|
|
32e1f2502f |
feat: add JSON output to coder tokens create (#30135)
Uses the `cliui` output helpers from #30508. `coder tokens create` printed only the new token's secret, so scripts had to call `tokens view` afterwards to get the token's ID, expiry, and scopes. This adds `-o/--output` with `text` (default) and `json`. The JSON document contains the token's metadata from `APIKeyByID` plus the one-time `key`. **Behavior change:** Additive. The default output is still just the secret, so `$(coder tokens create ...)` keeps working. The command now makes one extra API call after creating the token; if it fails, the command prints a warning to stderr and still outputs the secret rather than exiting with an error. <details> <summary>Decisions</summary> - The metadata lookup uses the key ID parsed from the `<id>-<secret>` token, the same convention `tokens view` and `tokens remove` use. - A failed metadata lookup never fails the command, because the token already exists and the secret can't be shown again. </details> Closes [CLI-14](https://linear.app/codercom/issue/CLI-14) _This PR was generated by Coder Agents on behalf of @nickvigilante._ |
||
|
|
872105c4bb |
fix: bump bundled terraform to 1.17.2 (#32110)
Bumps the bundled Terraform from 1.17.1 to [1.17.2](https://github.com/hashicorp/terraform/releases/tag/v1.17.2) (released 2026-11-11). 1.17.2 pins `klauspost/compress` v1.20.2, which contains the fix for [GHSA-fpmh-frq8-7rj8](https://github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8) / [GO-2026-6865](https://pkg.go.dev/vuln/GO-2026-6865) (panic in the zstd decoder on a crafted frame). 1.17.1 pins v1.19.1. Iron Bank reports GO-2026-6865 against `/opt/terraform/terraform` in `coder/coder-enterprise/coder-service-2:2.38.7` (High). The Iron Bank image takes its Terraform from the version coder bundles, so this bump is how that finding goes away. This is a patch bump, so `maxTerraformVersion` stays at 1.17.9. It does not change the Go toolchain Terraform is built with (still go1.26.10) or its `go-getter` pin (still v1.8.6). ## Changes Same file set as #30516: - `provisioner/terraform/install.go`: `TerraformVersion` - `install.sh`, `scripts/Dockerfile.base` - `mise.toml`, `mise.lock` (checksums from HashiCorp's `terraform_1.17.2_SHA256SUMS`) - `flake.nix` (fetchurl SRI hashes derived from the same SHA256SUMS) - `docs/install/prepare/airgap.md` - `provisioner/terraform/testdata/generation.sha1`: fixture fingerprint, regenerated with `generate.sh --if-needed`. No plan or state fixture changed. I checked the checksum conversion first by deriving the 1.17.1 values from `terraform_1.17.1_SHA256SUMS`; it reproduces every value currently in `flake.nix` and `mise.lock`. ## Verification ``` $ mise install terraform # mise.lock checksums verified against the download $ mise exec -- terraform version Terraform v1.17.2 on linux_amd64 $ ./provisioner/terraform/testdata/generate.sh --if-needed only generation.sha1 changed $ go test ./provisioner/terraform/ -run 'TestInstall|Version|Golden' -count=1 ok github.com/coder/coder/v2/provisioner/terraform (75 tests passed, 0 failed) ``` `flake.nix` was not evaluated with Nix; its hashes come from the same SHA256SUMS as `mise.lock`. ## AI disclosure Prepared with an AI coding agent on behalf of @droopy4096. The agent ran the verification above; a human review is still needed before merge. |
||
|
|
54fe847c6f |
chore: remove references to torn-down dev.coder.com instance (#31702)
The `dev.coder.com` instance has been torn down and now only redirects to another instance. Nothing in the repo calls it. Every reference was a test fixture, mock, story, Helm test input, docs example, or comment. Replace all occurrences with `coder.example.com` and update the comments that claimed the mocks were fetched from that instance. The Helm golden files were updated to match their inputs. Closes DOG-43 https://linear.app/codercom/issue/DOG-43/scan-codercoder-repo-for-remaining-references-to-devcodercom-and |
||
|
|
4f6a56427e |
feat: report pubsub health from the pubsub backend (#31621)
Fills in the `pubsub` section of the deployment health report on the server. Stacked on #31620. - New `pubsub.ReportingPubsub` interface: `Pubsub` plus `HealthReport(ctx) healthsdk.PubsubReport`. The `Pubsub` interface itself is unchanged. - The PostgreSQL, NATS and in-memory backends implement it. Each reports its backend name (`postgres`, `nats` or `memory`) and its connection state: - **PostgreSQL:** tracks the `pq` listener's connected state from its event callback. When it's not connected, the report has severity `warning` and `EPS01`. - **NATS:** warns with `EPS02` if the embedded server isn't `Running()`, and with `EPS01` for each publish or subscribe connection whose `Status()` isn't `CONNECTED`. - **In-memory:** always `ok`. - `coderd.Options.Pubsub` is now a `ReportingPubsub`. `ReplicaSyncPubsub` stays a plain `Pubsub`. - `coderd/healthcheck` has a new `Pubsub` check, which counts toward `healthy` and the overall severity like the other sections. `formatHealthcheck` applies the dismissed setting for it. - New health codes `EPS01` (not connected) and `EPS02` (embedded NATS server not running), documented in `docs/admin/monitoring/health-check.md`. - Test helpers follow the type change: `coderdtest.Options.Pubsub` and the pubsub returned by `dbtestutil.NewDB` are now `ReportingPubsub`, and a few test wrappers embed `ReportingPubsub` instead of `Pubsub`. <details> <summary>Decision log</summary> - `HealthReport` returns a `healthsdk.PubsubReport` rather than filling one in place. This matches the `healthcheck.Checker` methods. `ctx` is unused for now. - The healthcheck layer sets `Dismissed`, so backends don't need to know about health settings. - Problems are reported as warnings, not errors, so they show on the health page without marking the deployment unhealthy. Both backends reconnect on their own. - Postgres connection state comes from the listener event callback, not from `pq.Listener.Ping`, so the health check doesn't do database I/O. Closing the pubsub also marks it disconnected. - NATS `conn` gains `Status()`, which `*natsgo.Conn` already implements. The pools are immutable after construction, so `HealthReport` reads them without locking. - The docs say the pubsub section appears in the JSON response, because the health UI doesn't show it until a later PR in this stack. - psmock is not regenerated: none of its users pass it to coderd. </details> --- Generated by Coder Agents on behalf of @spikecurtis. |
||
|
|
2187ecd37e |
feat: add PubsubReport to healthsdk HealthcheckReport (#31620)
Adds pubsub to the deployment health report types in `healthsdk`:
- New top-level `pubsub` section (`PubsubReport`) in
`HealthcheckReport`. It embeds `BaseReport` and adds one field,
`backend` (string).
- New `HealthSectionPubsub` constant, added to `HealthSections` so the
section can be dismissed.
- `HealthcheckReport.Summarize` includes pubsub errors and warnings,
which `coder support bundle` prints.
This is the first PR in a stack for GRU-100. It only changes the SDK and
the files generated from it (Swagger, API docs, `typesGenerated.ts`),
plus the two frontend health mocks that need the new required field. The
server does not fill in this section yet. That comes in a follow-up PR.
<details>
<summary>Plan</summary>
- Add `PubsubReport { BaseReport; Backend string }` to
`codersdk/healthsdk`.
- Add `Pubsub PubsubReport \`json:"pubsub"\`` to `HealthcheckReport`.
- Add `HealthSectionPubsub` and include it in `HealthSections`.
- Include `Pubsub` in `HealthcheckReport.Summarize`, with test coverage.
- Regenerate TS types, Swagger and API docs.
- Follow-up PRs: populate the report in `coderd/healthcheck` (including
severity and dismissal handling) and update the health UI.
</details>
---
Generated by Coder Agents on behalf of @spikecurtis.
|
||
|
|
38e74c4506 |
feat: add agent-plugins experiment and Agent API v2.17 plugin messages (#29320)
Linear: [CODAGT-1101](https://linear.app/codercom/issue/CODAGT-1101/agent-plugins-read-only-support-behind-the-agent-plugins-experiment) **tl;dr:** Adds the `agent-plugins` experiment and the Agent API v2.17 messages that carry Agent Plugins data from the agent to coderd. First of eight stacked PRs adding read-only [Agent Plugins](https://agent-plugins.org/) v1.0.0 support. A plugin is a directory with a `plugin.json` manifest, skills under `skills/`, and an optional `mcp.json`. Across the stack, the agent discovers plugins in `plugins/` and `.agents/plugins/` under its scan roots (for example `~/.coder/plugins/<name>`), chatd lists their skills with plugin attribution, the agent runs the MCP servers of plugins in the workspace working directory, and the Agents page shows plugin attribution in the chat context. Hooks, commands, agents, install flows, and org-managed plugins are out of scope. Background: [research/agent-plugins-standard.md](https://github.com/coder/scott-misc/blob/main/research/agent-plugins-standard.md) (internal). This PR adds `codersdk.ExperimentAgentPlugins` and a `PluginBody` oneof variant on `ContextResource` (tag 18) that carries the validated manifest fields and nests the plugin's skills and MCP servers. `Manifest` gains `agent_plugins_enabled` (field 23), which coderd sets when the experiment is enabled; the agent discovers plugins only then. coderd stores each nested resource as its own row with the plugin's name in a new `plugin_name` column (migration 000642), which the hydrate, MCP sync, and re-pin queries copy. With the experiment off, `PushContextState` drops plugin resources and everything nested in them. Otherwise it rejects pushes with plugin names that fail `workspacesdk.ValidatePluginName` (the spec's name grammar, shared by agent and coderd), OK plugins without a name or with a duplicate name, a non-OK plugin that nests resources, nested entries of the wrong kind, plugin skill sources outside `<plugin source>/skills/`, and plugin MCP servers with an empty `server_name` or a source other than `<plugin name>/<server_name>`. Nested resources count toward the 1000-resource cap. Agents now dial v2.17, so a new agent needs a coderd that supports it, as with every Agent API minor. Turning the experiment off does not remove plugin data already pinned to existing chats. <!-- pr-map:start --> <details><summary>PR map</summary> `main..4b0cfc9657` | Category | Files | + | - | |---|---:|---:|---:| | prod (backend) | 15 | 342 | 78 | | test (backend) | 9 | 534 | 3 | | migrations | 2 | 14 | 0 | | generated (backend) | 7 | 1216 | 1027 | | generated (frontend) | 1 | 2 | 0 | | **Total** | 34 | 2108 | 1108 | 1. `coderd/agentapi/context.go` (+211/-51, API): drops plugin resources when the experiment is off; otherwise validates plugin names and nesting, and stores each nested skill and MCP server as its own row with the plugin's name. 2. `agent/proto/agent.proto` (+39/-9, API): `PluginBody` with nested `skills` and `mcp_servers`, and `Manifest.agent_plugins_enabled`. 3. `codersdk/workspacesdk/frontmatter.go` (+31/-0): `ValidatePluginName` and `MaxPluginNameLength` (manifest name grammar). 4. `coderd/database/queries/chats.sql`, `workspaceagentcontext.sql`, migration 000642 (+28/-7, DB): the `plugin_name` column on both context resource tables, copied by the hydrate, MCP sync, and re-pin queries. 5. `codersdk/agentsdk/agentsdk.go`, `agent/agent.go` (+18/-4, API): `Manifest.AgentPluginsEnabled` and `ConnectRPC217WithRole`; the agent dials v2.17. 6. `coderd/agentapi/api.go`, `manifest.go` (+4): the manifest flag follows the experiment. 7. `tailnet/proto/version.go` (+8/-1, API): Agent API v2.17. 8. `codersdk/deployment.go` (+4, API): the `agent-plugins` experiment. </details> <!-- pr-map:end --> --- This PR was generated by Coder Agents on behalf of @jscottmiller. Co-authored-by: Garrett Delfosse <delfossegarrett@gmail.com> |
||
|
|
d639ced1e0 |
fix: send only changed chat history over the stream (#29662)
A client could resume the chat stream only with after_id, a message ID. A message ID does not identify what a client has received. A reconnect could skip a message that another client sent, send no history_reset for an edit the client missed, or resend the whole history. A client can now resume with the chat's snapshot_version, which the newest messages page returns and the stream's events then include. The stream sends what changed at that version or later. For an edit it sends the ID of the edited message and the messages written since, not the whole history. A stream opened without snapshot_version sends the same events as before. A write outside a chat state transition does not increase snapshot_version, and a stream can miss it. The queries that only tests used for such writes are removed. When the stream cannot be set up, the server now returns 500 before the WebSocket upgrade. It used to upgrade and send an error event, which the web client shows as a chat error. The Tasks to Chats migration guide told clients to reconnect with after_id. It now describes snapshot_version. |
||
|
|
30abd0593c |
feat: add organization AI spend overview endpoint (#31709)
## Description
Adds the experimental `GET
/api/experimental/organizations/{organization}/ai/spend` endpoint that
backs the new Overview tab of the organization AI spend page ([Figma
design](https://www.figma.com/design/6TkixpkUIM5Qv6I7qhM3xZ/AI-Gov---user-spend?node-id=12-5152&t=YlCC7RGSMNrzMxVo-4)).
It returns the organization's spend summary, daily spend, and a page of
users with their per-group spend, using the queries from #31711.
## Changes
- Add the `organizationAISpend` handler and
`ExperimentalClient.OrganizationAISpend`:
- Reuses the period handling of `/ai/spend/users`: `period_start` and
`period_end` must be provided together and span at most 31 days, and the
default is the current budget period.
- Also requires both bounds at 00:00:00 UTC, since the daily spend
aggregate holds whole UTC days.
- Is not limited by the AI Gateway data retention window, since the
daily spend aggregate is not purged. `/ai/spend/users` and the export
keep the retention check, now in `aiSpendRetainedPeriod`.
- Returns `count`, `totals` (`spend_micros`, `median_spend_micros`),
`intervals` (daily spend, one interval per UTC day, zeros included), and
`users` (paginated with `limit`/`offset`, most spend first, with
per-group spend).
- Echoes the applied period, and reads every value in one read-only
repeatable-read transaction so the values agree.
- Extract `parseOrganizationAISpendPage`, shared with `/ai/spend/users`.
- Add handler tests.
Closes AIGOV-728
> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
|
||
|
|
13e673e9c2 |
ci: build docs PR previews on per-PR preview sites (#30698)
Docs previews at `coder.com/docs/@<branch>` share coder.com's origin and cookies with the real site. This publishes each pull request's docs as its own site on `docs.cdr-preview.dev`, a domain used only for previews (repository variable `DOCS_PREVIEW_DOMAIN`), and points the existing `docs-preview` comment's per-page links and checkboxes at it. ## URLs - `https://pr-<n>.docs.cdr-preview.dev`: the PR head, re-aliased on every build. A slower build of an older commit doesn't take it back. - `https://pr-<n>-<first 9 of sha>.docs.cdr-preview.dev`: one per built commit, listed newest first in a collapsible "Preview sites" list in the PR's docs preview comment, so reviewers can step through the branch. - Every URL is built from `vars.DOCS_PREVIEW_DOMAIN` (aliases, comment links, cleanup); nothing hard-codes the domain. Previews moved off `coderite.app`, which also hosts login-protected internal sites, so a preview page whose content any coder/coder writer controls would have been same-site with them. `cdr-preview.dev` hosts nothing else, and the docs previews sit under `docs.` so other preview kinds can get their own subdomain later. The jobs fail with a clear error if it is unset or a `vercel.app` name, because `*.vercel.app` names are first-come across all Vercel accounts and anyone could claim a preview's name before our deploy or after cleanup frees it. - Every preview carries the docs CSP and the other headers from docs-engine's `apps/offlinedocs/vercel.json`, plus `X-Robots-Tag: noindex`, which the deploy job prepends to the Build Output API `config.json` routes without touching the existing ones. - On merge or close, every deployment tagged `pr=<n>` and its aliases are deleted. A weekly groom (Mondays 07:23 UTC, also `workflow_dispatch`) deletes previews of any closed PR, in case a close event was missed. ## Who gets previews Only PRs from a branch in coder/coder, on every push that touches `docs/**`. Every job in the deploy workflow, and the close path of the cleanup, requires `github.event.pull_request.head.repo.full_name == github.repository`. Fork PRs get no preview for now. Building fork content in a `pull_request_target` run would share the base branch's Actions cache scope, so a fork could poison main's cache, and it would sit beside the private engine source. Fork previews come in a follow-up once the build runs in a no-network sandbox (or the public builder kit ships). That follow-up will gate on a maintainer stating the exact approved commit, not on a label, so a push after approval can't slip in. ## One comment, posted only after a deploy `docs-preview.yaml` is now a reusable workflow (`workflow_call` only). The deploy workflow's `comment` job calls it after `deploy` succeeds, so the per-page links never point at a preview that doesn't exist yet. I chose this over moving the per-page logic into the deploy job: the existing comment logic and its mapper test stay as they are, and only the trigger changes. Each PR gets at most one bot comment. The deploy job posts nothing; it passes the built commit (`short_sha`) to `docs-preview.yaml`, which adds a collapsible "Preview sites for each built commit" list to its comment, newest first, read back from the comment on each run and capped at 100. That comment is only posted when a non-generated page or an image changed: a PR that changes only `docs/reference/**` (generated CLI and API pages), or nothing previewable, gets no comment, and an earlier one is deleted. Engineers found the earlier two-comment version too noisy. If the comment is deleted that way and a later push brings it back, its commit list starts over; the earlier previews still exist until the PR closes. ## Three jobs, so PR content never runs beside a secret 1. `engine`: checks `DOCS_PREVIEW_DOMAIN` first, reads the docs-engine commit pinned in `docs/.engine-ref` (from the PR head, falling back to the base for a branch that predates the pin), mints a short-lived token from a GitHub App installed only on coder/docs-engine, downscoped to `contents: read` on that one repository, checks out with `persist-credentials: false`, and uploads a tarball plus its sha256 as a job output. Never touches PR content. 2. `build`: no secrets, `contents: read` only. Verifies the engine tarball against the digest, sparse-checks out the PR's `docs/`, refuses a `docs/` that is or contains a symbolic link (one could pull runner files, such as the private engine source, into a public preview), builds `apps/offlinedocs` with `DOCS_ROOT` as docs-engine's own `docs-pr-preview.yml` does, and uploads only the static `out/` export. 3. `deploy`: in the `docs-preview` environment with `VERCEL_PREVIEW_TOKEN`. Verifies the engine tarball against the digest again (a compromised build job could replace an artifact, but not a job output), refuses an export holding anything but regular files and directories, lays the static files out with the engine's `build:output` script, adds noindex, runs `vercel deploy --prebuilt` with meta `pr` and `sha`, and sets both aliases through the Vercel API. It holds only `pull-requests: read`, for the check that the PR head hasn't moved before re-aliasing; the `comment` job posts the comment. It runs the engine's trusted script rather than taking `config.json` from the build job, because a Build Output directory from another job could carry serverless functions or rewritten routes. `docs-pr-preview-cleanup.yaml` keeps `pull_request_target: closed` so a PR can't change its own cleanup; it checks out nothing and runs no PR content, only Vercel and GitHub API calls. Fork PRs have no previews, so their close is skipped. PR-chosen strings never reach a log line unfiltered: the comment workflow prints changed reference-page paths with every character outside a path allowlist as `?`, so a file name can't forge a `::` or `##[` workflow command, and the deploy job's errors name no path. ## Engine pin `docs/.engine-ref` now pins docs-engine `main` at `eadb477`, the engine `coder.com/docs` launched with on 2026-10-28 (was `e3c55c2`; an earlier revision of this PR pinned `5584d67`). The commands the workflow runs are unchanged between them. `e3c55c2` already had the `build:output` script, but the newer engine refuses a symlinked docs root, renders search hits without raw HTML, drops author-chosen heading ids that could break hydration, and pins Node 22.23.4, which the build and deploy jobs now use too. The commands the workflow runs (`pnpm turbo run build --filter=@coder/offlinedocs` and `apps/offlinedocs/scripts/build-output.mjs`) are unchanged at `5584d67`. The pin must be a commit on docs-engine `main`. The `engine` job checks docs-engine out with full history and fails before packing unless `git merge-base --is-ancestor "$REF" origin/main` passes. Once docs-engine is public, a commit pushed to any fork of it can be fetched by SHA through `coder/docs-engine`, so the 40-hex format check alone would let a PR build with unreviewed engine code. `test-docs-preview-mapper.sh` pins that the check runs in the `engine` job, before the pack step, against a full-history checkout. ## Before this can run Checked on 2026-11-12: IT registered `cdr-preview.dev` in Vercel on team `team_tGkWfhEGGelkkqUUm9nXq17r`, with Vercel nameservers, so `*.docs.cdr-preview.dev` needs no DNS or wildcard step. IT also set `docs.cdr-preview.dev` as the `coder-docs-pr-preview` project's own preview deployment suffix and removed `coderite.app` from it, so the project's generated deployment URLs land on the preview domain too, not on the team's `coderite.app` suffix; the first deploy will confirm that. The project has Vercel Authentication and password protection off. The secrets `DOCS_ENGINE_APP_ID` and `DOCS_ENGINE_APP_PRIVATE_KEY` exist. `DOCS_PREVIEW_DOMAIN` is set to `docs.cdr-preview.dev`. The `docs-preview` environment exists (created 2026-10-28) with no protection rules and no branch policy, and holds `VERCEL_PREVIEW_ORG_ID` and `VERCEL_PREVIEW_PROJECT_ID`, and `VERCEL_PREVIEW_TOKEN` was stored on 2026-11-12. - [ ] **GitHub App** (org owner; requested in DOCS-1739). Confirm the app behind `DOCS_ENGINE_APP_ID` is installed on coder/docs-engine only ("Only select repositories") with Repository permissions Contents: Read-only and Metadata: Read-only and nothing else, at https://github.com/organizations/coder/settings/installations. The workflow also downscopes each token to `contents: read` on docs-engine, so the installation is the outer bound. - [x] **Repository variable**, set on 2026-11-12. Set it at repository level, not on the environment, because the `engine` job and `docs-preview.yaml` run outside it: ```sh gh variable set DOCS_PREVIEW_DOMAIN -R coder/coder --body docs.cdr-preview.dev ``` - [x] **Vercel Authentication off** on `coder-docs-pr-preview` (`prj_RiVa1voPHmsfbEXkasFDXmYqAr0L`): checked on 2026-11-12, `ssoProtection` and `passwordProtection` both report `enabled: false`. - [x] **Preview domain** (IT): `cdr-preview.dev` registered with Vercel nameservers, and `docs.cdr-preview.dev` set as the project's preview deployment suffix. - [x] **Project-scoped Vercel token**, 90-day expiry (created 2026-11-12, expires about 2027-02-10; a rotation reminder is set for 2027-02-09). The three checks below returned `200`, `404` and `403`. Create it at https://vercel.com/account/settings/tokens, scoped to the `coder-docs-pr-preview` project only (`vercel tokens create --project` is refused for non-owners). Then check, with the new token in `$VERCEL_PREVIEW_TOKEN`, that it can list the project's deployments (`200`), reach the team-level alias API (`404`, not `403`), and cannot see the production `coder-docs` project (`403` or `404`, never `200`): ```sh curl -sS -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $VERCEL_PREVIEW_TOKEN" \ "https://api.vercel.com/v6/deployments?teamId=team_tGkWfhEGGelkkqUUm9nXq17r&projectId=prj_RiVa1voPHmsfbEXkasFDXmYqAr0L&limit=1" curl -sS -o /dev/null -w '%{http_code}\n' -X DELETE -H "Authorization: Bearer $VERCEL_PREVIEW_TOKEN" \ "https://api.vercel.com/v2/aliases/pr-0.docs.cdr-preview.dev?teamId=team_tGkWfhEGGelkkqUUm9nXq17r" curl -sS -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $VERCEL_PREVIEW_TOKEN" \ "https://api.vercel.com/v6/deployments?teamId=team_tGkWfhEGGelkkqUUm9nXq17r&projectId=prj_pC4y7hjUgcsYYNoSDL7pNJnafzh3&limit=1" ``` - [x] **`docs-preview` environment**: it exists with no branch policy (because `pull_request` runs on the merge ref) and its two variables are set. Only the token is left: ```sh gh secret set VERCEL_PREVIEW_TOKEN -R coder/coder --env docs-preview ``` `gh secret set` prompts for the token so it stays out of shell history. - [ ] **Security sign-off** (Lisa), on these points: - **Preview domain.** Previews now live on `docs.cdr-preview.dev`, which hosts nothing else, so they are no longer same-site with the login-protected sites on `coderite.app`. Previews are same-site with each other, so one PR's preview could set a cookie the others receive. Anything added to `cdr-preview.dev` later should stay outside `docs.` and not rely on cookies scoped to the parent domain. The docs CSP allows inline scripts, and any coder/coder writer controls a preview's content. - Any coder/coder writer can reach `VERCEL_PREVIEW_TOKEN` by editing the workflow on a branch, as with any secret a `pull_request` deploy uses. The token is scoped to the one preview project to bound that; required reviewers on the environment would close it, at the cost of an approval per preview. - The engine commit comes from the PR's `docs/.engine-ref`, so the engine code that lays out the export in the deploy job is PR-chosen, but only among commits on docs-engine `main`. It runs before, not in, the step that holds the token. - [ ] **Mark ready for review** once the items above are done and a docs push to this PR has produced a working preview. ## Testing `test-docs-preview-mapper.sh` checks that `docs-preview.yaml` reads the domain from `vars.DOCS_PREVIEW_DOMAIN`, builds links on `pr-<n>.<domain>` from the validated value with no `coder.com/docs/@` or `vercel.app` link, and runs only as a reusable workflow called after `deploy`. It also checks the per-commit list (this commit first, earlier ones carried, repeats and other PRs' lines dropped, capped at 100), that the list round-trips through the comment it renders without touching checkbox state, and that the deploy job posts no comment and passes its commit on. All 58 checks pass (run with GNU coreutils, sed, grep and awk on macOS); the new workflow check failed before the change. `actionlint` at the repo's pinned commit, with ShellCheck, reports nothing, and so does the repo's pinned zizmor 1.11.0 (`--strict-collection --persona=regular`). The noindex step was run against a `config.json` from docs-engine's real `build-output.mjs`: the route count went from 11 to 12 with the CSP route intact. With the variable, environment and token in place, the `engine` and `build` jobs pass on this PR, including the check that the pinned engine commit is on docs-engine `main`. The first deploy failed at `vercel pull` with "Could not retrieve Project Settings": Vercel CLI 59.3.0 looks up the token's team (403 for a project-scoped token) and gives up, although the token reads the project (200). Run locally with the same token, 65.11.0 skips that lookup and pulls the settings, so the workflow now pins 65.11.0, the newest release more than a week old. The deploy, alias and cleanup calls have not completed in CI yet. --- 🤖 Built with AI assistance. |
||
|
|
b9741840eb |
docs: update Agent Relay docs for v0.16.0 (#32094)
Brings the Agent Relay docs up to v0.16.0, per Atif's request for a pass against the new release. Of the seven PRs in v0.16.0, only [agent-relay#155](https://github.com/coder/agent-relay/pull/155) changes behavior users see. `main` already described most of it ahead of the release (#31896) as "newer than v0.15.0". This PR fills the remaining gaps: - `setup.md`, `troubleshooting.md`: "newer than v0.15.0" becomes "v0.16.0 and later". Both pages now say Claude Code skips its one retry when the failure comes later than `dispatch_deadline` after the build was created. - `setup.md` **Workspace lifecycle**: a row for failed or timed-out startup scripts, and a note that these don't wait for the startup grace. - `configuration.md` `--reap-startup-grace`: the "fails after this grace" bullet notes the faster startup-script failure. - `claude-code.md` **Build budget**: when a build succeeds but the runner never starts, Anthropic retries only on the session's first delivery and only within `dispatch_deadline`. Otherwise the session fails. In v0.15.0 that nack was always retryable. Verification notes (agent-relay `v0.15.0...v0.16.0`): - `serviceclaudecoderunners/reap.go`: for a `pending` runner, `retryable = !redelivered(attempt) && (dispatchDeadline == 0 || obs.Age < dispatchDeadline)`. `obs.Age` counts from the latest build's creation, not from the work order's issue. - `workspacereaper/reaper.go` `confirmStartupFailure`: the first `pending` read after `start_error` or `start_timeout` is stored. A later sweep confirms only when its sample's `CollectedAt` is newer, and a sweep that re-reads the same sample doesn't reset it. So the docs say "two `pending` reads, the second from a newer sample", not "two sweeps in a row". - `workspacereaper/lifecycle.go` `StartupFailure`: applies only to running builds whose status is `pending`. Not documented: - The example templates (agent-relay#157), because the repository is internal. - The older-coderd `include_agent_metadata` detection fix (agent-relay#146), which is a bug fix with no setting or behavior change. - The agent lifecycle in nack failure details, a minor diagnostic change. Stack 6/6. Review and merge in order: - #31834 (merged) - #31984 - #31985 - #31986 - #31987 - #32094 Refs DOCS-1171 > Generated by Coder Agents on behalf of @nickvigilante. |
||
|
|
03139498d2 |
docs: fix smaller Agent Relay doc drift for v0.15.0 (#31987)
Smaller fixes so the Agent Relay docs match v0.15.0. - `slack.md`: idle release comes from the pool's `idle_release_timeout`. Agent Relay sets `agent_relay_claude_code_release_idle_session_min` on every build, so the module's `release_idle_session_min` input is only a fallback (confirmed in the `agent-relay-claude-code` module's `main.tf`). This matches `claude-code.md`. - `setup.md`: replace "release binaries aren't published yet". `.github/workflows/release.yaml` builds `linux` and `darwin` binaries for `amd64` and `arm64`, plus `checksums.txt`, on tags (there is no goreleaser config). - `setup.md` step 6: check `credential_transport=secrets`, as the agent-relay README says. - `setup.md`, `index.md`: say which features need v0.15.0. - `setup.md` **Start the worker after workspace setup**: point to the agent-ready and runner-up metrics. - `monitoring/index.md`: add `reaper_sweeps_total`, `reaper_sweep_seconds`, `reaper_claim_to_runner_up_seconds`, `reaper_claim_to_agent_ready_seconds` ([agent-relay#154](https://github.com/coder/agent-relay/pull/154)), `claude_code_polls_total`, `claude_code_last_poll_timestamp_seconds`, `claude_code_nacks_total`, `claude_code_pool_sessions`, `claude_code_issued_to_claimed_seconds`, `claude_code_queue_wait_seconds`, and the `client_platform`/`spawn_reason` labels on `work_orders_claimed_total`. - `configuration.md` **Pin a template version**: unpinned rebuilds move to the active version ([agent-relay#135](https://github.com/coder/agent-relay/pull/135)), and a refused rebuild is non-retryable ([agent-relay#136](https://github.com/coder/agent-relay/pull/136)). Verification notes: - Rebuild errors: the code treats both `400` and `403` as non-retryable (`dispatcher.go`, `retryable := ... != 400 && != 403`), so the docs mention both. - The release workflow creates a **draft** GitHub Release (`softprops/action-gh-release`, `draft: true`). The v0.15.0 release is now published, but coder/agent-relay is an internal repository, so customers can't see GitHub release assets. Needs a decision on where binaries are distributed before this wording ships. Stack 5/6. Review and merge in order: - #31834 (merged) - #31984 - #31985 - #31986 - #31987 - #32094 Refs DOCS-1171 > Generated by Coder Agents. --------- Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> |