* feat: Implement Claude orchestration with session management
- Add CLAUDE_WEBHOOK_SECRET for webhook authentication
- Fix Docker volume mounting for Claude credentials
- Capture Claude's internal session ID from stream-json output
- Update entrypoint script to support OUTPUT_FORMAT=stream-json
- Fix environment variable naming (REPOSITORY -> REPO_FULL_NAME)
- Enable parallel session execution with proper authentication
- Successfully tested creating PRs via orchestrated sessions
This enables the webhook to create and manage Claude Code sessions that can:
- Clone repositories
- Create feature branches
- Implement code changes
- Commit and push changes
- Create pull requests
All while capturing Claude's internal session ID for potential resumption.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Update SessionManager tests for new implementation
- Update test to expect docker volume create instead of docker create
- Add unref() method to mock process objects to fix test environment error
- Update spawn expectations to match new docker run implementation
- Fix tests for both startSession and queueSession methods
Tests now pass in CI environment.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: Standardize Docker image naming and improve environment variable handling
- Standardize on 'claudecode:latest' image name across the codebase
- Update build script to use claudecode:latest instead of claude-code-runner:latest
- Fix health check to use CLAUDE_CONTAINER_IMAGE env var dynamically
- Improve environment variable handling for git configuration
- Pass BOT_EMAIL and BOT_USERNAME to containers
- Entrypoint scripts already use these with appropriate defaults
- Add comprehensive environment variables documentation
- Document all 90+ environment variables used in the project
- Identify hard-coded values that could be made configurable
- Update .env.example with missing variables
This ensures consistency in Docker image naming and allows proper git
configuration in containers using the configured bot identity.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Add BOT_EMAIL to docker-compose.yml
- Add BOT_EMAIL environment variable to docker-compose.yml
- Ensures git configuration in containers uses proper email address
- Complements the previous changes for environment variable handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Use BOT_USERNAME environment variable in prompt creation
- Fix undefined BOT_USERNAME reference in createPrompt function
- Change prompt to use actual bot username instead of hardcoded "Claude"
- Makes the prompt more accurate: "You are @MCPClaude" instead of "You are Claude"
This fixes the PR review functionality that was broken due to the
undefined variable reference.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Add verbose and stream-json output to Claude CLI for better debugging
- Add --verbose flag to see detailed Claude processing
- Add --output-format stream-json for structured output
- Helps diagnose issues with PR review and other operations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Use colon syntax for allowedTools in PR review to match auto-tagging
- Change from space syntax Bash(gh *) to colon syntax Bash(gh:*)
- This matches the working syntax used in auto-tagging
- Should fix the permission issues preventing PR reviews from posting
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Add Claude Code timeout configuration for unattended mode
- Add BASH_DEFAULT_TIMEOUT_MS (10 minutes) and BASH_MAX_TIMEOUT_MS (20 minutes)
- Pass timeout environment variables to Claude container
- Document new timeout settings in .env.example and environment-variables.md
- Better defaults for webhook mode where builds/tests may take longer
These timeouts are more suitable for unattended PR reviews and other
operations that might involve long-running commands like builds or tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: Improve production deployment configuration
- Update default port from 3003 to 3002 for consistency
- Make port configurable via environment variable in docker-compose
- Add .env file loading support in start-api.sh
- Optimize startup.sh for production (skip builds, expect pre-built dist)
- Make Claude Code image build conditional on Dockerfile availability
- Fix rate limiting configuration for proxy environments
- Remove jest types from tsconfig (not needed in production)
These changes improve deployment flexibility and production readiness.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Address PR review feedback
- Fix port inconsistency: Change hardcoded 3003 to 3002 in src/index.ts
- Fix security risk: Replace unsafe export command with set -a/source/set +a
- Remove unnecessary Dockerfile.claudecode volume mount from docker-compose
(The Dockerfile already copies all necessary files during build)
These changes address all critical issues identified in the PR review.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Updates volume mounts and entrypoint scripts to properly mount Claude
authentication directory from ~/.claude-hub to /home/node/.claude in
containers, enabling proper credential access and token refresh capability.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This comprehensive update adds support for Claude Max subscription authentication
and improves the overall authentication system with multiple methods:
🔐 Claude Authentication Enhancements:
- Add setup container method for Claude Max/20x subscription usage ($20-200/month)
- Create interactive authentication script (setup-claude-interactive.sh)
- Add authentication testing utility (test-claude-auth.sh)
- Support three authentication methods: Setup Container, API Key, AWS Bedrock
- Comprehensive authentication documentation
📁 Directory Configuration:
- Add CLAUDE_HUB_DIR environment variable (default: ~/.claude-hub)
- Update .gitignore to use .claude-hub/ instead of hardcoded paths
- Consistent environment variable usage across all scripts
🐙 GitHub Token Support:
- Add fine-grained GitHub token support (github_pat_) alongside classic tokens (ghp_)
- Update token validation in claudeService and githubService
- Enhanced token detection and authentication flow
📖 Documentation & Guides:
- Add complete Claude Authentication Guide with all three methods
- Add Setup Container Deep Dive documentation
- Update CLAUDE.md with quick start authentication section
- Comprehensive cost comparison and use case recommendations
🐳 Container & Docker Improvements:
- Update Dockerfile.claudecode with proper entrypoint script copying
- Add Dockerfile.claude-setup for interactive authentication
- Update docker-compose.yml with new port (3003) and environment variables
- Enhanced container volume mounting for authentication
🔧 Infrastructure Updates:
- Add TRUST_PROXY configuration for reverse proxy environments
- Update port configuration from 3002 to 3003
- Enhanced environment variable documentation in .env.example
- Debug utilities for troubleshooting authentication issues
This update enables Claude Max subscribers to use their existing subscriptions
for automation, potentially saving thousands in API costs while maintaining
full production capabilities.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove all Discord chatbot implementation files
- Remove generic chatbot provider infrastructure
- Update docker-compose.yml to use environment variables instead of Docker secrets
- Keep dual secret support (files take priority, env vars as fallback)
- Document secret configuration options in .env.example
- Clean up related tests and documentation
- Prepare codebase for CLI-first approach with future plugin architecture
This simplifies the codebase by removing incomplete chatbot functionality
while maintaining flexible secret management for both development and production.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove external n8n_default network reference to make the service standalone
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes automated PR review triggering by implementing intelligent check suite analysis:
Key improvements:
- Smart categorization of check suites (meaningful vs skipped vs timed-out)
- Handles conditional jobs that never start (5min timeout)
- Skips explicitly neutral/skipped check suites
- Prevents waiting for stale in-progress jobs (30min timeout)
- Enhanced logging for better debugging
- Backwards compatible with existing configuration
New environment variables:
- PR_REVIEW_MAX_WAIT_MS: Max wait for stale jobs (default: 30min)
- PR_REVIEW_CONDITIONAL_TIMEOUT_MS: Timeout for conditional jobs (default: 5min)
This resolves issues where PR reviews weren't triggering due to overly strict
wait-for-all logic that didn't account for skipped/conditional CI jobs.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: implement wait-for-all-checks PR review trigger
This change modifies the PR review triggering logic to wait for ALL check suites
to complete successfully before triggering a single PR review, preventing duplicate
reviews from different check suites (build, security scans, etc.).
Key changes:
- Added PR_REVIEW_WAIT_FOR_ALL_CHECKS env var (default: true)
- Added PR_REVIEW_DEBOUNCE_MS for configurable delay (default: 5000ms)
- Implemented checkAllCheckSuitesComplete() function that queries GitHub API
- Made PR_REVIEW_TRIGGER_WORKFLOW optional (only used when wait-for-all is false)
- Updated tests to handle new behavior
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct indentation and remove test-results from git
- Fix ESLint indentation errors in claudeService.js
- Remove test-results directory from git tracking (added to .gitignore)
🤖 Generated with Claude Code (https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add Claude CLI database sharing and backup system
- Mount host ~/.claude directory in container for shared context
- Add .dockerignore to optimize build context
- Create backup script with daily/weekly retention strategy
- Add cron setup for automated backups to /backup partition
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add missing makeGitHubRequest function to githubService
The checkAllCheckSuitesComplete function was failing because it tried to call
githubService.makeGitHubRequest which didn't exist. This was causing PR reviews
to never trigger with the 'Waiting for other check suites to complete' message.
Added the missing function to make direct GitHub API requests using Octokit.
* fix: add URL validation to makeGitHubRequest to prevent SSRF vulnerability
* refactor: remove makeGitHubRequest to fix SSRF vulnerability
- Replace makeGitHubRequest with getCheckSuitesForRef using Octokit
- Simplify getWorkflowNameFromCheckSuite to use app info from webhook
- Fix tests to match new implementation
- Add PR review environment variables to .env file
---------
Co-authored-by: Jonathan Flatt <jonflatt@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: ClaudeBot <claude@example.com>