mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
04cc983833
The chat tools (`read_template`, `create_workspace`) did not surface or respect template version presets. Presets were invisible to the LLM and preset parameter defaults were never applied at workspace creation. The `toolsdk` MCP surface had the same gap (ref #24695, now subsumed here). ## What this changes - **`read_template`** returns presets with `id`, `name`, `default`, `description`, `icon`, `parameters`, and `desired_prebuild_instances` (when set), so the LLM can pick the right preset and prefer prebuilt-backed ones. - **`create_workspace`** accepts a `preset_id`. The wsbuilder applies preset parameter defaults and may claim a prebuilt workspace. - **`start_workspace`** does *not* accept a preset. Presets are a creation-time choice; subsequent starts use the workspace's existing version and parameters. Users who need a specific preset or version on an existing chat can create the workspace out-of-band (CLI / UI / API) with the desired configuration and attach the chat to it. - **`toolsdk`** gains `GetTemplate` (with presets including `desired_prebuild_instances`), preset support on `CreateWorkspace`, and preset + `rich_parameters` support on `CreateWorkspaceBuild`. The `template_version_preset_id` description warns about preset/version affinity. > 🤖 Generated with [Coder Agents](https://coder.com/agents) and reviewed by a human. Co-authored-by: Max schwenk <maschwenk@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
14 lines
620 B
Go
14 lines
620 B
Go
package coderd
|
|
|
|
// InsertAgentChatTestModelConfig exposes insertAgentChatTestModelConfig for external tests.
|
|
var InsertAgentChatTestModelConfig = insertAgentChatTestModelConfig
|
|
|
|
// ChatStartWorkspace exposes chatStartWorkspace for external tests.
|
|
//
|
|
// chatStartWorkspace is intentionally unexported to keep symmetry with
|
|
// its sister chatCreateWorkspace. The alias lets external tests drive
|
|
// the RequireActiveVersion auto-update path end-to-end without
|
|
// stubbing the entire DB layer. The proper fix is to extract a pure
|
|
// request builder; tracked in CODAGT-292.
|
|
var ChatStartWorkspace = (*API).chatStartWorkspace
|