mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: remove deprecated AITaskPromptParameterName constant (#21023)
This removes the deprecated AITaskPromptParameterName constant and all backward compatibility code that was added for v2.28. - Remove AITaskPromptParameterName constant from codersdk/aitasks.go - Remove backward compatibility code in coderd/aitasks.go that populated the "AI Prompt" parameter for templates that defined it - Remove the backward compatibility test (OK AIPromptBackCompat) - Update dbfake to no longer set the AI Prompt parameter - Remove AITaskPromptParameterName from frontend TypeScript types - Remove preset prompt read-only feature from TaskPrompt component - Update docs to reflect that pre-2.28 definition is no longer supported Task prompts are now exclusively stored in the tasks.prompt database column, as introduced in the migration that added the tasks table.
This commit is contained in:
@@ -58,6 +58,8 @@ data "coder_workspace_owner" "me" {}
|
||||
|
||||
data "coder_workspace" "me" {}
|
||||
|
||||
data "coder_task" "me" {}
|
||||
|
||||
resource "coder_agent" "dev" {
|
||||
arch = "amd64"
|
||||
os = "linux"
|
||||
@@ -71,15 +73,21 @@ resource "coder_agent" "dev" {
|
||||
|
||||
# See https://registry.coder.com/modules/coder/claude-code for more information
|
||||
module "claude-code" {
|
||||
count = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0
|
||||
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
|
||||
source = "dev.registry.coder.com/coder/claude-code/coder"
|
||||
version = ">= 3.4.0"
|
||||
version = ">= 4.0.0"
|
||||
agent_id = coder_agent.dev.id
|
||||
workdir = "/home/coder/project"
|
||||
claude_api_key = data.coder_workspace_owner.me.session_token # Use the Coder session token to authenticate with AI Bridge
|
||||
ai_prompt = data.coder_parameter.ai_prompt.value
|
||||
ai_prompt = data.coder_task.me.prompt
|
||||
... # other claude-code configuration
|
||||
}
|
||||
|
||||
# The coder_ai_task resource associates the task to the app.
|
||||
resource "coder_ai_task" "task" {
|
||||
count = data.coder_task.me.enabled ? data.coder_workspace.me.start_count : 0
|
||||
app_id = module.claude-code[0].task_app_id
|
||||
}
|
||||
```
|
||||
|
||||
## External and Desktop Clients
|
||||
|
||||
@@ -8,7 +8,8 @@ Prior to Coder version 2.28.0, the definition of a Coder task was different to t
|
||||
|
||||
Note that 2 and 3 were generally handled by the `coder/agentapi` Terraform module.
|
||||
|
||||
The pre-2.28.0 definition will be supported until the release of 2.29.0. You will need to update your Tasks-enabled templates to continue using Tasks after this release.
|
||||
> [!IMPORTANT]
|
||||
> The pre-2.28.0 definition is no longer supported as of Coder 2.30.0. You must update your Tasks-enabled templates to use the new format described below.
|
||||
|
||||
You can view an [example migration here](https://github.com/coder/coder/pull/20420). Alternatively, follow the steps below:
|
||||
|
||||
@@ -114,7 +115,7 @@ resource "coder_ai_task" "task" {
|
||||
|
||||
In v2.28 and above, the following changes were made:
|
||||
|
||||
- The explicitly named "AI Prompt" parameter is deprecated. The task prompt is now available in the `coder_ai_task` resource (provider version 2.12 and above) and `coder_task` data source (provider version 2.13 and above).
|
||||
- The explicitly named "AI Prompt" parameter is no longer supported. The task prompt is now available in the `coder_ai_task` resource (provider version 2.12 and above) and `coder_task` data source (provider version 2.13 and above).
|
||||
- Modules no longer define the `coder_ai_task` resource. These must be defined explicitly in the template.
|
||||
- The `sidebar_app` field of the `coder_ai_task` resource is now deprecated. In its place, use `app_id`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user