Compare commits

..

1 Commits

Author SHA1 Message Date
Danny Kopping e149189b45 chore: add output for claude-code app id
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
2025-06-13 14:36:07 +02:00
2 changed files with 13 additions and 54 deletions
+4 -6
View File
@@ -17,7 +17,6 @@ jobs:
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -47,6 +46,7 @@ jobs:
- name: Check version bump requirements
id: version-check
run: |
# Run the script to check what versions should be
output_file=$(mktemp)
if ./.github/scripts/version-bump.sh "${{ steps.bump-type.outputs.type }}" origin/main > "$output_file" 2>&1; then
echo "Script completed successfully"
@@ -56,14 +56,17 @@ jobs:
exit 1
fi
# Store output for PR comment
{
echo "output<<EOF"
cat "$output_file"
echo "EOF"
} >> $GITHUB_OUTPUT
# Show output
cat "$output_file"
# Check if any files would be modified by the script
if git diff --quiet; then
echo "versions_up_to_date=true" >> $GITHUB_OUTPUT
echo "✅ All module versions are already up to date"
@@ -75,10 +78,6 @@ jobs:
echo ""
echo "Diff preview:"
git diff
git checkout .
git clean -fd
exit 1
fi
@@ -86,7 +85,6 @@ jobs:
if: failure() && steps.version-check.outputs.versions_up_to_date == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `${{ steps.version-check.outputs.output }}`;
const bumpType = `${{ steps.bump-type.outputs.type }}`;
+9 -48
View File
@@ -131,14 +131,9 @@ resource "coder_script" "claude_code" {
npm install -g @anthropic-ai/claude-code@${var.claude_code_version}
fi
# Hardcoded for now: install AgentAPI
wget https://github.com/coder/agentapi/releases/download/preview/agentapi-linux-amd64
chmod +x agentapi-linux-amd64
sudo mv agentapi-linux-amd64 /usr/local/bin/agentapi
if [ "${var.experiment_report_tasks}" = "true" ]; then
echo "Configuring Claude Code to report tasks via Coder MCP..."
coder exp mcp configure claude-code ${var.folder} --ai-agentapi-url http://localhost:3284
coder exp mcp configure claude-code ${var.folder}
fi
# Run post-install script if provided
@@ -171,24 +166,8 @@ resource "coder_script" "claude_code" {
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# use low width to fit in the tasks UI sidebar. height is adjusted to ~match the default 80k (80x1000) characters
# visible in the terminal screen.
tmux new-session -d -s claude-code-agentapi -c ${var.folder} 'agentapi server --term-width 67 --term-height 1190 -- bash -c "claude --dangerously-skip-permissions \"$CODER_MCP_CLAUDE_TASK_PROMPT\""; exec bash'
echo "Waiting for agentapi server to start on port 3284..."
for i in $(seq 1 15); do
if lsof -i :3284 | grep -q 'LISTEN'; then
echo "agentapi server started on port 3284."
break
fi
echo "Waiting... ($i/15)"
sleep 1
done
if ! lsof -i :3284 | grep -q 'LISTEN'; then
echo "Error: agentapi server did not start on port 3284 after 15 seconds."
exit 1
fi
tmux new-session -d -s claude-code -c ${var.folder} "agentapi attach"
# Create a new tmux session in detached mode
tmux new-session -d -s claude-code -c ${var.folder} "claude --dangerously-skip-permissions \"$CODER_MCP_CLAUDE_TASK_PROMPT\""
fi
@@ -238,20 +217,6 @@ resource "coder_script" "claude_code" {
run_on_start = true
}
resource "coder_app" "claude_code_web" {
slug = "claude-code-web"
display_name = "Claude Code Web"
agent_id = var.agent_id
url = "http://localhost:3284/"
icon = var.icon
subdomain = true
healthcheck {
url = "http://localhost:3284/status"
interval = 5
threshold = 3
}
}
resource "coder_app" "claude_code" {
slug = "claude-code"
display_name = "Claude Code"
@@ -264,20 +229,12 @@ resource "coder_app" "claude_code" {
export LC_ALL=en_US.UTF-8
if [ "${var.experiment_use_tmux}" = "true" ]; then
if ! tmux has-session -t claude-code-agentapi 2>/dev/null; then
echo "Starting a new Claude Code agentapi tmux session." | tee -a "$HOME/.claude-code.log"
# use low width to fit in the tasks UI sidebar. height is adjusted to ~match the default 80k (80x1000) characters
# visible in the terminal screen.
tmux new-session -d -s claude-code-agentapi -c ${var.folder} 'agentapi server --term-width 67 --term-height 1190 -- bash -c "claude --dangerously-skip-permissions"; exec bash'
fi
if tmux has-session -t claude-code 2>/dev/null; then
echo "Attaching to existing Claude Code tmux session." | tee -a "$HOME/.claude-code.log"
tmux attach-session -t claude-code
else
echo "Starting a new Claude Code tmux session." | tee -a "$HOME/.claude-code.log"
tmux new-session -s claude-code -c ${var.folder} "agentapi attach; exec bash"
tmux new-session -s claude-code -c ${var.folder} "claude --dangerously-skip-permissions | tee -a \"$HOME/.claude-code.log\"; exec bash"
fi
elif [ "${var.experiment_use_screen}" = "true" ]; then
if screen -list | grep -q "claude-code"; then
@@ -285,7 +242,7 @@ resource "coder_app" "claude_code" {
screen -xRR claude-code
else
echo "Starting a new Claude Code screen session." | tee -a "$HOME/.claude-code.log"
screen -S claude-code bash -c 'agentapi attach; exec bash'
screen -S claude-code bash -c 'claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log"; exec bash'
fi
else
cd ${var.folder}
@@ -296,3 +253,7 @@ resource "coder_app" "claude_code" {
order = var.order
group = var.group
}
output "app_id" {
value = coder_app.claude_code.id
}