mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
abee77ac2f0d62cc05aa25b57ca586af033d8326
12951
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
abee77ac2f | fix(site): move analytics date range above cards (#23158) | ||
|
|
7946dc6645 |
fix(provisioner): skip duplicate-env-keys in generate.sh (#23155)
## Problem When `generate.sh` is run (e.g. to regenerate fixtures after adding a new field like `subagent_id`), the `duplicate-env-keys` fixture gets UUID scrambling. The `minimize_diff()` function uses a bash associative array keyed by JSON field name (`deleted["id"]`). The `duplicate-env-keys` fixture has multiple `coder_env` resources, each with the same key names (`id`, `agent_id`). Since an associative array can only hold one value per key, UUIDs get cross-contaminated or left as random terraform-generated values. Discovered while working on #23122. ## Fix Add `duplicate-env-keys` to the `toskip` array in `generate.sh`, alongside `kubernetes-metadata`. This fixture uses hand-crafted placeholder UUIDs and should not be regenerated. Relates to #21885. |
||
|
|
eb828a6a86 | fix: skip input refocus after send on mobile viewports (#23141) | ||
|
|
4e2d7ffaa7 |
refactor(site/src/pages/AgentsPage): use ChatMessagePart for editingFileBlocks (#23151)
Replace the ad-hoc camelCase file block shape ({ mediaType, fileId, data })
with snake_case fields matching ChatMessagePart from the API types.
The RenderBlock file variant now uses media_type/file_id instead of
mediaType/fileId. The parsers in messageParsing.ts and streamState.ts
pass validated ChatMessagePart objects through directly instead of
destructuring and reassembling with renamed fields. This eliminates
the needless API → camelCase → snake_case roundtrip that the edit
flow previously required.
Refs #22735
|
||
|
|
524bca4c87 |
fix(site/src/pages/AgentsPage): fix chat image paste bugs and refactor queued message display (#22735)
handleSubmit (triggered via Enter key) didn't check isUploading, so messages could be sent while an image upload was still in progress. The send button was correctly disabled via canSend, but the keyboard shortcut bypassed that guard. QueuedMessagesList used untyped extraction helpers that fell through to JSON.stringify for attachment-only messages. Replace them with a single getQueuedMessageInfo function using typed ChatMessagePart access. Show an attachment badge (ImageIcon + count) for file parts, and use a consistent "[Queued message]" placeholder for all no-text situations. Editing a queued message with file attachments silently dropped all attachments because handleStartQueueEdit only accepted text. Thread file blocks from QueuedMessagesList through the edit callback into handleStartQueueEdit, which now calls setEditingFileBlocks. The existing useEffect in AgentDetailInput picks these up and populates the attachment UI. Also clear editingFileBlocks in handleCancelQueueEdit and handleSendFromInput. |
||
|
|
365de3e367 |
feat: record model thoughts (#22676)
Depends on https://github.com/coder/aibridge/pull/203 Closes https://github.com/coder/internal/issues/1337 --------- Signed-off-by: Danny Kopping <danny@coder.com> |
||
|
|
5d0eb772da | fix(cored): fix flaky TestInterruptAutoPromotionIgnoresLaterUsageLimitIncrease (#23147) | ||
|
|
04fca84872 |
perf(coderd): reduce duplicated reads in push and webpush paths (#23115)
## Background A 5000-chat scaletest (~50k turns, ~2m45s wall time) completed successfully, but the main bottleneck was **DB pool starvation from repeated reads**, not individually expensive SQL. The push/webpush path showed a few especially noisy reads: - `GetLastChatMessageByRole` for push body generation - `GetEnabledChatProviders` + `GetChatModelConfigByID` for push summary model resolution - `GetWebpushSubscriptionsByUserID` for every webpush dispatch This PR keeps the optimizations that remove those duplicate reads while leaving stream behavior unchanged. ## What changes in this PR ### 1. Reuse resolved chat state for push notifications `maybeSendPushNotification` used to re-read the last assistant message and re-resolve the chat model/provider after `runChat` had already done that work. Now `runChat` returns the final assistant text plus the already-resolved model and provider keys, and the push goroutine uses that state directly. That removes the extra push-path reads for: - `GetLastChatMessageByRole` - the second `resolveChatModel` path - the provider/model lookups that came with that second resolution ### 2. Cache webpush subscriptions during dispatch `Dispatch()` previously hit `GetWebpushSubscriptionsByUserID` on every push. A small per-user in-memory cache now avoids those repeated reads. The follow-up fix keeps that optimization correct: `InvalidateUser()` bumps a per-user generation so an older in-flight fetch cannot repopulate the cache with pre-mutation data after subscribe/unsubscribe. That preserves the cache win without letting local subscription changes be silently overwritten by stale fetch results. ## Why this is safe - The push change only reuses data already produced during the same chat run. It does not change notification semantics; if there is no assistant text to summarize, the existing fallback body still applies. - The webpush change keeps the existing TTL and `410 Gone` cleanup behavior. The generation guard only prevents stale in-flight fetches from poisoning the shared cache after invalidation. - The final PR does **not** change stream setup, pubsub/relay behavior, or chat status snapshot timing. ## Deliberately not included - No stream-path optimization in `Subscribe`. - No inline pubsub message payloads. - No distributed cross-replica webpush cache invalidation. |
||
|
|
7cca2b6176 |
feat(site): add chat spend limit UI (#23072)
Frontend for agent chat spend limiting on `/agents`. ## Changes - add the limits management UI, API hooks, and validation for deployment, group, and user overrides - show spend limit status in Agents analytics and usage summaries - surface limit-related chat errors consistently in the agent detail experience - add shared currency and usage-limit messaging helpers plus related stories/tests |
||
|
|
1031da9738 |
feat: add agent chat spend limiting (backend) (#23071)
Introduces deployment-scoped spend limiting for Coder Agents, enabling administrators to control LLM costs at global, group, and individual user levels. ## Changes - **Database migration (000437)**: `chat_usage_limit_config` (singleton), `chat_usage_limit_overrides` (per-user), `chat_usage_limit_group_overrides` (per-group) - **Single-query limit resolution**: individual override > min(group) > global default via `ResolveUserChatSpendLimit` - **Fail-open enforcement** in chatd with documented TOCTOU trade-off - **Experimental API** under `/api/experimental/chats/usage-limits` for CRUD on limits - **`AsChatd` RBAC subject** for narrowly-scoped daemon access (replaces `AsSystemRestricted`) - **Generated TypeScript types** for the frontend SDK ## Hierarchy 1. Individual user override (highest) 2. Minimum of group limits 3. Global default 4. Disabled / unlimited Currency stored as micro-dollars (`1,000,000` = $1.00). Frontend PR: #23072 |
||
|
|
b69631cb35 | chore(site): improve mobile layout for agent chat (#23139) | ||
|
|
7b0aa31b55 | feat: render file references inline in user messages (#23131) | ||
|
|
93b9d70a9b |
chore: add audit log entry when ai seat is consumed (#22683)
When an ai seat is consumed, an audit log entry is made. This only happens the first time a seat is used. |
||
|
|
6972d073a2 |
fix: improve background process handling for agent tools (#23132)
## Problem Models frequently use shell `&` instead of `run_in_background=true` when starting long-running processes through `/agents`, causing them to die shortly after starting. This happens because: 1. **No guidance in tool schema** — The `ExecuteArgs` struct had zero `description` tags. The model saw `run_in_background: boolean (optional)` with no explanation of when/why to use it. 2. **Shell `&` is silently broken** — `sh -c "command &"` forks the process, the shell exits immediately, and the forked child becomes an orphan not tracked by the process manager. 3. **No process group isolation** — The SSH subsystem sets `Setsid: true` on spawned processes, but the agent process manager set no `SysProcAttr` at all. Signals only hit the top-level `sh`, not child processes. ## Investigation Compared our implementation against **openai/codex** and **coder/mux**: | Aspect | codex | mux | coder/coder (before) | |--------|-------|-----|---------------------| | Background flag | Yield/resume with `session_id` | `run_in_background` with rich description | `run_in_background` with **no description** | | `&` handling | `setsid()` + `killpg()` | `detached: true` + `killProcessTree()` | **Nothing** — orphaned children escape | | Process isolation | `setsid()` on every spawn | `set -m; nohup ... setsid` for background | **No `SysProcAttr` at all** | | Signal delivery | `killpg(pgid, sig)` — entire group | `kill -15 -\$pid` — negative PID | `proc.cmd.Process.Signal()` — **PID only** | ## Changes ### Fix 1: Add descriptions to `ExecuteArgs` (highest impact) The model now sees explicit guidance: *"Use for long-running processes like dev servers, file watchers, or builds. Do NOT use shell & — it will not work correctly."* ### Fix 2: Update tool description The top-level execute tool description now reinforces: *"Use run_in_background=true for long-running processes. Never use shell '&' for backgrounding."* ### Fix 3: Detect trailing `&` and auto-promote to background Defense-in-depth: if the model still uses `command &`, we strip the `&` and promote to `run_in_background=true` automatically. Correctly distinguishes `&` from `&&`. ### Fix 4: Process group isolation (`Setpgid`) New platform-specific files (`proc_other.go` / `proc_windows.go`) following the same pattern as `agentssh/exec_other.go`. Every spawned process gets its own process group. ### Fix 5: Process group signaling `signal()` now uses `syscall.Kill(-pid, sig)` on Unix to signal the entire process group, ensuring child processes from shell pipelines are also cleaned up. ## Testing All existing `agent/agentproc` tests pass. Both packages compile cleanly. |
||
|
|
89bb5bb945 |
ci: fix build job disk exhaustion on Depot runners (#23136)
## Problem The `build` job on `main` has been failing intermittently (and now consistently) with `no space left on device` on the `depot-ubuntu-22.04-8` runner. The runner's disk fills up during Docker image builds or SBOM generation, depending on how close to the limit a given run lands. The build was already at the boundary — the Go build cache alone is ~1.3 GB, build artifacts are ~2 GB, and Docker image builds + SBOM scans need several hundred MB of headroom in `/tmp`. No single commit caused this; cumulative growth in dependencies and the scheduled `coder-base:latest` rebuild on Monday morning nudged it past the limit. ## Fix Three changes to reclaim ~2 GB of disk before Docker runs: 1. **Build all platform archives and packages in the Build step** — moves arm64/armv7 `.tar.gz` and `.deb` from the Docker step to the Build step so we can clean caches in between. 2. **Clean up Go caches between Build and Docker** — once binaries are compiled, the Go build cache and module cache aren't needed. Also removes `.apk`/`.rpm` packages that are never uploaded. 3. **Set `DOCKER_IMAGE_NO_PREREQUISITES`** — tells make to skip redundantly building `.deb`/`.rpm`/`.apk`/`.tar.gz` as prerequisites of Docker image targets. The Makefile already supports this flag for exactly this purpose. |
||
|
|
b7eab35734 |
fix(site): scope chat cache helpers to chat-list queries only (#23134)
## Problem
`updateInfiniteChatsCache`, `prependToInfiniteChatsCache`, and
`readInfiniteChatsCache` use `setQueriesData({ queryKey: ["chats"] })`
which prefix-matches **all** queries starting with `"chats"`, including
`["chats", chatId, "messages"]`.
After #23083 converted chat messages to `useInfiniteQuery`, the cached
messages data gained a `.pages` property containing
`ChatMessagesResponse` objects (not `Chat[]` arrays). The `if
(!prev.pages)` guard no longer bailed out, and the updater called
`.map()` on these objects — `TypeError: Z.map is not a function`.
## Fix
Extract the `isChatListQuery` predicate that already existed inline in
`invalidateChatListQueries` and apply it to all four cache helpers. This
scopes them to sidebar queries (`["chats"]` or `["chats",
<filterOpts>]`) and skips per-chat queries (`["chats", <id>, ...]`).
|
||
|
|
3f76f312e4 |
feat(cli): add --no-wait flag to coder create (#22867)
Adds a `--no-wait` flag (CODER_CREATE_NO_WAIT) to the create command, matching the existing pattern in `coder start`. When set, the `coder create` command returns immediately after the workspace creation API call succeeds instead of streaming build logs until completion. This enables fire-and-forget workspace creation in CI/automation contexts (e.g., GitHub Actions), where waiting for the build to finish is unnecessary. Combined with other existing flags, users can create a workspace with no interactivity, assuming the user is already authenticated. |
||
|
|
abf59ee7a6 |
feat: track ai seat usage (#22682)
When a user uses an AI feature, we record them in the `ai_seat_state` as consuming a seat. Added in debouching to prevent excessive writes to the db for this feature. There is no need for frequent updates. |
||
|
|
cabb611fd9 |
chore: implement database crud for AI seat usage (#22681)
Creates a new table `ai_seat_state` to keep track of when users consume an ai_seat. Once a user consumes an AI seat, they will forever in this table (as it stands today). |
||
|
|
b2d8b67ff7 |
feat(site): add Early Access notice below agents chat input (#23130)
Adds a centered "Coder Agents is available via Early Access" line directly beneath the chat input on the `/agents` index page. The "Early Access" text links to https://coder.com/docs/ai-coder/agents/early-access. <img width="1192" height="683" alt="image" src="https://github.com/user-attachments/assets/1823a5d2-6f02-48c2-ac70-a62b8f52be55" /> --- PR generated with Coder Agents |
||
|
|
c1884148f0 |
feat: add VS Code iframe embed auth bootstrap (#23060)
## VS Code iframe embed auth via postMessage + setSessionToken Adds embed auth for VS Code iframe integration, allowing the Coder agent chat UI to be embedded in VS Code webviews without manual login — using direct header auth instead of cookies. ### How it works 1. **Parent frame** (VS Code webview) loads an iframe pointing to `/agents/:agentId/embed` 2. **Embed page** detects the user is signed out and posts `coder:vscode-ready` to the parent 3. **Parent** responds with `coder:vscode-auth-bootstrap` containing the user's Coder API token 4. **Embed page** calls `API.setSessionToken(token)` to set the `Coder-Session-Token` header on all subsequent axios requests 5. **Embed page** fetches user + permissions, sets them in the React Query cache atomically, and renders the authenticated agent chat UI No cookies, no CSRF, no backend endpoint needed. The token is passed via postMessage and used as a header on every API request. ### What changed **Frontend** (`site/src/pages/AgentsPage/`): - `AgentEmbedPage.tsx` — added postMessage bootstrap directly in the embed page: listens for `coder:vscode-auth-bootstrap`, calls `API.setSessionToken(token)`, fetches user/permissions atomically to avoid race conditions - `EmbedContext.tsx` — React context signaling embed mode (from previous commit, unchanged) - `AgentDetail/TopBar.tsx` — conditionally hides navigation elements in embed mode (from previous commit, unchanged) - Both `/agents/:agentId/embed` and `/agents/:agentId/embed/session` routes live outside `RequireAuth` **Auth bootstrap** (`site/src/api/queries/users.ts`): - `bootstrapChatEmbedSessionFn` now calls `API.setSessionToken(token)` instead of posting to a backend endpoint - Fetches user and permissions directly via `API.getAuthenticatedUser()` and `API.checkAuthorization()`, then sets both in the query cache atomically — this avoids a race where `isSignedIn` flips before permissions are loaded **Removed** (no longer needed): - `coderd/embedauth.go` — the `POST /api/experimental/chats/embed-session` handler - `coderd/embedauth_test.go` — backend tests for the endpoint - `codersdk/embedauth.go` — `EmbedSessionTokenRequest` SDK type - `site/src/api/api.ts` — `postChatEmbedSession` method - `docs/user-guides/workspace-access/vscode-embed-auth.md` — doc page for the old cookie flow - Swagger/API doc entries for the endpoint ### Why not cookies? The initial implementation used a backend endpoint to set an HttpOnly session cookie. This required `SameSite=None; Secure` for cross-origin iframes, which doesn't work over HTTP in development (Chrome requires HTTPS for `Secure` cookies). The `setSessionToken` approach bypasses cookies entirely — the token is set as an axios default header, and header-based auth also naturally bypasses CSRF protection. ### Dogfooding Tested end-to-end with a VS Code extension that: 1. Registers a `/openChat` deep link handler (`vscode://coder.coder-remote/openChat?url=...&token=...&agentId=...`) 2. Starts a local HTTP reverse proxy (to work around VS Code webview iframe sandboxing) 3. Loads `/agents/:agentId/embed` in an iframe through the proxy 4. Relays the postMessage handshake between the iframe and the extension host 5. The embed page receives the token, calls `setSessionToken`, and renders the chat Verified: chat title, messages, and input field all display correctly in VS Code's secondary sidebar panel. |
||
|
|
741af057dc |
feat: paginate chat messages endpoint with cursor-based infinite scroll (#23083)
Adds cursor-based pagination to the chat messages endpoint. ## Backend - New `GetChatMessagesByChatIDPaginated` SQL query: returns messages in `id DESC` order with a `before_id` keyset cursor and configurable `limit` - Handler parses `?before_id=N&limit=N` query params, uses the `LIMIT N+1` trick to set `has_more` without a separate COUNT query - Queued messages only returned on the first page (no cursor) since they're always the most recent - SDK client updated with `ChatMessagesPaginationOptions` - Fully backward compatible: omitting params returns the 50 newest messages ## Frontend - Switches `getChatMessages` from `useQuery` to `useInfiniteQuery` with cursor chaining via `getNextPageParam` - Pages flattened and sorted by `id` ascending for chronological display - `MessagesPaginationSentinel` component uses `IntersectionObserver` (200px rootMargin prefetch) inside the existing `flex-col-reverse` scroll container - `flex-col-reverse` handles scroll anchoring natively when older messages are prepended — no manual `scrollTop` adjustment needed (same pattern as coder/blink) ## Why cursor-based instead of offset/limit Offset-based pagination breaks when new messages arrive while paginating backward (offsets shift, causing duplicates or missed messages). The `before_id` cursor is stable regardless of inserts — each page is deterministic. |
||
|
|
32a894d4a7 |
fix: error on ambiguous matches in edit_files tool (#23125)
## Problem The `edit_files` tool used `strings.ReplaceAll` for exact substring matches, silently replacing **every** occurrence. When an LLM's search string wasn't unique in the file, this caused unintended edits. Fuzzy matches (passes 2 and 3) only replaced the first occurrence, creating inconsistent behavior. Zero matches were also silently ignored. ## Investigation Investigated how **coder/mux** and **openai/codex** handle this: | Tool | Multiple matches | No match | Flag | |---|---|---|---| | **coder/mux** `file_edit_replace_string` | Error (default `replace_count=1`) | Error | `replace_count` (int, default 1, -1=all) | | **openai/codex** `apply_patch` | Uses first match after cursor (structural disambiguation via context lines + `@@` markers) | Error | None (different paradigm) | | **coder/coder** `edit_files` (before) | Exact: replaces all. Fuzzy: replaces first. | Silent success | None | ## Solution Adopted the mux approach (error on ambiguity) with a simpler `replace_all: bool` instead of `replace_count: int`: - **Default (`replace_all: false`)**: search string must match exactly once. Multiple matches → error with guidance: *"search string matches N occurrences. Include more surrounding context to make the match unique, or set replace_all to true"* - **`replace_all: true`**: replaces all occurrences (opt-in for intentional bulk operations like variable renames) - **Zero matches**: now returns an error instead of silently succeeding Chose `bool` over `int` count because: 1. LLMs are bad at counting occurrences 2. The real intent is binary (one specific spot vs. all occurrences) 3. Simpler error recovery loop for the LLM ## Changes | File | Change | |---|---| | `codersdk/workspacesdk/agentconn.go` | Add `ReplaceAll bool` to `FileEdit` struct | | `agent/agentfiles/files.go` | Count matches before replacing; error if >1 and not opted in; error on zero matches; add `countLineMatches` helper | | `codersdk/toolsdk/toolsdk.go` | Expose `replace_all` in tool schema with description | | `agent/agentfiles/files_test.go` | Update existing tests, add `EditEditAmbiguous`, `EditEditReplaceAll`, `NoMatchErrors`, `AmbiguousExactMatch`, `ReplaceAllExact` | |
||
|
|
4fdd48b3f5 |
chore: randomize task status update times in load generator (#23058)
fixes https://github.com/coder/scaletest/issues/92 Randomizes the time between task status updates so that we don't send them all at the same time for load testing. |
||
|
|
e94de0bdab |
fix(coderd): render HTML error page for OIDC email validation failures (#23059)
## Summary When the email address returned from an OIDC provider doesn't match the configured allowed domain list (or isn't verified), users previously saw raw JSON dumped directly in the browser — an ugly and confusing experience during a browser-redirect flow. This PR replaces those JSON responses with the same styled static HTML error page already used for group allow-list errors, signups-disabled, and wrong-login-type errors. ## Changes ### `coderd/userauth.go` Replaced 3 `httpapi.Write` calls in `userOIDC` with `site.RenderStaticErrorPage`: | Error case | Title shown | |---|---| | Email domain not in allowed list | "Unauthorized email" | | Malformed email (no `@`) with domain restrictions | "Unauthorized email" | | `email_verified` is `false` | "Email not verified" | All render HTTP 403 with `HideStatus: true` and a "Back to login" action button. ### `coderd/userauth_test.go` - Updated `AssertResponse` callbacks on existing table-driven tests (`EmailNotVerified`, `NotInRequiredEmailDomain`, `EmailDomainForbiddenWithLeadingAt`) to verify HTML Content-Type and page content. - Extended `TestOIDCDomainErrorMessage` to additionally assert HTML rendering. - Added new `TestOIDCErrorPageRendering` with 3 subtests covering all error scenarios, verifying: HTML doctype, expected title/description, "Back to login" link, and absence of JSON markers. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> |
||
|
|
fa8693605f |
test(provisioner/terraform/testdata): add subagent_id to UUID preservation and regenerate (#23122)
The minimize_diff function in generate.sh preserves autogenerated values (UUIDs, tokens, etc.) across regeneration to keep diffs minimal. The subagent_id field was missing from the preservation list, causing unnecessary churn on devcontainer test data. Also regenerates all testdata with the current terraform (1.14.5) and coder provider (2.14.0). |
||
|
|
af1be592cf |
fix: disable agent notification chime by default (#23124)
The completion chime on `/agents` was enabled by default for new users (or when no localStorage preference existed). This changes the default to disabled, so users must explicitly opt in via the sound toggle button. ## Changes - `getChimeEnabled()` now returns `false` when no preference is stored (was `true`) - `catch` fallback also returns `false` (was `true`) - Updated tests to reflect the new default and explicitly enable the chime in `maybePlayChime` tests |
||
|
|
6f97539122 |
fix: update sidebar diff status on WebSocket events (#23116)
## Problem The sidebar diff status (PR icon, +additions/-deletions, file count) was not updating in real-time. Users had to reload the page to see changes. Two root causes: 1. **Frontend**: The `diff_status_change` WebSocket handler in `AgentsPage.tsx` had an early `return` (line 398) that skipped `updateInfiniteChatsCache`, so the sidebar's cache was never updated. Even for other event types, the cache merge only spread `status` and `title` — never `diff_status`. 2. **Server**: `publishChatPubsubEvent` in `chatd.go` constructed a minimal `Chat` payload without `DiffStatus`, so even if the frontend consumed the event, `updatedChat.diff_status` would be `undefined`. ## Fix ### Server (`coderd/chatd/chatd.go`) - `publishChatPubsubEvent` now accepts an optional `*codersdk.ChatDiffStatus` parameter; when non-nil it's set on the outgoing `Chat` payload. - `PublishDiffStatusChange` fetches the diff status from the DB, converts it, and passes it through. - Added `convertDBChatDiffStatus` (mirrors `coderd/chats.go`'s converter to avoid circular import). - All other callers pass `nil`. ### Frontend (`site/src/pages/AgentsPage/AgentsPage.tsx`) - Removed the early `return` so `diff_status_change` events fall through to the cache update logic. - Added `isDiffStatusEvent` flag and spread `diff_status` into both the infinite chats cache (sidebar) and the individual chat cache. |
||
|
|
530872873e |
chore: remove swagger annotations from experimental chat endpoints (#23120)
The `/archive` and `/desktop` chat endpoints had swagger route comments (`@Summary`, `@ID`, `@Router`, etc.) that would cause them to appear in generated API docs. Since these live under `/experimental/chats`, they should not be documented. This removes the swagger annotations and adds the standard `// EXPERIMENTAL: this endpoint is experimental and is subject to change.` comment to `archiveChat` (the `watchChatDesktop` handler already had it, just needed the swagger block removed). |
||
|
|
115011bd70 |
docs: rename Chat API to Chats API (#23121)
Renames the page title and manifest label from "Chat API" to "Chats API" to match the plural endpoint path (`/api/experimental/chats`). |
||
|
|
3c6445606d |
docs: add Chat API page under Coder Agents (#22898)
Adds `docs/ai-coder/agents/chat-api.md` — a concise guide for the experimental `/api/experimental/chats` endpoints. **What's included:** - Authentication - Quick start curl example - Core workflow (create → stream → follow-up) - All major endpoints: create, messages, stream, list, get, archive, interrupt - File uploads - Chat status reference Also marks all Coder Agents child pages as `early access` in `docs/manifest.json`. |
||
|
|
f8dff3f758 |
fix: improve push notification message shown on subscribe (#23052)
Updates push notification message for test notification. |
||
|
|
27cbf5474b |
refactor: remove /diff-status endpoint, include diff_status in chat payload (#23082)
The `/chats/{chat}/diff-status` endpoint was redundant because:
- The `Chat` type already has a `DiffStatus` field
- Listing chats already resolves and returns `diff_status`
- The `getChat` endpoint was the only one not resolving it (passing
`nil`)
## Changes
**Backend:**
- `getChat` now calls `resolveChatDiffStatus` and includes the result in
the response
- Removed `getChatDiffStatus` handler, route (`GET /diff-status`), and
SDK method
- Tests updated to use `GetChat` instead of `GetChatDiffStatus`
**Frontend:**
- `AgentDetail.tsx`: uses `chatQuery.data?.diff_status` instead of
separate query
- `RemoteDiffPanel.tsx`: accepts `diffStatus` as a prop instead of
fetching internally
- `AgentsPage.tsx`: `diff_status_change` events now invalidate the chat
query
- Removed `chatDiffStatus` query, `chatDiffStatusKey`, and
`getChatDiffStatus` API method
|
||
|
|
3704e930a1 |
docs: update release calendar for v2.31 (#23113)
The release calendar was outdated — it still showed v2.30 as Mainline and v2.31 as Not Released. This runs the `scripts/update-release-calendar.sh` script and manually re-adds the ESR rows that the script doesn't handle: **Changes:** - v2.28: Security Support → Not Supported - v2.29: Stable + ESR → Security Support + ESR (v2.29.8) - v2.30: Mainline → Stable (v2.30.3) - v2.31: Not Released → Mainline (v2.31.5) - Added 2.32 as Not Released - Kept 2.24 as Extended Support Release - Updated latest patch versions for all releases - Removed 2.25 (no longer in the rolling window) Created on behalf of @matifali Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> |
||
|
|
3a3537a642 |
refactor: rewrite develop.sh orchestrator in Go (#23054)
Replace the ~370-line bash develop.sh with a Go program using serpent for CLI flags, errgroup for process lifecycle, and codersdk for setup. develop.sh becomes a thin make + exec wrapper. - Process groups for clean shutdown of child trees - Docker template auto-creation via SDK ExampleID - Idempotent setup (users, orgs, templates) - Configurable --port, --web-port, --proxy-port - Preflight runs lib.sh dependency checks - TCP dial for port-busy checks - Make target (build/.bin/develop) for build caching |
||
|
|
c4db03f11a |
perf(coderd/database): skip redundant chat row update in InsertChatMessage (#23111)
## Summary
- add an `IS DISTINCT FROM` guard to `InsertChatMessage`'s
`updated_chat` CTE so `chats.last_model_config_id` is only rewritten
when the incoming `model_config_id` actually changes
- regenerate the query layer
- add focused regression coverage for the two meaningful behaviors:
same-model inserts and real model switches
- trim redundant message-field assertions so the new test stays focused
on the guard behavior
## Proof this is an improvement
This PR reduces work in the hottest chat write query without changing
the insert behavior.
### Why the old query did unnecessary work
Before this change, `InsertChatMessage` always ran this update whenever
`model_config_id` was non-null:
```sql
UPDATE chats
SET last_model_config_id = sqlc.narg('model_config_id')::uuid
WHERE id = @chat_id::uuid
AND sqlc.narg('model_config_id')::uuid IS NOT NULL
```
That means the query rewrote the `chats` row even when
`chats.last_model_config_id` was already equal to the incoming value.
### What changes in this PR
This PR adds:
```sql
AND chats.last_model_config_id IS DISTINCT FROM sqlc.narg('model_config_id')::uuid
```
So same-model inserts still insert the message, but they no longer
perform a redundant `UPDATE chats`.
### Why this matters on the hot path
From the chat scaletest investigation that motivated this change:
- `InsertChatMessage` (+ `updated_chat` CTE) was the hottest write query
- about **104k calls**
- about **0.69 ms average latency**
- about **71.8 s total DB execution time**
We also verified common callsites where the update is provably
redundant:
- `CreateChat` inserts the chat with `LastModelConfigID =
opts.ModelConfigID`, then immediately inserts initial system/user
messages with that same model config
- follow-up user messages commonly pass `lockedChat.LastModelConfigID`
straight into `InsertChatMessage`
- assistant/tool/summary persistence keeps the current model in the
common case; only real switches or fallback cases need the chat row
update
That means a meaningful fraction of executions of the hottest DB write
query move from:
- **before:** insert message **+** rewrite chat row
- **after:** insert message only
This should reduce row churn and write contention on `chats`, especially
against other chat-row writers like `UpdateChatStatus` and
`GetChatByIDForUpdate`.
|
||
|
|
08107b35d7 | fix: remove stray whitespace in agents UI (#23110) | ||
|
|
fbc8930fc3 |
fix(coderd): make chat cost summary tests deterministic (#23097)
Fixes flaky `TestChatCostSummary_UnpricedMessages` (and siblings) by replacing implicit handler-default date windows with explicit time windows derived from database-assigned message timestamps. **Root cause:** Tests called `GetChatCostSummary` with empty options, triggering the handler to use `[time.Now()-30d, time.Now())` as the query window. The SQL filter's exclusive upper bound (`created_at < @end_date`) can exclude freshly-inserted messages when the handler's clock drifts even slightly past the message's `created_at`. **Fix (test-only, `coderd/chats_test.go`):** - `seedChatCostFixture` now captures `InsertChatMessage` return values and exposes `EarliestCreatedAt`/`LatestCreatedAt`. - Added `safeOptions()` helper that builds a padded ±1 min window around DB timestamps. - Updated 4 tests to use explicit date windows; `TestChatCostSummary_DateRange` unchanged. Validated with `go test -count=20` (100/100 passes). |
||
|
|
59553b8df8 |
docs(ai-coder): add enablement instructions for agents experiment (#23057)
Adds a new **Enable Coder Agents** section to the Early Access doc explaining how to activate the `agents` experiment flag via `CODER_EXPERIMENTS` or `--experiments`. ## Changes ### `docs/ai-coder/agents/early-access.md` - New **Enable Coder Agents** section with env var and CLI flag examples. - Note that the `agents` flag is excluded from wildcard (`*`) opt-in. - Quick-start checklist: dashboard → Admin → configure provider/model → start chatting. - Link to GitHub issues for feedback. ### `docs/ai-coder/agents/index.md` - Updated **Product status** from "internal preview" to "Early Access" with a link to the early-access page for enablement instructions. |
||
|
|
68fd82e0ba | fix(site): right-align admin badge in agent settings nav tabs (#23104) | ||
|
|
2927fea959 |
chore: bump the x group with 6 updates (#23100)
Bumps the x group with 6 updates: | Package | From | To | | --- | --- | --- | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.48.0` | `0.49.0` | | [golang.org/x/mod](https://github.com/golang/mod) | `0.33.0` | `0.34.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.51.0` | `0.52.0` | | [golang.org/x/term](https://github.com/golang/term) | `0.40.0` | `0.41.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.34.0` | `0.35.0` | | [golang.org/x/tools](https://github.com/golang/tools) | `0.42.0` | `0.43.0` | Updates `golang.org/x/crypto` from 0.48.0 to 0.49.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/crypto/commit/982eaa62dfb7273603b97fc1835561450096f3bd"><code>982eaa6</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/crypto/commit/159944f128e9b3fdeb5a5b9b102a961904601a87"><code>159944f</code></a> ssh,acme: clean up tautological/impossible nil conditions</li> <li><a href="https://github.com/golang/crypto/commit/a408498e55412f2ae2a058336f78889fb1ba6115"><code>a408498</code></a> acme: only require prompt if server has terms of service</li> <li><a href="https://github.com/golang/crypto/commit/cab0f718548e8a858701b7b48161f44748532f58"><code>cab0f71</code></a> all: upgrade go directive to at least 1.25.0 [generated]</li> <li><a href="https://github.com/golang/crypto/commit/2f26647a795e74e712b3aebc2655bca60b2686f9"><code>2f26647</code></a> x509roots/fallback: update bundle</li> <li>See full diff in <a href="https://github.com/golang/crypto/compare/v0.48.0...v0.49.0">compare view</a></li> </ul> </details> <br /> Updates `golang.org/x/mod` from 0.33.0 to 0.34.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/mod/commit/1ac721dff8591283e59aba6412a0eafc8b950d83"><code>1ac721d</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/mod/commit/fb1fac8b369ec75b114cb416119e80d3aebda7f5"><code>fb1fac8</code></a> all: upgrade go directive to at least 1.25.0 [generated]</li> <li>See full diff in <a href="https://github.com/golang/mod/compare/v0.33.0...v0.34.0">compare view</a></li> </ul> </details> <br /> Updates `golang.org/x/net` from 0.51.0 to 0.52.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/net/commit/316e20ce34d380337f7983808c26948232e16455"><code>316e20c</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/net/commit/9767a42264fa70b674c643d0c87ee95c309a4553"><code>9767a42</code></a> internal/http3: add support for plugging into net/http</li> <li><a href="https://github.com/golang/net/commit/4a812844d820f49985ee15998af285c43b0a6b96"><code>4a81284</code></a> http2: update docs to disrecommend this package</li> <li><a href="https://github.com/golang/net/commit/dec6603c16144712aab7f44821471346b35a2230"><code>dec6603</code></a> dns/dnsmessage: reject too large of names early during unpack</li> <li><a href="https://github.com/golang/net/commit/8afa12f927391ba32da2b75b864a3ad04cac6376"><code>8afa12f</code></a> http2: deprecate write schedulers</li> <li><a href="https://github.com/golang/net/commit/38019a2dbc2645a4c06a1e983681eefb041171c8"><code>38019a2</code></a> http2: add missing copyright header to export_test.go</li> <li><a href="https://github.com/golang/net/commit/039b87fac41ca283465e12a3bcc170ccd6c92f84"><code>039b87f</code></a> internal/http3: return error when Write is used after status 304 is set</li> <li><a href="https://github.com/golang/net/commit/6267c6c4c825a78e4c9cbdc19c705bc81716597c"><code>6267c6c</code></a> internal/http3: add HTTP 103 Early Hints support to ClientConn</li> <li><a href="https://github.com/golang/net/commit/591bdf35bce56ad50f53555c3cbb31e4bdda2d58"><code>591bdf3</code></a> internal/http3: add HTTP 103 Early Hints support to Server</li> <li><a href="https://github.com/golang/net/commit/1faa6d8722697d9a1d8d4e973b3c46c7a5563f6c"><code>1faa6d8</code></a> internal/http3: avoid potential race when aborting RoundTrip</li> <li>Additional commits viewable in <a href="https://github.com/golang/net/compare/v0.51.0...v0.52.0">compare view</a></li> </ul> </details> <br /> Updates `golang.org/x/term` from 0.40.0 to 0.41.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/term/commit/9d2dc074d2bdcb2229cbbaa0a252eace245a6489"><code>9d2dc07</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/term/commit/d954e03213327a5b6380b6c2aec621192ee56007"><code>d954e03</code></a> all: upgrade go directive to at least 1.25.0 [generated]</li> <li>See full diff in <a href="https://github.com/golang/term/compare/v0.40.0...v0.41.0">compare view</a></li> </ul> </details> <br /> Updates `golang.org/x/text` from 0.34.0 to 0.35.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/text/commit/7ca2c6d99153f6456168837916829c735c67d355"><code>7ca2c6d</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/text/commit/73d1ba91404d0de47cb6a9b3fb52a31565ca4d25"><code>73d1ba9</code></a> all: upgrade go directive to at least 1.25.0 [generated]</li> <li>See full diff in <a href="https://github.com/golang/text/compare/v0.34.0...v0.35.0">compare view</a></li> </ul> </details> <br /> Updates `golang.org/x/tools` from 0.42.0 to 0.43.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/tools/commit/24a8e95f9d7ae2696f66314da5e50c0d98ccaa90"><code>24a8e95</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/tools/commit/3dd57fba1a6eed320cd9ea2b292cacdacda1e5e8"><code>3dd57fb</code></a> gopls/internal/mcp: refactor unified diff generation</li> <li><a href="https://github.com/golang/tools/commit/fcc014db2b644cc1e0a9d08157efab0156699ada"><code>fcc014d</code></a> cmd/digraph: fix package doc</li> <li><a href="https://github.com/golang/tools/commit/39f0f5c6d34afcb5664463f6e97c076187a305ea"><code>39f0f5c</code></a> cmd/stress: add -failfast flag</li> <li><a href="https://github.com/golang/tools/commit/063c2644e296d3154b4dcbfc15ebeb09e6f07290"><code>063c264</code></a> gopls/test/integration/misc: add diagnostics to flaky test</li> <li><a href="https://github.com/golang/tools/commit/deb6130cda665525d826291d591e988ace74f447"><code>deb6130</code></a> gopls/internal/golang: fix hover panic in raw strings with CRLF</li> <li><a href="https://github.com/golang/tools/commit/5f1186b97512a314f8a35509072d7657eaf7c60a"><code>5f1186b</code></a> gopls/internal/analysis/driverutil: remove unnecessary new imports</li> <li><a href="https://github.com/golang/tools/commit/ff454944261ad40f98abfc097fae89272ce40935"><code>ff45494</code></a> go/analysis: expose GoMod etc. to Pass.Module</li> <li><a href="https://github.com/golang/tools/commit/62daff4834809b6cce693f6f0dff1c2722cb6328"><code>62daff4</code></a> go/analysis/passes/inline: fix panic in inlineAlias with instantiated generic...</li> <li><a href="https://github.com/golang/tools/commit/fcb6088b9059538dd6bcbd5238c10ffdc71700b5"><code>fcb6088</code></a> x/tools: delete obsolete code</li> <li>Additional commits viewable in <a href="https://github.com/golang/tools/compare/v0.42.0...v0.43.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
d6306461bb |
feat(site): render computer tool screenshots as images in chat UI (#23074)
Instead of showing raw base64 JSON for Anthropic's computer use tool, render the screenshot as an inline image. The image is clickable to open at full resolution in a new tab. ## Changes - **ComputerTool.tsx** — New component that renders base64 image data as an `<img>` tag - **Tool.tsx** — Added `ComputerRenderer` handling both single-object and array-of-blocks result shapes - **ToolIcon.tsx** — Added `MonitorIcon` for the `computer` tool - **ToolLabel.tsx** — Added \Screenshot\ label for the `computer` tool |
||
|
|
cb05419872 | fix(site): inject time via prop for deterministic analytics story snapshots (#23092) | ||
|
|
29225252f6 |
chore: bump google.golang.org/api from 0.269.0 to 0.271.0 (#23102)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.269.0 to 0.271.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-api-go-client/releases">google.golang.org/api's releases</a>.</em></p> <blockquote> <h2>v0.271.0</h2> <h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.270.0...v0.271.0">0.271.0</a> (2026-03-10)</h2> <h3>Features</h3> <ul> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3532">#3532</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ccff5b35c0d730214473de122dcb96b110be0029">ccff5b3</a>)</li> </ul> <h2>v0.270.0</h2> <h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.269.0...v0.270.0">0.270.0</a> (2026-03-08)</h2> <h3>Features</h3> <ul> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3515">#3515</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/44db8ef7d07171dad68a5cc9026ab3f1cd77ef12">44db8ef</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3518">#3518</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b3dc663d78cba7be5dbd998a439edcdf4991b807">b3dc663</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3519">#3519</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/01c06b9034963e27855bf188049d1752fc2de525">01c06b9</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3520">#3520</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/7ed04540e547ca9cef1f9f48d54c1277f24773bf">7ed0454</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3521">#3521</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/d11f54e813163dfc52515d214065c67bc944c7ef">d11f54e</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3523">#3523</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ce39b40dedcd239ea2fb4a18aedf23ba61b8ae90">ce39b40</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3525">#3525</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/15b140d66a7b67dd6bfea7d1473bd2df4d878f95">15b140d</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3526">#3526</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/1b18158bb7807b1a5a9f73dd4ec450f274a81da8">1b18158</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3527">#3527</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/a932a454c4fd97dfc66f0cca97afeae231a7e4e9">a932a45</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3528">#3528</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/f6ede69e7094cf4f7353841d593867f087f06b84">f6ede69</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3529">#3529</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b73e4fbc0017249279922cb4c223e44f98cc5db9">b73e4fb</a>)</li> <li><strong>option/internaloption:</strong> Add more option introspection (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3524">#3524</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ac5da8f06619417a42c5e128dcb5aafcb1912353">ac5da8f</a>)</li> <li><strong>option/internaloption:</strong> Unsafe option resolver (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3514">#3514</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b263ceeb1a4062ae6cda17c49073d5051d96fc90">b263cee</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md">google.golang.org/api's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.270.0...v0.271.0">0.271.0</a> (2026-03-10)</h2> <h3>Features</h3> <ul> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3532">#3532</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ccff5b35c0d730214473de122dcb96b110be0029">ccff5b3</a>)</li> </ul> <h2><a href="https://github.com/googleapis/google-api-go-client/compare/v0.269.0...v0.270.0">0.270.0</a> (2026-03-08)</h2> <h3>Features</h3> <ul> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3515">#3515</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/44db8ef7d07171dad68a5cc9026ab3f1cd77ef12">44db8ef</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3518">#3518</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b3dc663d78cba7be5dbd998a439edcdf4991b807">b3dc663</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3519">#3519</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/01c06b9034963e27855bf188049d1752fc2de525">01c06b9</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3520">#3520</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/7ed04540e547ca9cef1f9f48d54c1277f24773bf">7ed0454</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3521">#3521</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/d11f54e813163dfc52515d214065c67bc944c7ef">d11f54e</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3523">#3523</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ce39b40dedcd239ea2fb4a18aedf23ba61b8ae90">ce39b40</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3525">#3525</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/15b140d66a7b67dd6bfea7d1473bd2df4d878f95">15b140d</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3526">#3526</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/1b18158bb7807b1a5a9f73dd4ec450f274a81da8">1b18158</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3527">#3527</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/a932a454c4fd97dfc66f0cca97afeae231a7e4e9">a932a45</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3528">#3528</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/f6ede69e7094cf4f7353841d593867f087f06b84">f6ede69</a>)</li> <li><strong>all:</strong> Auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3529">#3529</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b73e4fbc0017249279922cb4c223e44f98cc5db9">b73e4fb</a>)</li> <li><strong>option/internaloption:</strong> Add more option introspection (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3524">#3524</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/ac5da8f06619417a42c5e128dcb5aafcb1912353">ac5da8f</a>)</li> <li><strong>option/internaloption:</strong> Unsafe option resolver (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3514">#3514</a>) (<a href="https://github.com/googleapis/google-api-go-client/commit/b263ceeb1a4062ae6cda17c49073d5051d96fc90">b263cee</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-api-go-client/commit/e79327bd305ea52af1334ef6b5385cf7a5acbbdc"><code>e79327b</code></a> chore(main): release 0.271.0 (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3533">#3533</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/a3dde28f12bc0c1aaab4a8a74ad9f46b53d53004"><code>a3dde28</code></a> chore(deps): bump github.com/cloudflare/circl from 1.6.1 to 1.6.3 in /interna...</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/bad57c0a2c19b7e0e5f5083d911544cca340a98a"><code>bad57c0</code></a> chore(all): update all (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3530">#3530</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/ccff5b35c0d730214473de122dcb96b110be0029"><code>ccff5b3</code></a> feat(all): auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3532">#3532</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/15dd0b11d31423e7811736bbabe7e512a214f225"><code>15dd0b1</code></a> chore(option/internaloption): more accessors (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3531">#3531</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/ad5d5aa8fa892f0129604d9c139081cc99eb4700"><code>ad5d5aa</code></a> chore(main): release 0.270.0 (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3516">#3516</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/b73e4fbc0017249279922cb4c223e44f98cc5db9"><code>b73e4fb</code></a> feat(all): auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3529">#3529</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/f6ede69e7094cf4f7353841d593867f087f06b84"><code>f6ede69</code></a> feat(all): auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3528">#3528</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/7342fc24a37cfa818cf4834578e0198c1b5e0334"><code>7342fc2</code></a> chore(all): update all (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3522">#3522</a>)</li> <li><a href="https://github.com/googleapis/google-api-go-client/commit/a932a454c4fd97dfc66f0cca97afeae231a7e4e9"><code>a932a45</code></a> feat(all): auto-regenerate discovery clients (<a href="https://redirect.github.com/googleapis/google-api-go-client/issues/3527">#3527</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-api-go-client/compare/v0.269.0...v0.271.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
93ea5f5d22 |
chore: bump github.com/coder/terraform-provider-coder/v2 from 2.13.1 to 2.14.0 (#23101)
Bumps [github.com/coder/terraform-provider-coder/v2](https://github.com/coder/terraform-provider-coder) from 2.13.1 to 2.14.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/coder/terraform-provider-coder/releases">github.com/coder/terraform-provider-coder/v2's releases</a>.</em></p> <blockquote> <h2>v2.14.0</h2> <h2>What's Changed</h2> <ul> <li>build(deps): Bump golang.org/x/mod from 0.29.0 to 0.30.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/463">coder/terraform-provider-coder#463</a></li> <li>build(deps): Bump actions/checkout from 5 to 6 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/468">coder/terraform-provider-coder#468</a></li> <li>build(deps): Bump golang.org/x/crypto from 0.43.0 to 0.45.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/467">coder/terraform-provider-coder#467</a></li> <li>build(deps): Bump github.com/hashicorp/terraform-plugin-log from 0.9.0 to 0.10.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/465">coder/terraform-provider-coder#465</a></li> <li>fix: typo in data coder_external_auth example and docs by <a href="https://github.com/krispage"><code>@krispage</code></a> in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/420">coder/terraform-provider-coder#420</a></li> <li>feat: add confliction with <code>subdomain</code> by <a href="https://github.com/jakehwll"><code>@jakehwll</code></a> in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/469">coder/terraform-provider-coder#469</a></li> <li>build(deps): Bump golang.org/x/mod from 0.30.0 to 0.31.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/472">coder/terraform-provider-coder#472</a></li> <li>build(deps): Bump golang.org/x/mod from 0.31.0 to 0.32.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/473">coder/terraform-provider-coder#473</a></li> <li>feat: add <code>subagent_id</code> attribute to <code>coder_devcontainer</code> resource by <a href="https://github.com/DanielleMaywood"><code>@DanielleMaywood</code></a> in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/474">coder/terraform-provider-coder#474</a></li> <li>fix: embed timezone database via <code>time/tzdata</code> by <a href="https://github.com/mtojek"><code>@mtojek</code></a> in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/476">coder/terraform-provider-coder#476</a></li> <li>build(deps): Bump golang.org/x/mod from 0.32.0 to 0.33.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/477">coder/terraform-provider-coder#477</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/krispage"><code>@krispage</code></a> made their first contribution in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/420">coder/terraform-provider-coder#420</a></li> <li><a href="https://github.com/jakehwll"><code>@jakehwll</code></a> made their first contribution in <a href="https://redirect.github.com/coder/terraform-provider-coder/pull/469">coder/terraform-provider-coder#469</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/coder/terraform-provider-coder/compare/v2.13.1...v2.14.0">https://github.com/coder/terraform-provider-coder/compare/v2.13.1...v2.14.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/coder/terraform-provider-coder/commit/7fa3c10eaaf66dd1f67a14176a438cf05ec9e98e"><code>7fa3c10</code></a> build(deps): Bump golang.org/x/mod from 0.32.0 to 0.33.0 (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/477">#477</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/ef9a6dda578892cdcf7ab7cf920a732010b86151"><code>ef9a6dd</code></a> fix: embed timezone database via <code>time/tzdata</code> (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/476">#476</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/b6966bf427c6d9d418dd6a217fe8897bc15f618c"><code>b6966bf</code></a> feat: add <code>subagent_id</code> attribute to <code>coder_devcontainer</code> resource (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/474">#474</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/c9f205fca1ca25c70704be555ff524a46dff9f2e"><code>c9f205f</code></a> build(deps): Bump golang.org/x/mod from 0.31.0 to 0.32.0 (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/473">#473</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/7a81d185379885b6b30a96a40fd8e5f7eee2640c"><code>7a81d18</code></a> build(deps): Bump golang.org/x/mod from 0.30.0 to 0.31.0 (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/472">#472</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/76bda72ec5f47be88edd6d0c1347802609b1d041"><code>76bda72</code></a> feat: add confliction with <code>subdomain</code> (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/469">#469</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/aee79c41a4e4f6770db90291dffe01c53667d8dc"><code>aee79c4</code></a> fix: typo in data coder_external_auth example and docs (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/420">#420</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/9cfd35f441fa567150ecd5aa97c5f854a2800182"><code>9cfd35f</code></a> build(deps): Bump github.com/hashicorp/terraform-plugin-log (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/465">#465</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/dd6246532b4f0047c0125bdcd70f6e900ca69d65"><code>dd62465</code></a> build(deps): Bump golang.org/x/crypto from 0.43.0 to 0.45.0 (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/467">#467</a>)</li> <li><a href="https://github.com/coder/terraform-provider-coder/commit/60377bb12b7593f11f23a986e8a386d5566a0718"><code>60377bb</code></a> build(deps): Bump actions/checkout from 5 to 6 (<a href="https://redirect.github.com/coder/terraform-provider-coder/issues/468">#468</a>)</li> <li>Additional commits viewable in <a href="https://github.com/coder/terraform-provider-coder/compare/v2.13.1...v2.14.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
9a6356513b |
chore: bump rust from d6782f2 to 7d37016 in /dogfood/coder (#23103)
Bumps rust from `d6782f2` to `7d37016`. [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
069d3e2beb |
fix(coderd): require ssh access for workspace chats (#23094)
### Motivation - The chat creation flow associated a workspace agent for a chat if the requester could read the workspace, enabling privilege escalation where users without SSH/app-connect permissions could cause the daemon to open privileged agent connections and execute commands. - The intent is to ensure that attaching a workspace agent to a chat only happens when the requester has the workspace SSH permission so the chat daemon cannot be abused to bypass RBAC. ### Description - Require request-scoped authorization for workspace agent usage by changing `validateCreateChatWorkspaceSelection` to accept the `*http.Request` and calling `api.Authorize(r, policy.ActionSSH, workspace)` before selecting the workspace for a chat. - Pass the HTTP request into the validator from `postChats` so authorization is evaluated in the request context (`postChats` now calls `validateCreateChatWorkspaceSelection(ctx, r, req)`). - Add a regression test `WorkspaceAccessibleButNoSSH` in `coderd/chats_test.go` which creates an org-admin-scoped user (read access but no `ActionSSH`) and asserts that creating a chat with `WorkspaceID` is denied. ### Testing - Ran `gofmt -w coderd/chats.go coderd/chats_test.go` which succeeded. - Attempted to run repository pre-commit checks (`make pre-commit`) and targeted `go test` invocations; these checks could not be completed in this environment due to missing local tooling and environment constraints (protobuf include resolution, containerized DB access via Docker socket, and long-running golden generation tasks), so full CI/pre-commit verification and end-to-end test runs did not complete here. - Added a focused regression unit test (`WorkspaceAccessibleButNoSSH`) to prevent reintroduction of the authorization bypass; this test is included in the change and should be executed in CI where the full toolchain and test environment are available. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_b_69b432502670832e91d14e937745de46) |
||
|
|
aa6f301305 |
ci: add conventional commit PR title linting (#23096)
Restore PR title validation that was removed in
|
||
|
|
ae8bed4d8e |
feat(site): improve DERP health page readability (#22984)
## Why The DERP health page displayed raw field names like `MappingVariesByDestIP`, `PMP`, `PCP`, `HairPinning` with no context. Users without deep networking knowledge had no way to understand what these flags meant or why they mattered. This change makes the page self-documenting. ## What - DERPPage (`/health/derp`) - Replace flat pill row with four logically grouped tables: **Connectivity**, **IPv6 Support**, **NAT Traversal**, **Port Mapping**. - Rename section from "Flags" to "Network Checks". - Surface `CaptivePortal` flag (previously missing from the UI entirely). - Invert display of `MappingVariesByDestIP` and `CaptivePortal` so green always means good. - Handle `null` boolean fields (e.g. UPnP, PMP, PCP) with a distinct "not checked" neutral icon. - DERPRegionPage (`/health/derp/regions/:regionId`) - Replace per-node `BooleanPill` row with a table showing **Exchange Messages**, **Direct HTTP Upgrade**, **STUN Enabled**, and **STUN Reachable** per node. - Invert `uses_websocket` display as "Direct HTTP Upgrade" (green when websocket is not needed). - Surface **STUN Enabled** and **STUN Reachable** per node (data was returned by the API but never rendered). - Add null guards for `region` and `node` (remove `!` non-null assertions). - Convert all emotion/MUI styles to Tailwind classes; remove `reportStyles` object and `useTheme` import. - Content.tsx (shared) - Adds an exported `StatusIcon` component with three states: `true` (green check), `false` (red minus), `null` (neutral help icon). |
||
|
|
703b974757 |
fix(coderd): remove false devcontainers early access warning (#23056)
The script source claimed Dev Containers are early access and told users to set CODER_AGENT_DEVCONTAINERS_ENABLE=true, which already defaults to true. Clear the script source and set RunOnStart to false since there is nothing to run. |