Skip to content

Conversation

@35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Feb 3, 2026

Description

  • enhance start script and configuration options for AgentAPI server

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/agentapi
New version: v3.0.0
Breaking change: [x] Yes [ ] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

Closes: #696

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Feb 3, 2026

wip: do not review

@35C4n0r 35C4n0r self-assigned this Feb 4, 2026
@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Feb 4, 2026

This PR has been tested with claude-code module.

Subject: [PATCH] Changes
---
Index: registry/coder/modules/claude-code/scripts/start.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/registry/coder/modules/claude-code/scripts/start.sh b/registry/coder/modules/claude-code/scripts/start.sh
--- a/registry/coder/modules/claude-code/scripts/start.sh	(revision b580ec2abb8ac74d8cd4f266012abe7f947fe02a)
+++ b/registry/coder/modules/claude-code/scripts/start.sh	(date 1770213130569)
@@ -6,7 +6,6 @@
   command -v "$1" > /dev/null 2>&1
 }
 
-MODULE_PATH="$HOME/.claude-module"
 ARG_RESUME_SESSION_ID=${ARG_RESUME_SESSION_ID:-}
 ARG_CONTINUE=${ARG_CONTINUE:-false}
 ARG_DANGEROUSLY_SKIP_PERMISSIONS=${ARG_DANGEROUSLY_SKIP_PERMISSIONS:-}
@@ -217,7 +216,6 @@
 
   printf "Running claude code with args: %s\n" "$(printf '%q ' "${ARGS[@]}")"
 
-  # Write the agent command to agent-command.sh
   if [ "$ARG_ENABLE_BOUNDARY" = "true" ]; then
     install_boundary
 
@@ -240,28 +238,12 @@
       BOUNDARY_CMD=("$CODER_NO_CAPS" "boundary")
     fi
 
-    # Build properly quoted command arguments
-    boundary_cmd=$(printf '%q ' "${BOUNDARY_CMD[@]}" "${BOUNDARY_ARGS[@]}")
-    claude_args=$(printf '%q ' "${ARGS[@]}")
-
-    # Write command to agent-command.sh with boundary
-    cat > "$MODULE_PATH/agent-command.sh" << EOF
-#!/bin/bash
-${BOUNDARY_CMD[@]} -- claude ${ARGS[@]}
-EOF
+    agentapi server --type claude --term-width 67 --term-height 1190 -- \
+      "${BOUNDARY_CMD[@]}" "${BOUNDARY_ARGS[@]}" -- \
+      claude "${ARGS[@]}"
   else
-    # Build properly quoted command arguments
-    claude_args=$(printf '%q ' "${ARGS[@]}")
-
-    # Write command to agent-command.sh without boundary
-    cat > "$MODULE_PATH/agent-command.sh" << EOF
-#!/bin/bash
-claude ${ARGS[@]}
-EOF
+    agentapi server --type claude --term-width 67 --term-height 1190 -- claude "${ARGS[@]}"
   fi
-
-  chmod +x "$MODULE_PATH/agent-command.sh"
-  printf "Agent command written to %s\n" "$MODULE_PATH/agent-command.sh"
 }
 
 validate_claude_installation
Index: registry/coder/modules/claude-code/main.tf
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf
--- a/registry/coder/modules/claude-code/main.tf	(revision b580ec2abb8ac74d8cd4f266012abe7f947fe02a)
+++ b/registry/coder/modules/claude-code/main.tf	(date 1770213130569)
@@ -362,8 +362,8 @@
 }
 
 module "agentapi" {
-  source = "git::https://github.com/coder/registry.git//registry/coder/modules/agentapi?ref=35C4n0r/feat-agentapi-architecture-improv"
-  # version = "2.0.0"
+  source  = "registry.coder.com/coder/agentapi/coder"
+  version = "2.0.0"
 
   agent_id             = var.agent_id
   web_app_slug         = local.app_slug
@@ -377,7 +377,6 @@
   cli_app_display_name = var.cli_app ? var.cli_app_display_name : null
   agentapi_subdomain   = var.subdomain
   module_dir_name      = local.module_dir_name
-  agentapi_server_type = "claude"
   install_agentapi     = var.install_agentapi
   agentapi_version     = var.agentapi_version
   pre_install_script   = var.pre_install_script
@@ -386,7 +385,6 @@
      #!/bin/bash
      set -o errexit
      set -o pipefail
-
      echo -n '${base64encode(local.start_script)}' | base64 -d > /tmp/start.sh
      chmod +x /tmp/start.sh
 

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.

Improve agentapi module abstraction for configuration and flags

1 participant