From a8a99604c2a103c48e9cc0f778bf6474ee541c22 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:04:49 +0000 Subject: [PATCH 1/3] feat(agentapi,claude-code): add web_app variable to disable the web app Adds a web_app variable (default: true) to both the agentapi and claude-code modules. When set to false, AgentAPI still runs but the web UI app icon is not shown in the Coder dashboard. The web app is automatically enabled when the workspace is a Task (via data.coder_task.me.enabled), regardless of the web_app setting, since coder_ai_task requires the app to function. Also bumps agentapi module version to 2.4.0 and claude-code to 4.9.0. --- registry/coder/modules/agentapi/README.md | 2 +- registry/coder/modules/agentapi/main.tf | 15 ++++++++++++++- registry/coder/modules/claude-code/README.md | 18 +++++++++--------- registry/coder/modules/claude-code/main.tf | 11 +++++++++-- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/registry/coder/modules/agentapi/README.md b/registry/coder/modules/agentapi/README.md index 22ce50fe8..33e582973 100644 --- a/registry/coder/modules/agentapi/README.md +++ b/registry/coder/modules/agentapi/README.md @@ -16,7 +16,7 @@ The AgentAPI module is a building block for modules that need to run an AgentAPI ```tf module "agentapi" { source = "registry.coder.com/coder/agentapi/coder" - version = "2.3.0" + version = "2.4.0" agent_id = var.agent_id web_app_slug = local.app_slug diff --git a/registry/coder/modules/agentapi/main.tf b/registry/coder/modules/agentapi/main.tf index 6f177036b..50d6bf685 100644 --- a/registry/coder/modules/agentapi/main.tf +++ b/registry/coder/modules/agentapi/main.tf @@ -53,6 +53,12 @@ variable "folder" { default = "/home/coder" } +variable "web_app" { + type = bool + description = "Whether to create the web workspace app. This is automatically enabled when using Coder Tasks, regardless of this setting." + default = true +} + variable "cli_app" { type = bool description = "Whether to create the CLI workspace app." @@ -220,6 +226,11 @@ resource "coder_env" "boundary_config" { } locals { + # If this is a Task, always create the web app regardless of var.web_app + # since coder_ai_task requires the app to function. + is_task = try(data.coder_task.me.enabled, false) + web_app = var.web_app || local.is_task + # we always trim the slash for consistency workdir = trimsuffix(var.folder, "/") encoded_pre_install_script = var.pre_install_script != null ? base64encode(var.pre_install_script) : "" @@ -305,6 +316,8 @@ resource "coder_script" "agentapi_shutdown" { } resource "coder_app" "agentapi_web" { + count = local.web_app ? 1 : 0 + slug = var.web_app_slug display_name = var.web_app_display_name agent_id = var.agent_id @@ -341,5 +354,5 @@ resource "coder_app" "agentapi_cli" { } output "task_app_id" { - value = coder_app.agentapi_web.id + value = local.web_app ? coder_app.agentapi_web[0].id : "" } diff --git a/registry/coder/modules/claude-code/README.md b/registry/coder/modules/claude-code/README.md index 5a2eacd64..c4be4595d 100644 --- a/registry/coder/modules/claude-code/README.md +++ b/registry/coder/modules/claude-code/README.md @@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" claude_api_key = "xxxx-xxxxx-xxxx" @@ -60,7 +60,7 @@ By default, when `enable_boundary = true`, the module uses `coder boundary` subc ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" enable_boundary = true @@ -81,7 +81,7 @@ For tasks integration with AI Bridge, add `enable_aibridge = true` to the [Usage ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" enable_aibridge = true @@ -110,7 +110,7 @@ data "coder_task" "me" {} module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" ai_prompt = data.coder_task.me.prompt @@ -133,7 +133,7 @@ This example shows additional configuration options for version pinning, custom ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" @@ -189,7 +189,7 @@ Run and configure Claude Code as a standalone CLI in your workspace. ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" install_claude_code = true @@ -211,7 +211,7 @@ variable "claude_code_oauth_token" { module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" claude_code_oauth_token = var.claude_code_oauth_token @@ -284,7 +284,7 @@ resource "coder_env" "bedrock_api_key" { module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0" @@ -341,7 +341,7 @@ resource "coder_env" "google_application_credentials" { module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "4.8.2" + version = "4.9.0" agent_id = coder_agent.main.id workdir = "/home/coder/project" model = "claude-sonnet-4@20250514" diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index ba45d69cc..e25e4f989 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -47,6 +47,12 @@ variable "report_tasks" { default = true } +variable "web_app" { + type = bool + description = "Whether to create the web app for Claude Code. When false, AgentAPI still runs but no web UI app icon is shown in the Coder dashboard. This is automatically enabled when using Coder Tasks, regardless of this setting." + default = true +} + variable "cli_app" { type = bool description = "Whether to create a CLI app for Claude Code" @@ -362,9 +368,10 @@ locals { module "agentapi" { source = "registry.coder.com/coder/agentapi/coder" - version = "2.2.0" + version = "2.4.0" - agent_id = var.agent_id + agent_id = var.agent_id + web_app = var.web_app web_app_slug = local.app_slug web_app_order = var.order web_app_group = var.group From e4691a8cbbf8078c67e2d7c46e531c30df9bec30 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:07:52 +0000 Subject: [PATCH 2/3] style: fix terraform fmt alignment --- registry/coder/modules/claude-code/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index e25e4f989..7a08aa82f 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -370,8 +370,8 @@ module "agentapi" { source = "registry.coder.com/coder/agentapi/coder" version = "2.4.0" - agent_id = var.agent_id - web_app = var.web_app + agent_id = var.agent_id + web_app = var.web_app web_app_slug = local.app_slug web_app_order = var.order web_app_group = var.group From 41ad201ef1d4288775229adc5448b11a31732652 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:10:16 +0000 Subject: [PATCH 3/3] fix: use agentapi 2.3.0 and defer web_app pass-through agentapi 2.4.0 does not exist on the registry yet (latest is 2.3.0), and 2.3.0 does not have the web_app variable. Defer the pass-through until after agentapi is published with web_app support. --- registry/coder/modules/claude-code/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index 7a08aa82f..3781ee36c 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -368,10 +368,10 @@ locals { module "agentapi" { source = "registry.coder.com/coder/agentapi/coder" - version = "2.4.0" + version = "2.3.0" - agent_id = var.agent_id - web_app = var.web_app + agent_id = var.agent_id + # TODO: pass web_app = var.web_app once agentapi module is published with web_app support web_app_slug = local.app_slug web_app_order = var.order web_app_group = var.group