Skip to content

Commit 494ad9b

Browse files
authored
fix(copilot): remove hardcoded model enum to allow any Copilot model (#833)
The `copilot_model` variable was restricted to a hardcoded enum of three models (`claude-sonnet-4`, `claude-sonnet-4.5`, `gpt-5`). Models change fast and this validation was blocking users from using newer models. ## Changes - Remove `validation` block from `copilot_model` variable in `main.tf` - Update variable description to indicate any Copilot-supported model can be used - Replace enum validation test with a test that verifies arbitrary model strings are accepted - Bump module version to `0.4.1` in README examples Closes #832 > 🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑‍💻
1 parent 5ee68d0 commit 494ad9b

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

registry/coder-labs/modules/copilot/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run [GitHub Copilot CLI](https://docs.github.com/copilot/concepts/agents/about-c
1313
```tf
1414
module "copilot" {
1515
source = "registry.coder.com/coder-labs/copilot/coder"
16-
version = "0.4.0"
16+
version = "0.4.1"
1717
agent_id = coder_agent.example.id
1818
workdir = "/home/coder/projects"
1919
}
@@ -51,7 +51,7 @@ data "coder_parameter" "ai_prompt" {
5151
5252
module "copilot" {
5353
source = "registry.coder.com/coder-labs/copilot/coder"
54-
version = "0.4.0"
54+
version = "0.4.1"
5555
agent_id = coder_agent.example.id
5656
workdir = "/home/coder/projects"
5757
@@ -71,7 +71,7 @@ Customize tool permissions, MCP servers, and Copilot settings:
7171
```tf
7272
module "copilot" {
7373
source = "registry.coder.com/coder-labs/copilot/coder"
74-
version = "0.4.0"
74+
version = "0.4.1"
7575
agent_id = coder_agent.example.id
7676
workdir = "/home/coder/projects"
7777
@@ -142,7 +142,7 @@ variable "github_token" {
142142
143143
module "copilot" {
144144
source = "registry.coder.com/coder-labs/copilot/coder"
145-
version = "0.4.0"
145+
version = "0.4.1"
146146
agent_id = coder_agent.example.id
147147
workdir = "/home/coder/projects"
148148
github_token = var.github_token
@@ -156,7 +156,7 @@ Run Copilot as a command-line tool without task reporting or web interface. This
156156
```tf
157157
module "copilot" {
158158
source = "registry.coder.com/coder-labs/copilot/coder"
159-
version = "0.4.0"
159+
version = "0.4.1"
160160
agent_id = coder_agent.example.id
161161
workdir = "/home/coder"
162162
report_tasks = false
@@ -179,7 +179,7 @@ module "aibridge-proxy" {
179179
180180
module "copilot" {
181181
source = "registry.coder.com/coder-labs/copilot/coder"
182-
version = "0.4.0"
182+
version = "0.4.1"
183183
agent_id = coder_agent.main.id
184184
workdir = "/home/coder/projects"
185185
enable_aibridge_proxy = true

registry/coder-labs/modules/copilot/copilot.tftest.hcl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,23 @@ run "copilot_model_not_created_for_default" {
117117
}
118118
}
119119

120-
run "model_validation_accepts_valid_models" {
120+
run "copilot_model_accepts_custom_model" {
121121
command = plan
122122

123123
variables {
124124
agent_id = "test-agent"
125125
workdir = "/home/coder"
126-
copilot_model = "gpt-5"
126+
copilot_model = "o3-pro"
127127
}
128128

129129
assert {
130-
condition = contains(["claude-sonnet-4", "claude-sonnet-4.5", "gpt-5"], var.copilot_model)
131-
error_message = "Model should be one of the valid options"
130+
condition = var.copilot_model == "o3-pro"
131+
error_message = "copilot_model should accept any model string"
132+
}
133+
134+
assert {
135+
condition = length(resource.coder_env.copilot_model) == 1
136+
error_message = "copilot_model env var should be created for non-default model"
132137
}
133138
}
134139

registry/coder-labs/modules/copilot/main.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ variable "github_token" {
3333

3434
variable "copilot_model" {
3535
type = string
36-
description = "Model to use. Supported values: claude-sonnet-4, claude-sonnet-4.5 (default), gpt-5."
36+
description = "The model to use for Copilot. Any model supported by GitHub Copilot can be used."
3737
default = "claude-sonnet-4.5"
38-
validation {
39-
condition = contains(["claude-sonnet-4", "claude-sonnet-4.5", "gpt-5"], var.copilot_model)
40-
error_message = "copilot_model must be one of: claude-sonnet-4, claude-sonnet-4.5, gpt-5."
41-
}
4238
}
4339

4440
variable "copilot_config" {

0 commit comments

Comments
 (0)