Skip to content

chore: sync upstream 17a2b62205 - #390

Merged
ibetitsmike merged 7 commits into
mainfrom
mike/issue-362-sync-upstream-17a2b62205
Nov 19, 2026
Merged

ibetitsmike merged 7 commits into
mainfrom
mike/issue-362-sync-upstream-17a2b62205

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Merge upstream coder/coder@17a2b62205 (feat: add an API to attach templates to chat projects) into fork main aac1b474a4.

Clean merge, no conflicts. Fork behavior verified intact:

  • registerForkChatRoutes hook, fork agent proto tags (100/200), fork experiment fields, fork-only queued/soft-delete queries all present.
  • Fork GLM reasoning-effort hook (forkOpenAICompatReasoningEffort) survives upstream's OpenAI low-floor prefix refactor.
  • No new migrations; 000644_chat_project_templates was already merged in chore: sync upstream 7c7e2e73cf #389, so no chatdmig routing needed.

Upstream additions: chat project template attach/detach API (PUT/DELETE /api/experimental/organizations/{org}/chats/projects/{project}/templates/{template}), GPT-6.2 Astra/Sol model entries, agents page overview card, dark theme success token and diff file tree fixes.

Validation: full-tree go vet clean (one pre-existing finding in an untouched file); chatd/db suites that link locally pass; remaining local link failures are the known Mac tailscale-mono env issue, identical on pre-merge main (negative control). fork-ci is the build and test gate.

DanielleMaywood and others added 7 commits November 18, 2026 09:58
Fixes DEQ-172 (WCAG 1.4.3 Contrast (Minimum)) on the AI Gateway session
threads page.

In the dark theme, "Agentic loop completed" and "Session completed" use
`text-content-success` (`#16A249`), which axe Auditor measured at 4.46:1
against `#27272A`. This moves the two dark theme success tokens that
used green-600 (`142 76% 36%`), `--content-success` and
`--border-success`, to green-500 (`142 71% 45%`, `#22C55E`). The dark
theme already uses that green for `--git-added-bright` and
`--chart-success-border`, and success text and borders stay the same
green.

| Background | Before (`#16A249`) | After (`#22C55E`) |
|---|---|---|
| `surface-primary` `#09090B` | 5.94 | 8.66 |
| `surface-secondary` `#18181B` | 5.29 | 7.71 |
| `surface-tertiary` `#27272A` | 4.45 | 6.48 |
| `surface-green` | 4.45 | 6.49 |

These tokens are global, so every dark theme success color gets slightly
brighter. That covers success text, fills, and borders, for example
health checks, `LastSeen`, toasts, status indicators, agent status
borders, and template builder steps. This is intended: it lifts all
success text above 4.5:1 rather than patching one page.

Not changed:

- Light theme: `--content-success` is green-700 and `--border-success`
is green-600. Green-500 is 2.3:1 on white, which would fail 1.4.3 for
text and 1.4.11 for borders.
- Colorblind themes: they override these tokens with their own values.

| | Before | After |
|---|---|---|
| Success text (`SessionTimeline/SecondThreadLoopOpen`) |
![before](https://raw.githubusercontent.com/coder/coder/fd85abb769318f2dc9f2f6e3559d837f3947defd/before.png)
|
![after](https://raw.githubusercontent.com/coder/coder/fd85abb769318f2dc9f2f6e3559d837f3947defd/after.png)
|
| Success border (`SelectionSummary/WithModules`) | ![border
before](https://raw.githubusercontent.com/coder/coder/fd85abb769318f2dc9f2f6e3559d837f3947defd/border-before.png)
| ![border
after](https://raw.githubusercontent.com/coder/coder/fd85abb769318f2dc9f2f6e3559d837f3947defd/border-after.png)
|

Screenshots: Storybook, dark theme.

> Generated by Coder Agents on behalf of @chrifro.
…tainer (coder#31590)

Adds `ChatOverviewCard`, the container that builds the overview card's
data and renders `ChatOverviewCardView` from coder#31409. Nothing mounts it
yet, so this PR changes no page. coder#31412 mounts it in the chat.

The container reads the chat cost query, the git watcher's repositories,
the pull request statuses, the subagent statuses, and the attachments
from `useChatAttachments` (coder#31411). `getOverviewCost` turns the cost
query into the card's three cost states. When the earlier attachments
fail to load, the container passes the request to the view. Attachments
then shows the same one-line "Failed to get attachments" alert with a
**Retry** button as the Summary panel.

I split this PR out of coder#31412 when that PR grew past 600 changed lines.
The code is the same container that coder#31412 reviewed before, without the
top bar toggle, which stays in coder#31412 with its only caller.

| `Default` | `EarlierAttachmentsError` |
|---|---|
| ![The overview card container with cost, a repository, and a pull
request](https://raw.githubusercontent.com/coder/coder/aade3c26e40f84d6fbe77a64714e00199eafe14d/pr/container-default.png)
| ![The overview card container with a failed earlier attachments
request: the one-line error and Retry in
Attachments](https://raw.githubusercontent.com/coder/coder/aade3c26e40f84d6fbe77a64714e00199eafe14d/pr/container-attachments-error.png)
|

## How to test

1. Open Storybook at `pages/AgentsPage/ChatOverviewCard`, stories
`Default` and `EarlierAttachmentsError`.
2. Run `pnpm test
src/pages/AgentsPage/components/ChatOverviewCard.test.tsx` in `site/`.
The page test in coder#31412 checks that **Retry** requests the earlier
attachments again.

## What to look at first

1. `ChatOverviewCard`: one place builds the `ChatOverview` model from
the queries and the chat store.
2. `getOverviewCost`: a failed refetch keeps the cost that loaded, and a
chat without AI Gateway requests has no cost row.

<details>
<summary>Review history</summary>

This container was reviewed as part of coder#31412 through three
frontend-deep-review rounds, a code quality review, a polish pass, and a
final review round. It moved here in the follow-up pass that fixed the
open follow-ups:

- The container now passes `earlierAttachmentsRequest` to the view, so a
failed request shows its error and a retry.
- `GitPanel/gitViews.ts` exports `countRepoChanges` here, where its
first caller arrives.
- Each repository row gets its `name` from `repoLabel(root)` and its
trimmed `branch`, which the view shows as the subtitle, or "No branch"
when it is empty.
- The stories are new. They give the container's error state a
screenshot. The stories have no `play` assertions, because the page test
in coder#31412 covers the retry request.

After coder#31411 merged, this branch was rebased onto `main` with no
conflicts and now targets `main`. It picks up the smaller
`AttachmentsErrorAlert` from coder#31411 without code changes here, so the
screenshots above are new.

</details>

---
_Generated with [`xum`](https://github.com/coder/xum) • Model:
`anthropic:claude-opus-5-5` • Thinking: `high`_

---------

Co-authored-by: Jaayden Halko <[email protected]>
…2387)

Pins the `wingetcreate.exe` that `publish-winget` downloads and checks
its SHA-256 before running it. The job runs in the `release-publish`
environment with cdrci's token, so it shouldn't run whatever
`aka.ms/wingetcreate/latest` currently points at.

## Changes (`.github/workflows/release.yaml`, `publish-winget` job)

- Downloads `wingetcreate.exe` from the GitHub release `v1.28.1.0` of
microsoft/winget-create, not `https://aka.ms/wingetcreate/latest`.
- Fails if the file's SHA-256 isn't
`63d980ba79e97042395bd6eb5992c2db9e01e9e7a8a22958a95c288f27310413`, and
deletes the file.
- Keeps the output path `.\wingetcreate.exe`, so the next step doesn't
change.
- To upgrade, change `WINGETCREATE_VERSION` and `WINGETCREATE_SHA256`
together. The comment above the step says where to find both.

## Where the hash comes from

- **Same build as now:** `aka.ms/wingetcreate/latest` currently
redirects to `releases/download/v1.28.1.0/wingetcreate.exe`, so releases
already use this binary.
- **Three sources agree on the hash:**
  - my own download;
  - GitHub's asset digest for `wingetcreate.exe`;
- the `wingetcreate.exe.txt` checksum file Microsoft publishes in the
same release.
- **Signature:** the binary carries a Microsoft Authenticode signature.

coder/coder-desktop-windows#196 pins the same version and hash.

## Checks

- `actionlint .github/workflows/release.yaml`: clean.
- `zizmor --offline .github/workflows/release.yaml`: no errors or
warnings, on `main` or on this branch.

---

AI disclosure: an AI coding agent (Xum) wrote this change and ran the
checks above at my direction. It stays a draft until I've reviewed it.
…er#32370)

Closes CODAGT-1608

This adds `gpt-6.2-astra` and `gpt-6.2-sol` to the Agents known models
catalog, so they're suggested when an admin adds a chat model, and
regenerates the AI Gateway price book from models.dev so the gateway can
price them.

| Model | Input | Output | Cache read | Cache write |
|---|---|---|---|---|
| GPT-6.2 Astra | $8 | $40 | $0.40 | $10 |
| GPT-6.2 Sol | $2 | $10 | $0.10 | $2.50 |

Prices are per 1M tokens, and both models have a 1,050,000 token context
window and 128,000 max output tokens. They're in the catalog for OpenAI
(with a suggested effort of `medium`, same as `gpt-6-astra` and
`gpt-6.1-sol`), OpenRouter and Vercel. models.dev doesn't list them on
Azure or Bedrock yet, so I've left those out for now.

Both models also reject the `none` and `minimal` reasoning efforts. A
model config only sets a default and a maximum effort, so the picker
always offers both, and picking either one fails the turn:

```
Unsupported value: 'none' is not supported with the 'gpt-6.2-astra' model. Supported values are: 'low', 'medium', 'high', 'xhigh', and 'max'.
```

We already send `low` instead for `gpt-6-astra` and `gpt-6.1-sol`, so to
fix, we'll just do the same for the two new models. All four now live in
one list of model ID prefixes, rather than a helper each. I checked this
against the real models: all four return a 400 like the one above for
`none` and `minimal`, and accept `low`. `gpt-6-sol` and `gpt-6.1-terra`
still accept `none`, so they're left alone.

Regenerating the price book also brings in everything else models.dev
changed since the last weekly refresh, mostly on OpenRouter and Vercel:
22 other new entries (4 of them `-pro` and `-fast` variants of these
two), 29 it dropped and 51 price changes. 6 existing catalog entries get
new prices or limits the same way.
Adds the API for attaching workspace templates to a chat project, on the
schema and queries in coder#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`;
coder#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):
- coder#32309
- coder#30754 👈
- coder#32310
- coder#30755
- coder#32371
- coder#32372
- coder#30756
- coder#32373
- coder#32374
- coder#32375
- coder#30898
- coder#32376
- coder#32377
- coder#32378
- coder#32379
@ibetitsmike ibetitsmike added the sync Upstream sync label Nov 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T14:34:57.525602Z dc1677a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike
ibetitsmike merged commit e358fe5 into main Nov 19, 2026
11 checks passed
@ibetitsmike
ibetitsmike deleted the mike/issue-362-sync-upstream-17a2b62205 branch November 19, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sync Upstream sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants