Skip to content

Commit 30123e7

Browse files
feat: add boundary pprof server in claude-code module (#503)
1 parent f7c1be7 commit 30123e7

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

registry/coder/modules/claude-code/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
1313
```tf
1414
module "claude-code" {
1515
source = "registry.coder.com/coder/claude-code/coder"
16-
version = "3.2.2"
16+
version = "3.3.0"
1717
agent_id = coder_agent.example.id
1818
workdir = "/home/coder/project"
1919
claude_api_key = "xxxx-xxxxx-xxxx"
@@ -51,7 +51,7 @@ module "claude-code" {
5151
boundary_log_level = "WARN"
5252
boundary_additional_allowed_urls = ["GET *google.com"]
5353
boundary_proxy_port = "8087"
54-
version = "3.2.1"
54+
version = "3.3.0"
5555
}
5656
```
5757

@@ -70,7 +70,7 @@ data "coder_parameter" "ai_prompt" {
7070
7171
module "claude-code" {
7272
source = "registry.coder.com/coder/claude-code/coder"
73-
version = "3.2.2"
73+
version = "3.3.0"
7474
agent_id = coder_agent.example.id
7575
workdir = "/home/coder/project"
7676
@@ -106,7 +106,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
106106
```tf
107107
module "claude-code" {
108108
source = "registry.coder.com/coder/claude-code/coder"
109-
version = "3.2.2"
109+
version = "3.3.0"
110110
agent_id = coder_agent.example.id
111111
workdir = "/home/coder"
112112
install_claude_code = true
@@ -129,7 +129,7 @@ variable "claude_code_oauth_token" {
129129
130130
module "claude-code" {
131131
source = "registry.coder.com/coder/claude-code/coder"
132-
version = "3.2.2"
132+
version = "3.3.0"
133133
agent_id = coder_agent.example.id
134134
workdir = "/home/coder/project"
135135
claude_code_oauth_token = var.claude_code_oauth_token
@@ -202,7 +202,7 @@ resource "coder_env" "bedrock_api_key" {
202202
203203
module "claude-code" {
204204
source = "registry.coder.com/coder/claude-code/coder"
205-
version = "3.2.2"
205+
version = "3.3.0"
206206
agent_id = coder_agent.example.id
207207
workdir = "/home/coder/project"
208208
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
@@ -259,7 +259,7 @@ resource "coder_env" "google_application_credentials" {
259259
260260
module "claude-code" {
261261
source = "registry.coder.com/coder/claude-code/coder"
262-
version = "3.2.2"
262+
version = "3.3.0"
263263
agent_id = coder_agent.example.id
264264
workdir = "/home/coder/project"
265265
model = "claude-sonnet-4@20250514"

registry/coder/modules/claude-code/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ variable "boundary_proxy_port" {
228228
default = "8087"
229229
}
230230

231+
variable "enable_boundary_pprof" {
232+
type = bool
233+
description = "Whether to enable coder boundary pprof server"
234+
default = false
235+
}
236+
237+
variable "boundary_pprof_port" {
238+
type = string
239+
description = "Port for pprof server used by Boundary"
240+
default = "6067"
241+
}
242+
231243
resource "coder_env" "claude_code_md_path" {
232244
count = var.claude_md_path == "" ? 0 : 1
233245

@@ -343,6 +355,8 @@ module "agentapi" {
343355
ARG_BOUNDARY_LOG_LEVEL='${var.boundary_log_level}' \
344356
ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS='${join(" ", var.boundary_additional_allowed_urls)}' \
345357
ARG_BOUNDARY_PROXY_PORT='${var.boundary_proxy_port}' \
358+
ARG_ENABLE_BOUNDARY_PPROF='${var.enable_boundary_pprof}' \
359+
ARG_BOUNDARY_PPROF_PORT='${var.boundary_pprof_port}' \
346360
ARG_CODER_HOST='${local.coder_host}' \
347361
/tmp/start.sh
348362
EOT

registry/coder/modules/claude-code/scripts/start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ARG_BOUNDARY_VERSION=${ARG_BOUNDARY_VERSION:-"main"}
2222
ARG_BOUNDARY_LOG_DIR=${ARG_BOUNDARY_LOG_DIR:-"/tmp/boundary_logs"}
2323
ARG_BOUNDARY_LOG_LEVEL=${ARG_BOUNDARY_LOG_LEVEL:-"WARN"}
2424
ARG_BOUNDARY_PROXY_PORT=${ARG_BOUNDARY_PROXY_PORT:-"8087"}
25+
ARG_ENABLE_BOUNDARY_PPROF=${ARG_ENABLE_BOUNDARY_PPROF:-false}
26+
ARG_BOUNDARY_PPROF_PORT=${ARG_BOUNDARY_PPROF_PORT:-"6067"}
2527
ARG_CODER_HOST=${ARG_CODER_HOST:-}
2628

2729
echo "--------------------------------"
@@ -155,6 +157,12 @@ function start_agentapi() {
155157
# Set log level for boundary
156158
BOUNDARY_ARGS+=(--log-level $ARG_BOUNDARY_LOG_LEVEL)
157159

160+
if [ "${ARG_ENABLE_BOUNDARY_PPROF:-false}" = "true" ]; then
161+
# Enable boundary pprof server on specified port
162+
BOUNDARY_ARGS+=(--pprof)
163+
BOUNDARY_ARGS+=(--pprof-port ${ARG_BOUNDARY_PPROF_PORT})
164+
fi
165+
158166
# Remove --dangerously-skip-permissions from ARGS when using boundary (it doesn't work with elevated permissions)
159167
# Create a new array without the dangerous permissions flag
160168
CLAUDE_ARGS=()

0 commit comments

Comments
 (0)