Skip to content

feat(claude-code): add web_app variable to disable the web app#764

Draft
blinkagent[bot] wants to merge 7 commits intomainfrom
feat/disable-claude-code-web-app
Draft

feat(claude-code): add web_app variable to disable the web app#764
blinkagent[bot] wants to merge 7 commits intomainfrom
feat/disable-claude-code-web-app

Conversation

@blinkagent
Copy link
Contributor

@blinkagent blinkagent bot commented Feb 26, 2026

Adds a web_app variable (default: true) to both the claude-code and agentapi modules. When set to false, AgentAPI still runs but the web UI app icon is not shown in the Coder dashboard.

This mirrors the existing cli_app toggle pattern.

Changes

agentapi module

  • New web_app variable (bool, default true)
  • coder_app.agentapi_web now has count = local.web_app ? 1 : 0
  • Task-safe: local.web_app is computed as var.web_app || local.is_task, where is_task = try(data.coder_task.me.enabled, false). This means the web app is always created when the workspace is a Task, regardless of the web_app variable.
  • task_app_id output returns "" when local.web_app is false

claude-code module

  • New web_app variable (bool, default true) — added for future use
  • TODO comment to wire web_app through to agentapi once the agentapi module is published with web_app support

Usage (once fully wired)

module "claude-code" {
  source  = "registry.coder.com/coder/claude-code/coder"
  ...
  web_app = false  # hides the Claude Code web UI from the dashboard
}

Setting web_app = false is safe even in templates that use coder_ai_task — the module detects Tasks via data.coder_task.me.enabled and automatically enables the web app.

Merge strategy

This needs to land in two steps:

  1. Merge this PR — publishes the agentapi module with web_app support, and adds the web_app variable to claude-code (not yet wired through)
  2. Follow-up PR — bump the agentapi version in claude-code and replace the TODO with web_app = var.web_app

blink-so bot and others added 6 commits February 26, 2026 21:44
Adds a `web_app` variable (default: true) to both the claude-code and
agentapi modules. When set to false, AgentAPI still runs but the web UI
app icon is not shown in the Coder dashboard.

This mirrors the existing `cli_app` toggle pattern.
The claude-code module needs to reference the local agentapi module
so that both sets of changes are tested together. This should be
reverted to the registry source before merging once agentapi is
published with the web_app variable.
The claude-code module must use the published agentapi registry source.
The web_app variable is added to claude-code for future use, but the
pass-through to agentapi is deferred until agentapi is published with
web_app support.
@DevelopmentCats
Copy link
Contributor

While this is technically possible to add. I think we may need a better solution for this since the tasks ui will not work unless the claude-code coder app is available in the workspace.


variable "web_app" {
type = bool
description = "Whether to create the web workspace app. Note: the web app is required for Coder Tasks (coder_ai_task) — do not disable this if you are using Tasks."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just ignore this input in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really — the coder_app "agentapi_web" resource that we need to conditionally create lives in this module (agentapi), so the variable needs to be here to control the count. The claude-code module just passes it through.

That said, as noted in the issue comment, this has a limitation: disabling the web app breaks Tasks (coder_ai_task) since it depends on the task_app_id output from this app. So this is only useful for non-Tasks use cases where someone wants claude-code running via CLI only without the web UI in the dashboard.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I am saying is that we ignore the variable value in case it's a task. But I guess we don't know that yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — we actually do know! The agentapi module already has data "coder_task" "me" {}. I've added a local that checks try(data.coder_task.me.enabled, false) and forces the web app on when it's a Task:

locals {
  is_task = try(data.coder_task.me.enabled, false)
  web_app = var.web_app || local.is_task
}

So now web_app = false is safe to use — it'll be ignored when the workspace is a Task.

Uses data.coder_task.me.enabled to detect if the workspace is a Task
and forces the web app on regardless of the web_app variable, since
coder_ai_task requires the app to function.

This makes it safe to set web_app = false without worrying about
breaking Tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants