Repository navigation
Conversation
list_templates, read_template and create_workspace only use the chat project's templates, list_templates recommends the project's default template, and create_workspace applies the project's default preset or parameter values when the model leaves them out.
|
@codex review |
Codex Review SummaryThis 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: 0e47e1b179
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67d1f82444
ℹ️ 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".
| for _, name := range slices.Sorted(maps.Keys(project.defaultParameters)) { | ||
| if _, ok := args.Parameters[name]; ok { | ||
| continue | ||
| } | ||
| req.RichParameterValues = append(req.RichParameterValues, codersdk.WorkspaceBuildParameter{ | ||
| Name: name, | ||
| Value: project.defaultParameters[name], | ||
| }) |
There was a problem hiding this comment.
Revalidate defaults against the current active version
When a project's default template activates a new version after the project was saved, an existing default parameter can become invalid under the new version's type, options, or validation rules. These lines still send the stale value unconditionally, so every create_workspace call that omits that parameter can fail build validation until the project is edited; the neighboring preset path already handles this same active-version drift by checking and skipping stale presets. Validate or safely skip stale parameter defaults before adding them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same as the thread on #30754: defaults are resolved against the current active version at use time. A stale preset is skipped, and an invalid parameter value fails the build with an error returned to the model, so it can retry without the value.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2d4d5dac4
ℹ️ 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".
…ctive version create_workspace passed an explicit preset_id through unchecked. Workspace creation claims prebuilds by preset ID alone, so a preset from another template could bind a workspace outside the project's templates.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c4c0c3561
ℹ️ 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".
| case err != nil: | ||
| logger.Warn(ctx, "failed to load presets for project default preset", slog.Error(err)) |
There was a problem hiding this comment.
Propagate default-preset lookup failures
When GetPresetsByTemplateVersionID fails due to a transient database error, this branch logs the error and continues creating and binding the workspace without the project's configured default preset. Since later create_workspace calls return the already-bound workspace, the model cannot retry and may be left with permanently incorrect parameters or resources. Return a tool error instead of treating lookup failures like stale presets; the parameter lookup failure in presetSetsParameter should be handled similarly.
Useful? React with 👍 / 👎.
Makes the chat template tools follow the chat project's template list from the previous PR.
list_templatesonly lists the project's templates and returnsNextStepNoTemplatesfor a project without any. The project's default template becomesrecommended_template_id.read_templateandcreate_workspacereject templates outside the list.read_templateincludesproject_defaultsfor the default template.create_workspacefills in the project's default preset or parameter values that the model did not pass. Values the model passes win, and a default preset that no longer belongs to the template's active version is skipped and logged rather than failing the build.Stack (merge top to bottom):