Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions registry/coder-labs/modules/auggie/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ variable "cli_app_display_name" {
default = "Auggie CLI"
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

resource "coder_env" "auggie_session_auth" {
agent_id = var.agent_id
name = "AUGMENT_SESSION_AUTH"
Expand Down Expand Up @@ -196,6 +202,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port
start_script = <<-EOT
#!/bin/bash
set -o errexit
Expand Down Expand Up @@ -227,6 +234,7 @@ module "agentapi" {
ARG_MCP_APP_STATUS_SLUG='${local.app_slug}' \
ARG_AUGGIE_RULES='${base64encode(var.rules)}' \
ARG_MCP_CONFIG='${var.mcp != null ? base64encode(replace(var.mcp, "'", "'\\''")) : ""}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/auggie/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function create_coder_mcp() {
"command": "coder",
"env": {
"CODER_MCP_APP_STATUS_SLUG": "${ARG_MCP_APP_STATUS_SLUG}",
"CODER_MCP_AI_AGENTAPI_URL": "http://localhost:3284",
"CODER_MCP_AI_AGENTAPI_URL": "http://localhost:${ARG_AGENTAPI_PORT:-3284}",
"CODER_AGENT_URL": "${CODER_AGENT_URL:-}",
"CODER_AGENT_TOKEN": "${CODER_AGENT_TOKEN:-}"
}
Expand Down
15 changes: 12 additions & 3 deletions registry/coder-labs/modules/codex/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
coder = {
source = "coder/coder"
version = ">= 2.12"
version = ">= 2.13"
}
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ variable "model_reasoning_effort" {
default = ""
validation {
condition = contains(["", "none", "minimal", "low", "medium", "high", "xhigh"], var.model_reasoning_effort)
error_message = "model_reasoning_effort must be one of: none, low, medium, high."
error_message = "model_reasoning_effort must be one of: none, minimal, low, medium, high, xhigh."
}
}

Expand Down Expand Up @@ -134,9 +134,15 @@ variable "agentapi_version" {
default = "v0.12.1"
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

variable "codex_model" {
type = string
description = "The model for Codex to use. Defaults to gpt-5.3-codex."
description = "The model for Codex to use. Defaults to gpt-5.4."
default = "gpt-5.4"
}

Expand Down Expand Up @@ -207,6 +213,7 @@ variable "use_boundary_directly" {
}

resource "coder_env" "openai_api_key" {
count = var.openai_api_key != "" ? 1 : 0
agent_id = var.agent_id
name = "OPENAI_API_KEY"
value = var.openai_api_key
Expand Down Expand Up @@ -254,6 +261,7 @@ module "agentapi" {
install_agentapi = var.install_agentapi
agentapi_subdomain = var.subdomain
agentapi_version = var.agentapi_version
agentapi_port = var.agentapi_port
enable_state_persistence = var.enable_state_persistence
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
Expand Down Expand Up @@ -300,6 +308,7 @@ module "agentapi" {
ARG_CODEX_START_DIRECTORY='${local.workdir}' \
ARG_MODEL_REASONING_EFFORT='${var.model_reasoning_effort}' \
ARG_CODEX_INSTRUCTION_PROMPT='${base64encode(var.codex_system_prompt)}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/codex/main.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ run "test_aibridge_disabled_with_api_key" {
}

assert {
condition = coder_env.openai_api_key.value == "test-key"
condition = coder_env.openai_api_key[0].value == "test-key"
error_message = "OpenAI API key should be set correctly"
}
}
Expand Down
3 changes: 1 addition & 2 deletions registry/coder-labs/modules/codex/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ append_mcp_servers_section() {
ARG_CODER_MCP_APP_STATUS_SLUG=""
CODER_MCP_AI_AGENTAPI_URL=""
else
CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
fi

cat << EOF >> "$config_path"
Expand Down Expand Up @@ -219,7 +219,6 @@ EOF
}

install_codex
codex --version
populate_config_toml
add_instruction_prompt_if_exists

Expand Down
8 changes: 8 additions & 0 deletions registry/coder-labs/modules/copilot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ variable "enable_aibridge_proxy" {
}
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

variable "aibridge_proxy_auth_url" {
type = string
description = "AI Bridge Proxy URL with authentication. Use the proxy_auth_url output from the aibridge-proxy module."
Expand Down Expand Up @@ -290,6 +296,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port

start_script = <<-EOT
#!/bin/bash
Expand Down Expand Up @@ -329,6 +336,7 @@ module "agentapi" {
ARG_EXTERNAL_AUTH_ID='${var.external_auth_id}' \
ARG_COPILOT_VERSION='${var.copilot_version}' \
ARG_COPILOT_MODEL='${var.copilot_model}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
4 changes: 2 additions & 2 deletions registry/coder-labs/modules/copilot/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ setup_coder_mcp_server() {
set -e

export CODER_MCP_APP_STATUS_SLUG="${ARG_MCP_APP_STATUS_SLUG}"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
export CODER_AGENT_URL="${CODER_AGENT_URL}"
export CODER_AGENT_TOKEN="${CODER_AGENT_TOKEN}"

Expand Down Expand Up @@ -218,7 +218,7 @@ configure_coder_integration() {
if [ "$ARG_REPORT_TASKS" = "true" ] && [ -n "$ARG_MCP_APP_STATUS_SLUG" ]; then
echo "Configuring Copilot task reporting..."
export CODER_MCP_APP_STATUS_SLUG="$ARG_MCP_APP_STATUS_SLUG"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
echo "✓ Coder MCP server configured for task reporting"
else
echo "Task reporting disabled or no app status slug provided."
Expand Down
8 changes: 8 additions & 0 deletions registry/coder-labs/modules/cursor-cli/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ variable "post_install_script" {
default = null
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

locals {
app_slug = "cursorcli"
install_script = file("${path.module}/scripts/install.sh")
Expand Down Expand Up @@ -148,6 +154,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port
start_script = <<-EOT
#!/bin/bash
set -o errexit
Expand Down Expand Up @@ -176,6 +183,7 @@ module "agentapi" {
ARG_MODULE_DIR_NAME='${local.module_dir_name}' \
ARG_FOLDER='${var.folder}' \
ARG_CODER_MCP_APP_STATUS_SLUG='${local.app_slug}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/cursor-cli/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set -e

# --- Set environment variables ---
export CODER_MCP_APP_STATUS_SLUG="${ARG_CODER_MCP_APP_STATUS_SLUG}"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
export CODER_AGENT_URL="${CODER_AGENT_URL}"
export CODER_AGENT_TOKEN="${CODER_AGENT_TOKEN}"

Expand Down
10 changes: 9 additions & 1 deletion registry/coder-labs/modules/gemini/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ variable "enable_yolo_mode" {
default = false
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

resource "coder_env" "gemini_api_key" {
agent_id = var.agent_id
name = "GEMINI_API_KEY"
Expand Down Expand Up @@ -158,7 +164,7 @@ locals {
"enabled": true,
"env": {
"CODER_MCP_APP_STATUS_SLUG": "${local.app_slug}",
"CODER_MCP_AI_AGENTAPI_URL": "http://localhost:3284"
"CODER_MCP_AI_AGENTAPI_URL": "http://localhost:${var.agentapi_port}"
},
"name": "Coder",
"timeout": 3000,
Expand Down Expand Up @@ -193,6 +199,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port
install_script = <<-EOT
#!/bin/bash
set -o errexit
Expand All @@ -207,6 +214,7 @@ module "agentapi" {
ADDITIONAL_EXTENSIONS='${base64encode(replace(var.additional_extensions != null ? var.additional_extensions : "", "'", "'\\''"))}' \
GEMINI_START_DIRECTORY='${var.folder}' \
GEMINI_SYSTEM_PROMPT='${base64encode(var.gemini_system_prompt)}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
start_script = <<-EOT
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/gemini/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function add_system_prompt_if_exists() {

function configure_mcp() {
export CODER_MCP_APP_STATUS_SLUG="gemini"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
coder exp mcp configure gemini "${GEMINI_START_DIRECTORY}"
}

Expand Down
8 changes: 8 additions & 0 deletions registry/coder-labs/modules/opencode/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ variable "agentapi_version" {
default = "v0.11.2"
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

variable "ai_prompt" {
type = string
description = "Initial task prompt for OpenCode."
Expand Down Expand Up @@ -163,6 +169,7 @@ module "agentapi" {
module_dir_name = local.module_dir_name
install_agentapi = var.install_agentapi
agentapi_version = var.agentapi_version
agentapi_port = var.agentapi_port
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
start_script = <<-EOT
Expand Down Expand Up @@ -194,6 +201,7 @@ module "agentapi" {
ARG_WORKDIR='${local.workdir}' \
ARG_AUTH_JSON='${var.auth_json != null ? base64encode(replace(var.auth_json, "'", "'\\''")) : ""}' \
ARG_OPENCODE_CONFIG='${var.config_json != null ? base64encode(replace(var.config_json, "'", "'\\''")) : ""}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/opencode/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ setup_coder_mcp_server() {
# Set environment variables based on task reporting setting
echo "Configuring OpenCode task reporting"
export CODER_MCP_APP_STATUS_SLUG="$ARG_MCP_APP_STATUS_SLUG"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:${ARG_AGENTAPI_PORT:-3284}"
echo "Coder integration configured for task reporting"

# Add coder MCP server configuration to the JSON file
Expand Down
9 changes: 8 additions & 1 deletion registry/coder-labs/modules/sourcegraph-amp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ variable "mcp" {
default = null
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

variable "mode" {
type = string
description = "Set the agent mode (free, rush, smart) — controls the model, system prompt, and tool selection. Default: smart"
Expand Down Expand Up @@ -192,7 +198,7 @@ locals {
"args" = ["exp", "mcp", "server"]
"env" = {
"CODER_MCP_APP_STATUS_SLUG" = var.report_tasks == true ? local.app_slug : ""
"CODER_MCP_AI_AGENTAPI_URL" = var.report_tasks == true ? "http://localhost:3284" : ""
"CODER_MCP_AI_AGENTAPI_URL" = var.report_tasks == true ? "http://localhost:${var.agentapi_port}" : ""
"CODER_AGENT_TOKEN" = data.external.env.result.CODER_AGENT_TOKEN
"CODER_AGENT_URL" = data.external.env.result.CODER_AGENT_URL
}
Expand Down Expand Up @@ -237,6 +243,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port
start_script = <<-EOT
#!/bin/bash
set -o errexit
Expand Down
6 changes: 6 additions & 0 deletions registry/coder/modules/aider/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ variable "base_aider_config" {
default = null
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

locals {
app_slug = "aider"
Expand Down Expand Up @@ -246,6 +251,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port
start_script = <<-EOT
#!/bin/bash
set -o errexit
Expand Down
8 changes: 8 additions & 0 deletions registry/coder/modules/amazon-q/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ variable "agentapi_chat_based_path" {
default = false
}

variable "agentapi_port" {
type = number
description = "The port for the AgentAPI server."
default = 3284
}

# Expose status slug to the agent environment
resource "coder_env" "status_slug" {
agent_id = var.agent_id
Expand Down Expand Up @@ -231,6 +237,7 @@ module "agentapi" {
agentapi_version = var.agentapi_version
pre_install_script = var.pre_install_script
post_install_script = var.post_install_script
agentapi_port = var.agentapi_port

start_script = <<-EOT
#!/bin/bash
Expand Down Expand Up @@ -265,6 +272,7 @@ module "agentapi" {
ARG_CODER_MCP_APP_STATUS_SLUG='${local.app_slug}' \
ARG_CODER_MCP_INSTRUCTIONS='${base64encode(local.coder_mcp_instructions)}' \
ARG_REPORT_TASKS='${var.report_tasks}' \
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
/tmp/install.sh
EOT
}
Expand Down
2 changes: 1 addition & 1 deletion registry/coder/modules/amazon-q/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function configure_agent() {
--agent "$ARG_AGENT_NAME" \
--args "exp,mcp,server,--allowed-tools,coder_report_task,--instructions,'$ARG_CODER_MCP_INSTRUCTIONS_DECODED'" \
--env "CODER_MCP_APP_STATUS_SLUG=${ARG_CODER_MCP_APP_STATUS_SLUG}" \
--env "CODER_MCP_AI_AGENTAPI_URL=http://localhost:3284" \
--env "CODER_MCP_AI_AGENTAPI_URL=http://localhost:${ARG_AGENTAPI_PORT:-3284}" \
--env "CODER_AGENT_URL=${CODER_AGENT_URL}" \
--env "CODER_AGENT_TOKEN=${CODER_AGENT_TOKEN}" \
--force || echo "Warning: Failed to add Coder MCP server"
Expand Down
Loading