Repository navigation
Conversation
… editing The Edit templates dialog refreshes the project and the eligible templates when it opens and when the window regains focus. An untouched draft follows newer templates. An edited draft keeps its changes and blocks Save behind the Keep my draft / Load latest warning that the instructions editor uses. Keeping the draft applies its changes to the newer templates instead of replacing them. Save pauses while a refresh runs, and after a failed refresh until Retry succeeds.
This was referenced Nov 18, 2026
Draft
Collaborator
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d15d9b047f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…templates/edit-conflicts
…templates/edit-conflicts
…templates/edit-conflicts
jaaydenh
added a commit
that referenced
this pull request
Nov 18, 2026
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
…templates/edit-conflicts
…templates/edit-conflicts
…templates/edit-conflicts # Conflicts: # site/src/pages/AgentsPage/components/ProjectPage/ProjectTemplatesDialog.test.tsx # site/src/pages/AgentsPage/components/ProjectPage/ProjectTemplatesDialog.tsx # site/src/pages/AgentsPage/components/ProjectPage/projectTemplatesDraft.ts
… by its busy state The retry tests waited on Save's aria-disabled attribute. They now find Save once it is no longer busy, which does not depend on how the button shows that it is unavailable. Also removes the Conflict story's comment, which restated its name.
…templates/edit-conflicts
…flict stories' render and newer project The Conflict story's render and its newer project move to named constants, so the story that finds the conflict on save can reuse them. The retry tests use the shared Save lookup.
…templates/edit-conflicts # Conflicts: # site/src/pages/AgentsPage/components/ProjectPage/ProjectTemplatesDialog.tsx # site/src/pages/AgentsPage/components/ProjectPage/projectTemplatesDraft.ts
…ough one helper in the panel tests
…templates/edit-conflicts
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A project's templates are shared by everyone who can edit the project, so the Edit templates dialog now notices templates saved elsewhere while it is open. Before this PR a draft could undo them.
ProjectEditConflictAlertthat the instructions editor uses. Keeping the draft applies its changes to the newer templates instead of replacing them: templates someone else attached or detached stay that way, and where both changed the limit or the default template, the draft wins.What to look at:
rebaseValuesinprojectTemplatesDraft.tsdecides what Keep my draft saves.#32377 closes the gap that remains, a save made elsewhere between the last refresh and Save.
Split out of #30898.
Stack (merge top to bottom):