Skip to content

Commit feb50f7

Browse files
chore: deprecate coder_ai_task and coder_task (#539)
* chore: deprecate coder_ai_task and coder_task Coder Tasks is deprecated as of Coder v2.36 and superseded by Coder Agents. Mark the coder_ai_task resource, the coder_task data source and their attributes as deprecated so Terraform emits warnings and the registry docs point at the migration guide. * chore: deprecate nested sidebar_app.id and exported AI task types Also fixes a broken reference in the coder_task example, which pointed at a non-existent coder_ai_task data source. * fix: correct Tasks deprecation to v2.34 and add ESR wording --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
1 parent 91c5b76 commit feb50f7

4 files changed

Lines changed: 46 additions & 11 deletions

File tree

docs/data-sources/task.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ page_title: "coder_task Data Source - terraform-provider-coder"
44
subcategory: ""
55
description: |-
66
Use this data source to read information about Coder Tasks.
7+
~> Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use Coder Agents https://coder.com/docs/ai-coder/agents and follow the migration guide https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration. Coder Tasks documentation remains available in the v2.36 documentation https://coder.com/docs/@v2.36.3/ai-coder/tasks.
78
---
89

910
# coder_task (Data Source)
1011

1112
Use this data source to read information about Coder Tasks.
1213

14+
~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use [Coder Agents](https://coder.com/docs/ai-coder/agents) and follow the [migration guide](https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration). Coder Tasks documentation remains available in the [v2.36 documentation](https://coder.com/docs/@v2.36.3/ai-coder/tasks).
15+
1316
## Example Usage
1417

1518
```terraform
@@ -25,7 +28,7 @@ resource "coder_ai_task" "task" {
2528
2629
module "example-agent" {
2730
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
28-
prompt = data.coder_ai_task.me.prompt
31+
prompt = data.coder_task.me.prompt
2932
}
3033
```
3134

@@ -34,10 +37,10 @@ module "example-agent" {
3437

3538
### Read-Only
3639

37-
- `enabled` (Boolean) True when executing in a Coder Task context, false when in a Coder Workspace context.
40+
- `enabled` (Boolean, Deprecated) True when executing in a Coder Task context, false when in a Coder Workspace context.
3841

3942
-> The `enabled` field is only populated in Coder v2.28 and later.
4043
- `id` (String) The UUID of the task, if executing in a Coder Task context. Empty in a Coder Workspace context.
41-
- `prompt` (String) The prompt text provided to the task by Coder, if executing in a Coder Task context. Empty in a Coder Workspace context.
44+
- `prompt` (String, Deprecated) The prompt text provided to the task by Coder, if executing in a Coder Task context. Empty in a Coder Workspace context.
4245

4346
-> The `prompt` field is only populated in Coder v2.28 and later.

docs/resources/ai_task.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,32 @@ page_title: "coder_ai_task Resource - terraform-provider-coder"
44
subcategory: ""
55
description: |-
66
Use this resource to define Coder tasks.
7+
~> Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use Coder Agents https://coder.com/docs/ai-coder/agents and follow the migration guide https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration. Coder Tasks documentation remains available in the v2.36 documentation https://coder.com/docs/@v2.36.3/ai-coder/tasks.
78
---
89

910
# coder_ai_task (Resource)
1011

1112
Use this resource to define Coder tasks.
1213

14+
~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use [Coder Agents](https://coder.com/docs/ai-coder/agents) and follow the [migration guide](https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration). Coder Tasks documentation remains available in the [v2.36 documentation](https://coder.com/docs/@v2.36.3/ai-coder/tasks).
15+
1316

1417

1518
<!-- schema generated by tfplugindocs -->
1619
## Schema
1720

1821
### Optional
1922

20-
- `app_id` (String) The ID of the `coder_app` resource that provides the AI interface for this task.
23+
- `app_id` (String, **Deprecated**: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release.) The ID of the `coder_app` resource that provides the AI interface for this task.
2124
- `sidebar_app` (Block Set, Max: 1, Deprecated) The coder_app to display in the sidebar. Usually a chat interface with the AI agent running in the workspace, like https://github.com/coder/agentapi. (see [below for nested schema](#nestedblock--sidebar_app))
2225

2326
### Read-Only
2427

25-
- `enabled` (Boolean) True when executing in a Coder Task context, false when in a Coder Workspace context.
28+
- `enabled` (Boolean, Deprecated) True when executing in a Coder Task context, false when in a Coder Workspace context.
2629

2730
-> The `enabled` field is only populated in Coder v2.28 and later.
2831
- `id` (String) A unique identifier for this resource.
29-
- `prompt` (String) The prompt text provided to the task by Coder.
32+
- `prompt` (String, Deprecated) The prompt text provided to the task by Coder.
3033

3134
-> The `prompt` field is only populated in Coder v2.28 and later.
3235

@@ -35,4 +38,4 @@ Use this resource to define Coder tasks.
3538

3639
Required:
3740

38-
- `id` (String) A reference to an existing `coder_app` resource in your template.
41+
- `id` (String, Deprecated) A reference to an existing `coder_app` resource in your template.

examples/data-sources/coder_task/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ resource "coder_ai_task" "task" {
1010

1111
module "example-agent" {
1212
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
13-
prompt = data.coder_ai_task.me.prompt
13+
prompt = data.coder_task.me.prompt
1414
}

provider/ai_task.go

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,47 @@ import (
1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1111
)
1212

13+
// Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in
14+
// a future release. Use Coder Agents instead:
15+
// https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration
1316
type AITask struct {
1417
ID string `mapstructure:"id"`
1518
SidebarApp []AITaskSidebarApp `mapstructure:"sidebar_app"`
1619
Prompt string `mapstructure:"prompt"`
1720
AppID string `mapstructure:"app_id"`
1821
}
1922

23+
// Deprecated: Coder Tasks is deprecated as of Coder v2.34 and will be removed in
24+
// a future release. Use Coder Agents instead:
25+
// https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration
2026
type AITaskSidebarApp struct {
2127
ID string `mapstructure:"id"`
2228
}
2329

2430
// TaskPromptParameterName is the name of the parameter which is *required* to be defined when a coder_ai_task is used.
31+
//
32+
// Deprecated: Coder Tasks is deprecated as of Coder v2.34. Task prompts are read
33+
// from the task itself, not from a parameter.
2534
const TaskPromptParameterName = "AI Prompt"
2635

36+
// aiTaskDeprecationMessage is surfaced by Terraform whenever a deprecated AI
37+
// task resource or data source is used.
38+
const aiTaskDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Use Coder Agents instead: https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration"
39+
40+
// aiTaskAttributeDeprecationMessage is surfaced by Terraform whenever a
41+
// deprecated AI task attribute is used. It is kept short because it is rendered
42+
// inline in the generated attribute documentation.
43+
const aiTaskAttributeDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release."
44+
45+
// aiTaskDeprecationNotice is rendered in the generated documentation.
46+
const aiTaskDeprecationNotice = "\n\n~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release. Starting June 2, 2026, Coder Tasks moves to a 12-month Extended Support Release (ESR) for Premium customers. Templates no longer require AI task resources; use [Coder Agents](https://coder.com/docs/ai-coder/agents) and follow the [migration guide](https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration). Coder Tasks documentation remains available in the [v2.36 documentation](https://coder.com/docs/@v2.36.3/ai-coder/tasks)."
47+
2748
func aiTaskResource() *schema.Resource {
2849
return &schema.Resource{
2950
SchemaVersion: 1,
3051

31-
Description: "Use this resource to define Coder tasks.",
52+
DeprecationMessage: aiTaskDeprecationMessage,
53+
Description: "Use this resource to define Coder tasks." + aiTaskDeprecationNotice,
3254
CreateContext: func(c context.Context, resourceData *schema.ResourceData, i any) diag.Diagnostics {
3355
var diags diag.Diagnostics
3456

@@ -76,7 +98,7 @@ func aiTaskResource() *schema.Resource {
7698
"sidebar_app": {
7799
Type: schema.TypeSet,
78100
Description: "The coder_app to display in the sidebar. Usually a chat interface with the AI agent running in the workspace, like https://github.com/coder/agentapi.",
79-
Deprecated: "This field has been deprecated in favor of the `app_id` field.",
101+
Deprecated: "This field has been deprecated in favor of the `app_id` field. " + aiTaskAttributeDeprecationMessage,
80102
ForceNew: true,
81103
Optional: true,
82104
MaxItems: 1,
@@ -86,6 +108,7 @@ func aiTaskResource() *schema.Resource {
86108
"id": {
87109
Type: schema.TypeString,
88110
Description: "A reference to an existing `coder_app` resource in your template.",
111+
Deprecated: aiTaskAttributeDeprecationMessage,
89112
Required: true,
90113
ForceNew: true,
91114
ValidateFunc: validation.IsUUID,
@@ -96,11 +119,13 @@ func aiTaskResource() *schema.Resource {
96119
"prompt": {
97120
Type: schema.TypeString,
98121
Description: "The prompt text provided to the task by Coder.\n\n -> The `prompt` field is only populated in Coder v2.28 and later.",
122+
Deprecated: aiTaskAttributeDeprecationMessage,
99123
Computed: true,
100124
},
101125
"app_id": {
102126
Type: schema.TypeString,
103127
Description: "The ID of the `coder_app` resource that provides the AI interface for this task.",
128+
Deprecated: aiTaskAttributeDeprecationMessage,
104129
ForceNew: true,
105130
Optional: true,
106131
Computed: true,
@@ -110,6 +135,7 @@ func aiTaskResource() *schema.Resource {
110135
"enabled": {
111136
Type: schema.TypeBool,
112137
Description: "True when executing in a Coder Task context, false when in a Coder Workspace context.\n\n -> The `enabled` field is only populated in Coder v2.28 and later.",
138+
Deprecated: aiTaskAttributeDeprecationMessage,
113139
Computed: true,
114140
},
115141
},
@@ -118,7 +144,8 @@ func aiTaskResource() *schema.Resource {
118144

119145
func taskDatasource() *schema.Resource {
120146
return &schema.Resource{
121-
Description: "Use this data source to read information about Coder Tasks.",
147+
DeprecationMessage: aiTaskDeprecationMessage,
148+
Description: "Use this data source to read information about Coder Tasks." + aiTaskDeprecationNotice,
122149
ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
123150
diags := diag.Diagnostics{}
124151

@@ -145,11 +172,13 @@ func taskDatasource() *schema.Resource {
145172
"prompt": {
146173
Type: schema.TypeString,
147174
Computed: true,
175+
Deprecated: aiTaskAttributeDeprecationMessage,
148176
Description: "The prompt text provided to the task by Coder, if executing in a Coder Task context. Empty in a Coder Workspace context.\n\n -> The `prompt` field is only populated in Coder v2.28 and later.",
149177
},
150178
"enabled": {
151179
Type: schema.TypeBool,
152180
Computed: true,
181+
Deprecated: aiTaskAttributeDeprecationMessage,
153182
Description: "True when executing in a Coder Task context, false when in a Coder Workspace context.\n\n -> The `enabled` field is only populated in Coder v2.28 and later.",
154183
},
155184
},

0 commit comments

Comments
 (0)