* fix: addLineNumbers handling of empty content Empty files should not have line numbers, but non-empty files with empty content at a specific line offset should. - If content is empty, return empty string for empty files - If content is empty but startLine > 1, return line number for empty content at that offset This ensures that the model does not think the file contains a single empty line. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * refactor: improve readFileTool XML output format - Remove unnecessary XML indentation that could confuse the model - Separate file content from notices and errors using dedicated tags - Add line range information to content tags - Handle empty files properly with self-closing tags - Add comprehensive test coverage Fixes #2278 Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * fix: always show line numbers in read_file XML output - Always display line numbers in non-range reads - Improve XML formatting with consistent newlines for better readability Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * test: update tests to match new XML format with line numbers - Update test expectations to match the new XML format with newlines - Update tests to expect line numbers attribute in content tags - Modify test assertions to check for the correct line range values Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * fix: consistent blank line handling in addLineNumbers - Add newline to all output - Handle trailing newlines and empty lines consistently - Add test cases for blank lines: - Multiple blank lines within content - Multiple trailing blank lines - Only blank lines with offset - Trailing newlines Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * test: use actual addLineNumbers in read-file-xml tests - Modified extract-text mock to preserve actual addLineNumbers implementation - Removed mock implementation of addLineNumbers - Updated test data to account for trailing newline - Removed unnecessary mock verification Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * test: ensure actual addLineNumbers function is called in tests - Replace direct mocking of addLineNumbers with spy on actual implementation - Add verification to ensure the real function is called when appropriate - Add skipAddLineNumbersCheck option for cases where function should not be called - Update test cases to use appropriate verification options - Fix numberedFileContent to include trailing newline for consistency Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * fix: modify readLines to process data directly instead of line by line - Direct data processing provides more accurate results by preserving exact content with carriage returns - Improved performance through minimal buffering and efficient string operations - Use string indexes to find newlines while maintaining their original format - Handle all edge cases correctly with preserved line endings - Add tests for various edge cases including empty files, single lines, and different line endings Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> * test: remove unused mockInputContent variable Remove unused variable declaration to appease ellipsis-dev linter requirements. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> --------- Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org> |
||
|---|---|---|
| .changeset | ||
| .github | ||
| .husky | ||
| .roo | ||
| .vscode | ||
| assets | ||
| audio | ||
| cline_docs | ||
| e2e | ||
| evals | ||
| locales | ||
| scripts | ||
| src | ||
| webview-ui | ||
| .env.sample | ||
| .eslintrc.json | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitconfig | ||
| .gitignore | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .rooignore | ||
| .roomodes | ||
| .tool-versions | ||
| .vscodeignore | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| ellipsis.yaml | ||
| esbuild.js | ||
| flake.lock | ||
| flake.nix | ||
| jest.config.js | ||
| knip.json | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| PRIVACY.md | ||
| README.md | ||
| tsconfig.json | ||
English • Català • Deutsch • Español • Français • हिन्दी • Italiano
日本語 • 한국어 • Polski • Português (BR) • Türkçe • Tiếng Việt • 简体中文 • 繁體中文
Join the Roo Code Community
Connect with developers, contribute ideas, and stay ahead with the latest AI-powered coding tools.
Roo Code is an AI-powered autonomous coding agent that lives in your editor. It can:
- Communicate in natural language
- Read and write files directly in your workspace
- Run terminal commands
- Automate browser actions
- Integrate with any OpenAI-compatible or custom API/model
- Adapt its “personality” and capabilities through Custom Modes
Whether you’re seeking a flexible coding partner, a system architect, or specialized roles like a QA engineer or product manager, Roo Code can help you build software more efficiently.
Check out the CHANGELOG for detailed updates and fixes.
🎉 Roo Code 3.11 Released
Roo Code 3.11 brings significant performance improvements and new features!
- Fast Edits - Edits now apply way faster. Less waiting, more coding.
- API Key Balances - View your OpenRouter and Requesty balances in settings.
- Project-Level MCP Config - Now you can configure it per project/workspace.
- Improved Gemini Support - Smarter retries, fixed escaping, added to Vertex provider.
- Import/Export Settings - Easily back up or share your config across setups.
What Can Roo Code Do?
- 🚀 Generate Code from natural language descriptions
- 🔧 Refactor & Debug existing code
- 📝 Write & Update documentation
- 🤔 Answer Questions about your codebase
- 🔄 Automate repetitive tasks
- 🏗️ Create new files and projects
Quick Start
Key Features
Multiple Modes
Roo Code adapts to your needs with specialized modes:
- Code Mode: For general-purpose coding tasks
- Architect Mode: For planning and technical leadership
- Ask Mode: For answering questions and providing information
- Debug Mode: For systematic problem diagnosis
- Custom Modes: Create unlimited specialized personas for security auditing, performance optimization, documentation, or any other task
Smart Tools
Roo Code comes with powerful tools that can:
- Read and write files in your project
- Execute commands in your VS Code terminal
- Control a web browser
- Use external tools via MCP (Model Context Protocol)
MCP extends Roo Code's capabilities by allowing you to add unlimited custom tools. Integrate with external APIs, connect to databases, or create specialized development tools - MCP provides the framework to expand Roo Code's functionality to meet your specific needs.
Customization
Make Roo Code work your way with:
- Custom Instructions for personalized behavior
- Custom Modes for specialized tasks
- Local Models for offline use
- Auto-Approval Settings for faster workflows
Resources
Documentation
Community
- Discord: Join our Discord server for real-time help and discussions
- Reddit: Visit our subreddit to share experiences and tips
- GitHub: Report issues or request features
Local Setup & Development
- Clone the repo:
git clone https://github.com/RooVetGit/Roo-Code.git
- Install dependencies:
npm run install:all
- Start the webview (Vite/React app with HMR):
npm run dev
- Debug:
Press
F5(or Run → Start Debugging) in VSCode to open a new session with Roo Code loaded.
Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.
Alternatively you can build a .vsix and install it directly in VSCode:
npm run build
A .vsix file will appear in the bin/ directory which can be installed with:
code --install-extension bin/roo-cline-<version>.vsix
We use changesets for versioning and publishing. Check our CHANGELOG.md for release notes.
Disclaimer
Please note that Roo Code, Inc does not make any representations or warranties regarding any code, models, or other tools provided or made available in connection with Roo Code, any associated third-party tools, or any resulting outputs. You assume all risks associated with the use of any such tools or outputs; such tools are provided on an "AS IS" and "AS AVAILABLE" basis. Such risks may include, without limitation, intellectual property infringement, cyber vulnerabilities or attacks, bias, inaccuracies, errors, defects, viruses, downtime, property loss or damage, and/or personal injury. You are solely responsible for your use of any such tools or outputs (including, without limitation, the legality, appropriateness, and results thereof).
Contributing
We love community contributions! Get started by reading our CONTRIBUTING.md.
Contributors
Thanks to all our contributors who have helped make Roo Code better!
License
Apache 2.0 © 2025 Roo Code, Inc.
Enjoy Roo Code! Whether you keep it on a short leash or let it roam autonomously, we can’t wait to see what you build. If you have questions or feature ideas, drop by our Reddit community or Discord. Happy coding!