From 1e4d702634e532f1a9c70a8aec7a7274260c7b74 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 11:50:53 +0000 Subject: [PATCH 1/3] 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. --- docs/data-sources/task.md | 7 +++++-- docs/resources/ai_task.md | 9 ++++++--- provider/ai_task.go | 28 +++++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/docs/data-sources/task.md b/docs/data-sources/task.md index 43396eae..e4357c0a 100644 --- a/docs/data-sources/task.md +++ b/docs/data-sources/task.md @@ -4,12 +4,15 @@ page_title: "coder_task Data Source - terraform-provider-coder" subcategory: "" description: |- Use this data source to read information about Coder Tasks. + ~> Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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_task (Data Source) Use this data source to read information about Coder Tasks. +~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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). + ## Example Usage ```terraform @@ -34,10 +37,10 @@ module "example-agent" { ### Read-Only -- `enabled` (Boolean) True when executing in a Coder Task context, false when in a Coder Workspace context. +- `enabled` (Boolean, Deprecated) True when executing in a Coder Task context, false when in a Coder Workspace context. -> The `enabled` field is only populated in Coder v2.28 and later. - `id` (String) The UUID of the task, if executing in a Coder Task context. Empty in a Coder Workspace context. -- `prompt` (String) The prompt text provided to the task by Coder, if executing in a Coder Task context. Empty in a Coder Workspace context. +- `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. -> The `prompt` field is only populated in Coder v2.28 and later. diff --git a/docs/resources/ai_task.md b/docs/resources/ai_task.md index 3619c680..2222b336 100644 --- a/docs/resources/ai_task.md +++ b/docs/resources/ai_task.md @@ -4,12 +4,15 @@ page_title: "coder_ai_task Resource - terraform-provider-coder" subcategory: "" description: |- Use this resource to define Coder tasks. + ~> Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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_ai_task (Resource) Use this resource to define Coder tasks. +~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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). + @@ -17,16 +20,16 @@ Use this resource to define Coder tasks. ### Optional -- `app_id` (String) The ID of the `coder_app` resource that provides the AI interface for this task. +- `app_id` (String, **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release.) The ID of the `coder_app` resource that provides the AI interface for this task. - `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)) ### Read-Only -- `enabled` (Boolean) True when executing in a Coder Task context, false when in a Coder Workspace context. +- `enabled` (Boolean, Deprecated) True when executing in a Coder Task context, false when in a Coder Workspace context. -> The `enabled` field is only populated in Coder v2.28 and later. - `id` (String) A unique identifier for this resource. -- `prompt` (String) The prompt text provided to the task by Coder. +- `prompt` (String, Deprecated) The prompt text provided to the task by Coder. -> The `prompt` field is only populated in Coder v2.28 and later. diff --git a/provider/ai_task.go b/provider/ai_task.go index 1bb6cf65..8efbabb0 100644 --- a/provider/ai_task.go +++ b/provider/ai_task.go @@ -22,13 +22,29 @@ type AITaskSidebarApp struct { } // TaskPromptParameterName is the name of the parameter which is *required* to be defined when a coder_ai_task is used. +// +// Deprecated: Coder Tasks is deprecated as of Coder v2.36. Task prompts are read +// from the task itself, not from a parameter. const TaskPromptParameterName = "AI Prompt" +// aiTaskDeprecationMessage is surfaced by Terraform whenever a deprecated AI +// task resource or data source is used. +const aiTaskDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. Use Coder Agents instead: https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration" + +// aiTaskAttributeDeprecationMessage is surfaced by Terraform whenever a +// deprecated AI task attribute is used. It is kept short because it is rendered +// inline in the generated attribute documentation. +const aiTaskAttributeDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release." + +// aiTaskDeprecationNotice is rendered in the generated documentation. +const aiTaskDeprecationNotice = "\n\n~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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)." + func aiTaskResource() *schema.Resource { return &schema.Resource{ SchemaVersion: 1, - Description: "Use this resource to define Coder tasks.", + DeprecationMessage: aiTaskDeprecationMessage, + Description: "Use this resource to define Coder tasks." + aiTaskDeprecationNotice, CreateContext: func(c context.Context, resourceData *schema.ResourceData, i any) diag.Diagnostics { var diags diag.Diagnostics @@ -76,7 +92,7 @@ func aiTaskResource() *schema.Resource { "sidebar_app": { Type: schema.TypeSet, 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.", - Deprecated: "This field has been deprecated in favor of the `app_id` field.", + Deprecated: "This field has been deprecated in favor of the `app_id` field. " + aiTaskAttributeDeprecationMessage, ForceNew: true, Optional: true, MaxItems: 1, @@ -96,11 +112,13 @@ func aiTaskResource() *schema.Resource { "prompt": { Type: schema.TypeString, Description: "The prompt text provided to the task by Coder.\n\n -> The `prompt` field is only populated in Coder v2.28 and later.", + Deprecated: aiTaskAttributeDeprecationMessage, Computed: true, }, "app_id": { Type: schema.TypeString, Description: "The ID of the `coder_app` resource that provides the AI interface for this task.", + Deprecated: aiTaskAttributeDeprecationMessage, ForceNew: true, Optional: true, Computed: true, @@ -110,6 +128,7 @@ func aiTaskResource() *schema.Resource { "enabled": { Type: schema.TypeBool, 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.", + Deprecated: aiTaskAttributeDeprecationMessage, Computed: true, }, }, @@ -118,7 +137,8 @@ func aiTaskResource() *schema.Resource { func taskDatasource() *schema.Resource { return &schema.Resource{ - Description: "Use this data source to read information about Coder Tasks.", + DeprecationMessage: aiTaskDeprecationMessage, + Description: "Use this data source to read information about Coder Tasks." + aiTaskDeprecationNotice, ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics { diags := diag.Diagnostics{} @@ -145,11 +165,13 @@ func taskDatasource() *schema.Resource { "prompt": { Type: schema.TypeString, Computed: true, + Deprecated: aiTaskAttributeDeprecationMessage, 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.", }, "enabled": { Type: schema.TypeBool, Computed: true, + Deprecated: aiTaskAttributeDeprecationMessage, 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.", }, }, From 318cea0daf17bd4f4bfc52ffe98ef0bdb1ae3a52 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 12:00:32 +0000 Subject: [PATCH 2/3] 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. --- docs/data-sources/task.md | 2 +- docs/resources/ai_task.md | 2 +- examples/data-sources/coder_task/data-source.tf | 2 +- provider/ai_task.go | 7 +++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/data-sources/task.md b/docs/data-sources/task.md index e4357c0a..b3e327d7 100644 --- a/docs/data-sources/task.md +++ b/docs/data-sources/task.md @@ -28,7 +28,7 @@ resource "coder_ai_task" "task" { module "example-agent" { count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0 - prompt = data.coder_ai_task.me.prompt + prompt = data.coder_task.me.prompt } ``` diff --git a/docs/resources/ai_task.md b/docs/resources/ai_task.md index 2222b336..6ccf4e70 100644 --- a/docs/resources/ai_task.md +++ b/docs/resources/ai_task.md @@ -38,4 +38,4 @@ Use this resource to define Coder tasks. Required: -- `id` (String) A reference to an existing `coder_app` resource in your template. +- `id` (String, Deprecated) A reference to an existing `coder_app` resource in your template. diff --git a/examples/data-sources/coder_task/data-source.tf b/examples/data-sources/coder_task/data-source.tf index af2098e1..f7098f97 100644 --- a/examples/data-sources/coder_task/data-source.tf +++ b/examples/data-sources/coder_task/data-source.tf @@ -10,5 +10,5 @@ resource "coder_ai_task" "task" { module "example-agent" { count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0 - prompt = data.coder_ai_task.me.prompt + prompt = data.coder_task.me.prompt } diff --git a/provider/ai_task.go b/provider/ai_task.go index 8efbabb0..abc1e82c 100644 --- a/provider/ai_task.go +++ b/provider/ai_task.go @@ -10,6 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) +// Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in +// a future release. Use Coder Agents instead: +// https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration type AITask struct { ID string `mapstructure:"id"` SidebarApp []AITaskSidebarApp `mapstructure:"sidebar_app"` @@ -17,6 +20,9 @@ type AITask struct { AppID string `mapstructure:"app_id"` } +// Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in +// a future release. Use Coder Agents instead: +// https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration type AITaskSidebarApp struct { ID string `mapstructure:"id"` } @@ -102,6 +108,7 @@ func aiTaskResource() *schema.Resource { "id": { Type: schema.TypeString, Description: "A reference to an existing `coder_app` resource in your template.", + Deprecated: aiTaskAttributeDeprecationMessage, Required: true, ForceNew: true, ValidateFunc: validation.IsUUID, From 699ccfbc20d1627ada12b4d4b44b6ae581c2e227 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:06:38 +0000 Subject: [PATCH 3/3] fix: correct Tasks deprecation to v2.34 and add ESR wording --- docs/data-sources/task.md | 4 ++-- docs/resources/ai_task.md | 6 +++--- provider/ai_task.go | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/data-sources/task.md b/docs/data-sources/task.md index b3e327d7..cdae7a27 100644 --- a/docs/data-sources/task.md +++ b/docs/data-sources/task.md @@ -4,14 +4,14 @@ page_title: "coder_task Data Source - terraform-provider-coder" subcategory: "" description: |- Use this data source to read information about Coder Tasks. - ~> Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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. + ~> 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. --- # coder_task (Data Source) Use this data source to read information about Coder Tasks. -~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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). +~> **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). ## Example Usage diff --git a/docs/resources/ai_task.md b/docs/resources/ai_task.md index 6ccf4e70..0a92ab0c 100644 --- a/docs/resources/ai_task.md +++ b/docs/resources/ai_task.md @@ -4,14 +4,14 @@ page_title: "coder_ai_task Resource - terraform-provider-coder" subcategory: "" description: |- Use this resource to define Coder tasks. - ~> Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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. + ~> 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. --- # coder_ai_task (Resource) Use this resource to define Coder tasks. -~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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). +~> **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). @@ -20,7 +20,7 @@ Use this resource to define Coder tasks. ### Optional -- `app_id` (String, **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release.) The ID of the `coder_app` resource that provides the AI interface for this task. +- `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. - `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)) ### Read-Only diff --git a/provider/ai_task.go b/provider/ai_task.go index abc1e82c..86ed8905 100644 --- a/provider/ai_task.go +++ b/provider/ai_task.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -// Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in +// Deprecated: 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 type AITask struct { @@ -20,7 +20,7 @@ type AITask struct { AppID string `mapstructure:"app_id"` } -// Deprecated: Coder Tasks is deprecated as of Coder v2.36 and will be removed in +// Deprecated: 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 type AITaskSidebarApp struct { @@ -29,21 +29,21 @@ type AITaskSidebarApp struct { // TaskPromptParameterName is the name of the parameter which is *required* to be defined when a coder_ai_task is used. // -// Deprecated: Coder Tasks is deprecated as of Coder v2.36. Task prompts are read +// Deprecated: Coder Tasks is deprecated as of Coder v2.34. Task prompts are read // from the task itself, not from a parameter. const TaskPromptParameterName = "AI Prompt" // aiTaskDeprecationMessage is surfaced by Terraform whenever a deprecated AI // task resource or data source is used. -const aiTaskDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. Use Coder Agents instead: https://coder.com/docs/ai-coder/agents/tasks-to-chats-migration" +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" // aiTaskAttributeDeprecationMessage is surfaced by Terraform whenever a // deprecated AI task attribute is used. It is kept short because it is rendered // inline in the generated attribute documentation. -const aiTaskAttributeDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release." +const aiTaskAttributeDeprecationMessage = "Coder Tasks is deprecated as of Coder v2.34 and will be removed in a future release." // aiTaskDeprecationNotice is rendered in the generated documentation. -const aiTaskDeprecationNotice = "\n\n~> **Deprecated**: Coder Tasks is deprecated as of Coder v2.36 and will be removed in a future release. 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)." +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)." func aiTaskResource() *schema.Resource { return &schema.Resource{