Skip to content

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

Merged
DevelopmentCats merged 4 commits intomainfrom
feat/disable-claude-code-web-app
Apr 3, 2026
Merged

feat(agentapi,claude-code): add web_app variable to disable the web app#764
DevelopmentCats merged 4 commits intomainfrom
feat/disable-claude-code-web-app

Conversation

@blinkagent
Copy link
Copy Markdown
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)
  • TODO comment to wire web_app through to agentapi once published

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

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

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.

@blinkagent blinkagent bot force-pushed the feat/disable-claude-code-web-app branch from a176a25 to 607f934 Compare March 10, 2026 21:37
@blinkagent blinkagent bot force-pushed the feat/disable-claude-code-web-app branch from 430d63e to d88d1b7 Compare April 2, 2026 20:51
@blinkagent blinkagent bot changed the title feat(claude-code): add web_app variable to disable the web app feat(agentapi,claude-code): add web_app variable to disable the web app Apr 2, 2026
@blinkagent blinkagent bot force-pushed the feat/disable-claude-code-web-app branch from ed775a0 to dc5b548 Compare April 2, 2026 21:04
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.
@blinkagent blinkagent bot force-pushed the feat/disable-claude-code-web-app branch from dc5b548 to a8a9960 Compare April 2, 2026 21:04
blink-so bot added 2 commits April 2, 2026 21:07
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.
@DevelopmentCats
Copy link
Copy Markdown
Collaborator

For CI to pass we will need to defer these changes in a PR that we will make and merge after I test this logic, and then the CI will pass for both PR's it will just require a patch version bump for the claude-code module that can only be avoided if we split this PR into 2 for each module changed, and stagger their releases. @matifali

module "agentapi" {
  source  = "registry.coder.com/coder/agentapi/coder"
  version = "2.4.0"

  agent_id             = var.agent_id
  pass web_app    = var.web_app
  web_app_slug    = local.app_slug
  web_app_order  = var.order
  web_app_group = var.group

@DevelopmentCats DevelopmentCats marked this pull request as ready for review April 2, 2026 21:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a web_app toggle (default true) intended to allow hiding the web UI app icon while keeping AgentAPI running, mirroring the existing cli_app pattern.

Changes:

  • agentapi: introduce web_app variable and gate creation of coder_app.agentapi_web via count, with Task-safe override to always create the app in Tasks.
  • agentapi: adjust task_app_id output to return an empty string when the web app is not created.
  • claude-code: add a web_app variable and bump documented module versions (Claude Code to 4.9.0, AgentAPI dependency to 2.3.0), with a TODO to wire web_app through later.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
registry/coder/modules/claude-code/README.md Updates usage examples to pin Claude Code module version 4.9.0.
registry/coder/modules/claude-code/main.tf Adds a web_app variable and bumps the agentapi submodule version; includes TODO to pass web_app later.
registry/coder/modules/agentapi/README.md Updates the version shown in the example to 2.4.0.
registry/coder/modules/agentapi/main.tf Adds web_app variable and conditional creation of the web app, with Task-safe behavior and updated output indexing.

Copy link
Copy Markdown
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

LGTM

@DevelopmentCats DevelopmentCats merged commit 344b02e into main Apr 3, 2026
4 checks passed
@DevelopmentCats DevelopmentCats deleted the feat/disable-claude-code-web-app branch April 3, 2026 17:00
blinkagent bot pushed a commit that referenced this pull request Apr 3, 2026
Now that agentapi v2.4.0 is published with web_app support, this
bumps the agentapi dependency from v2.3.0 to v2.4.0 and replaces
the TODO comment with the actual web_app = var.web_app parameter.

This is the follow-up to #764.
DevelopmentCats pushed a commit that referenced this pull request Apr 3, 2026
…#831)

Follow-up to #764.

Now that the `agentapi` module `v2.4.0` is published with `web_app`
support, this PR completes the wiring:

## Changes

### `claude-code/main.tf`
- Bump agentapi dependency from `v2.3.0` → `v2.4.0`
- Replace `# TODO: pass web_app = var.web_app once agentapi module is
published with web_app support` with `web_app = var.web_app`

### `claude-code/README.md`
- Bump version references from `4.9.0` → `4.9.1`

## Result

Setting `web_app = false` on the `claude-code` module now correctly
passes through to the `agentapi` module, hiding the web UI app icon from
the Coder dashboard while still running AgentAPI. The task-safe behavior
(auto-enabling for `coder_ai_task`) is handled by the `agentapi` module.

---------

Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
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.

3 participants