- Add .devcontainer configuration with Chrome dependencies - Create post-create script to install Chrome and required libraries - Update BrowserSession.ts with sandbox flags for container environments - Update UrlContentFetcher.ts with container-specific Chrome flags - Add documentation for Codespaces setup This fixes the issue where the browser tool would fail in GitHub Codespaces due to missing Chrome/Chromium dependencies like libatk-1.0.so.0. Fixes #7990 |
||
|---|---|---|
| .. | ||
| devcontainer.json | ||
| post-create.sh | ||
| README.md | ||
GitHub Codespaces Configuration for Roo Code
This directory contains the configuration files needed to run Roo Code in GitHub Codespaces with full browser tool support.
What's Included
Chrome/Chromium Support
The configuration automatically installs Google Chrome and all necessary dependencies for Puppeteer to work correctly in the Codespace environment. This resolves the issue where the browser tool would fail with missing library errors like libatk-1.0.so.0.
Files
-
devcontainer.json: Main configuration file that defines the development container- Uses Node.js 20 TypeScript image
- Installs essential VS Code extensions
- Configures environment variables for Puppeteer
- Sets up port forwarding for development servers
-
post-create.sh: Script that runs after the container is created- Installs Chrome browser and all required system libraries
- Configures Chrome for headless operation in containers
- Installs project dependencies
- Sets up the development environment
How It Works
- When you create a new Codespace, GitHub reads the
devcontainer.jsonconfiguration - It creates a container based on the specified Node.js image
- The
post-create.shscript runs automatically to:- Install Chrome and its dependencies
- Configure Chrome with appropriate flags for container environments
- Install pnpm and project dependencies
- Build the project
Browser Tool Compatibility
The browser tool now works seamlessly in Codespaces by:
- Installing all required Chrome/Chromium dependencies
- Adding necessary sandbox flags (
--no-sandbox,--disable-setuid-sandbox) for container environments - Detecting when running in Codespaces via the
CODESPACESenvironment variable - Automatically applying the correct configuration
Testing the Browser Tool
After creating a Codespace with this configuration, you can test the browser tool:
- Open the Roo Code extension in the Codespace
- Try a task that uses the browser tool, such as:
- "Open google.com and take a screenshot"
- "Navigate to a website and extract information"
- "Test a local development server"
Troubleshooting
If you encounter issues:
- Chrome not found: Run
.devcontainer/post-create.shmanually - Permission errors: The script uses
sudowhere needed, but ensure you're running as the correct user - Browser tool still failing: Check that Chrome is installed:
google-chrome-stable --version
Environment Variables
The following environment variables are set for Puppeteer compatibility:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false: Ensures Puppeteer can download Chromium if neededPUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable: Points to the installed Chrome binary
Additional Notes
- The configuration includes common development tools (git, vim, jq, curl)
- VS Code extensions for TypeScript, ESLint, and Prettier are pre-installed
- The container runs with additional capabilities for debugging (
SYS_PTRACE) - Ports 3000 and 5173 are automatically forwarded for web development