Repository navigation
Conversation
A default template takes either a preset or parameter values. The values use the shared DynamicParameter fields of the workspace creation form: the dialog evaluates the template's active version with the values set so far, as the signed-in user, so each parameter gets its own kind of input and conditional parameters appear and disappear as they do when creating a workspace. Only changed values are saved as project defaults. The template's validation messages are shown but do not block saving, because the server validates when a workspace is created.
|
@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: 8b9e4dd760
ℹ️ 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".
| key={template.active_version_id} | ||
| templateVersionId={template.active_version_id} | ||
| value={value.defaultParameters} |
There was a problem hiding this comment.
Reset defaults when the active template version changes
When the templates query first renders cached data and its mount refetch returns the same template with a new active_version_id, this key remounts only the child while value.defaultParameters still contains values from the old version. Those stale values are immediately evaluated and later submitted against the new version; parameters removed by a dynamic version can be silently retained until workspace creation, while a classic version rejects them when the project is saved. Clear or version-scope the parameter map when active_version_id changes rather than relying on the component key.
AGENTS.md reference: site/AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
| onChange={onChange} | ||
| disabled={disabled} |
There was a problem hiding this comment.
Disable tag-select parameters during submission
When a template exposes a tag-select parameter and the project save is in flight, passing disabled here does not disable that control: the tag-select branch of DynamicParameter renders TagInput without forwarding or implementing a disabled state. Every other field is locked, but users can still add or remove tags after the submitted payload has already been captured, leaving the dialog showing values that were not saved.
Useful? React with 👍 / 👎.
…ect-templates/default-parameters
…ect-templates/default-parameters
…ect-templates/default-parameters
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
…ect-templates/default-parameters
Lets a project's default template take default parameter values instead of a preset.
Under the default template, Preset or Parameter values picks which of the two is saved. Parameter values use the shared
DynamicParameterfields of the workspace creation form. The dialog evaluates the template's active version throughPOST /templateversions/{id}/dynamic-parameters/evaluatewith the values set so far, as the signed-in user, so each parameter gets its own kind of input, and parameters that depend on other values appear and disappear as they do when creating a workspace.The screenshot is from a local instance. The template's EU zone parameter only exists while Region is Europe, and Memory (GB) shows the template's own validation message.
Split out of #30756.
Stack (merge top to bottom):