diff --git a/registry/coder/modules/agentapi/README.md b/registry/coder/modules/agentapi/README.md index 0b5ed0ba4..a84ad6a58 100644 --- a/registry/coder/modules/agentapi/README.md +++ b/registry/coder/modules/agentapi/README.md @@ -28,6 +28,7 @@ module "agentapi" { cli_app_display_name = "Goose CLI" module_dir_name = local.module_dir_name install_agentapi = var.install_agentapi + enable_tasks = var.enable_tasks # Set to false to disable AI tasks pre_install_script = var.pre_install_script post_install_script = var.post_install_script start_script = local.start_script diff --git a/registry/coder/modules/agentapi/main.tf b/registry/coder/modules/agentapi/main.tf index 225a992d3..d81ddea2a 100644 --- a/registry/coder/modules/agentapi/main.tf +++ b/registry/coder/modules/agentapi/main.tf @@ -156,6 +156,11 @@ variable "module_dir_name" { description = "Name of the subdirectory in the home directory for module files." } +variable "enable_tasks" { + type = bool + description = "Whether to enable AI tasks. When false, the coder_ai_task resource will not be created, avoiding the requirement for an 'AI Prompt' parameter." + default = true +} locals { # we always trim the slash for consistency @@ -240,7 +245,9 @@ resource "coder_app" "agentapi_cli" { } resource "coder_ai_task" "agentapi" { + count = var.enable_tasks ? 1 : 0 + sidebar_app { id = coder_app.agentapi_web.id } -} +} \ No newline at end of file