Skip to content

Commit 17effeb

Browse files
hannesrudolphroomote[bot]brunobergher
authored
Getting ready for 4.0 (#390)
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Bruno Bergher <[email protected]>
1 parent 2835927 commit 17effeb

28 files changed

+555
-456
lines changed

docs/advanced-usage/available-tools/read-file.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ This tool reads the content of a specified file and returns it with line numbers
7474
- Can read specific portions of files by specifying line ranges
7575
- Extracts readable text from PDF and DOCX files
7676
- **Image support**: Displays images in multiple formats (PNG, JPG, JPEG, GIF, WebP, SVG, BMP, ICO, TIFF)
77+
- **Intelligent reading**: Token-budget aware reading that auto-truncates to fit remaining budget instead of failing
78+
- **Large file preview**: Returns a 100KB preview for very large files to enable quick inspection
79+
- **Graceful error recovery**: Recovers from stream errors and guides you to use line_range for targeted reads
7780
- Automatically truncates large text files when no line range is specified, showing the beginning of the file
7881
- Provides method summaries with line ranges for truncated large code files
7982
- Efficiently streams only requested line ranges for better performance
@@ -113,12 +116,13 @@ When the `maxConcurrentFileReads` setting is greater than 1, the `read_file` too
113116

114117
## Limitations
115118

116-
- May not handle extremely large files efficiently without using line range parameters
119+
- **Large files**: For extremely large files, the tool provides a preview and guides you to use line_range for targeted reading
117120
- For binary files (except PDF, DOCX, and supported image formats), may return content that isn't human-readable
118121
- **Multi-file mode**: Requires `maxConcurrentFileReads` > 1 in settings
119122
- **Image files**: Returns base64-encoded data URLs which may be large for high-resolution images
120123
- Default max single image size: 20MB
121124
- Default max total image size: 20MB
125+
- **Token budget**: Automatically truncates content to fit remaining token budget to prevent context overruns
122126

123127
---
124128

@@ -148,7 +152,14 @@ The tool uses a clear decision hierarchy to determine how to read a file:
148152
- The implementation efficiently streams only the requested lines, making it suitable for processing large files
149153
- This takes precedence over all other options
150154

151-
2. **Second Priority: Automatic Truncation for Large Text Files**
155+
2. **Second Priority: Token Budget Management**
156+
- The tool respects the remaining token budget to prevent context overruns
157+
- If a file would exceed the remaining budget, it automatically truncates to fit
158+
- For very large files (exceeding practical limits), returns a 100KB preview for quick inspection
159+
- Provides guidance to use `line_range` for targeted reading of specific sections
160+
- Recovers gracefully from stream errors and suggests alternative approaches
161+
162+
3. **Third Priority: Automatic Truncation for Large Text Files**
152163
- This applies only when **all** of the following conditions are met:
153164
- Neither `start_line` nor `end_line` is specified.
154165
- The file is identified as a text-based file (not binary like PDF/DOCX).
@@ -159,7 +170,7 @@ The tool uses a clear decision hierarchy to determine how to read a file:
159170
- For code files, it may also append a summary of source code definitions found within the truncated portion.
160171
- **Special Case - Definitions Only Mode**: When `maxReadFileLine` is set to `0`, the tool returns only source code definitions without any file content.
161172

162-
3. **Default Behavior: Read Entire File**
173+
4. **Default Behavior: Read Entire File**
163174
- If neither an explicit range is given nor automatic truncation applies (e.g., the file is within the line limit, or it's a supported binary type), the tool reads the entire content.
164175
- For supported formats like PDF and DOCX, it attempts to extract the full text content.
165176
- For image formats, it returns a base64-encoded data URL that can be displayed in the chat interface.
@@ -291,6 +302,44 @@ If the file is excluded by rules in a `.rooignore` file:
291302
<read_file>
292303
<path>.env</path>
293304
</read_file>
305+
### Intelligent Reading with Token Budget Management
306+
307+
When reading large files, the tool automatically manages token budgets to prevent context overruns:
308+
309+
**Scenario:** Reading a very large file without specifying a line range.
310+
311+
**Input:**
312+
```xml
313+
<read_file>
314+
<path>logs/massive-debug.log</path>
315+
</read_file>
316+
```
317+
318+
**Simulated Output (for a file exceeding token budget):**
319+
```
320+
[First 100KB of file content shown as preview...]
321+
322+
[File exceeds remaining token budget. Showing 100KB preview. Use line_range to read specific sections.]
323+
```
324+
325+
This intelligent behavior ensures that:
326+
- Small files read completely with zero overhead
327+
- Large files auto-truncate to fit remaining token budget
328+
- Very large files provide a quick preview
329+
- You receive guidance to use `line_range` for targeted reads
330+
- Stream errors are recovered gracefully
331+
332+
**Example with line_range for targeted reading:**
333+
```xml
334+
<read_file>
335+
<path>logs/massive-debug.log</path>
336+
<start_line>1000</start_line>
337+
<end_line>1100</end_line>
338+
</read_file>
339+
```
340+
341+
---
342+
294343
```
295344
296345
**Simulated Output (Error):**

docs/advanced-usage/available-tools/search-files.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The tool accepts these parameters:
2626
- `path` (required): The path of the directory to search in, relative to the current workspace directory. The search is confined to the workspace.
2727
- `regex` (required): The regular expression pattern to search for (uses Rust regex syntax)
2828
- `file_pattern` (optional): Glob pattern to filter files (e.g., '*.ts' for TypeScript files)
29+
- `respect_gitignore` (optional): Whether to respect `.gitignore` patterns (default: `true`). Set to `false` to search all files including those in `.gitignore`.
2930

3031
---
3132

@@ -47,6 +48,7 @@ This tool searches across files in a specified directory using regular expressio
4748
## Key Features
4849

4950
- Searches across multiple files in a single operation using high-performance Ripgrep
51+
- **Respects .gitignore**: Automatically excludes files and directories listed in `.gitignore` (including nested `.gitignore` files)
5052
- Shows context around each match (1 line before and after)
5153
- Filters files by type using glob patterns (e.g., only TypeScript files)
5254
- Provides line numbers for easy reference
@@ -66,6 +68,7 @@ This tool searches across files in a specified directory using regular expressio
6668
- Default context size is fixed (1 line before and after)
6769
- May display varying context sizes when matches are close together due to result grouping
6870
- For security, searches are strictly limited to the current workspace and cannot access parent directories or other locations on the file system.
71+
- **Respects .gitignore by default**: Files listed in `.gitignore` are excluded from searches unless explicitly overridden with `respect_gitignore: false`
6972

7073
---
7174

@@ -153,9 +156,47 @@ Finding all usages of a specific function:
153156
```
154157

155158
Searching for a specific import pattern across the entire project:
156-
```
159+
```xml
157160
<search_files>
158161
<path>.</path>
159162
<regex>import\s+.*\s+from\s+['"]@components/</regex>
160163
</search_files>
161164
```
165+
## Respecting .gitignore
166+
167+
By default, `search_files` respects `.gitignore` patterns in your workspace, including nested `.gitignore` files. This prevents searches in excluded directories like `node_modules/`, `dist/`, or other ignored paths.
168+
169+
### Default Behavior (Respecting .gitignore)
170+
171+
**Input:**
172+
```xml
173+
<search_files>
174+
<path>.</path>
175+
<regex>TODO</regex>
176+
</search_files>
177+
```
178+
179+
This search will **exclude** files and directories listed in `.gitignore`, ensuring focused results on tracked code.
180+
181+
### Overriding .gitignore (Search All Files)
182+
183+
To search **all files** including those in `.gitignore`, explicitly set `respect_gitignore` to `false`:
184+
185+
**Input:**
186+
```xml
187+
<search_files>
188+
<path>.</path>
189+
<regex>TODO</regex>
190+
<respect_gitignore>false</respect_gitignore>
191+
</search_files>
192+
```
193+
194+
This searches **everything**, including `node_modules/`, build artifacts, and other ignored paths.
195+
196+
**When to override:**
197+
- Debugging issues in dependencies or build output
198+
- Searching through generated code
199+
- Comprehensive audits that need to check all files
200+
- Investigating ignored configuration files
201+
202+
---

docs/features/browser-use.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Roo Code provides sophisticated browser automation capabilities that let you int
3535
<div style={{ marginTop: '20px' }}></div>
3636

3737
:::caution Model Support Required
38-
Browser Use within Roo Code requires the use of Claude Sonnet 3.5 or 3.7
38+
Browser Use within Roo Code requires models that support images. Some models may not navigate pages well.
3939
:::
4040

4141
---
@@ -56,7 +56,7 @@ All of this happens directly within VS Code, with no setup required.
5656

5757
A typical browser interaction follows this pattern:
5858

59-
**Important:** Browser Use requires Claude Sonnet 3.5 or 3.7 model.
59+
**Important:** Browser Use requires models that support images (vision-capable models).
6060

6161
1. Ask Roo to visit a website
6262
2. Roo launches the browser and shows you a screenshot

docs/features/checkpoints.mdx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,21 @@ Checkpoints let you:
5353
Access checkpoint settings in Roo Code settings under the "Checkpoints" section:
5454

5555
1. Open Settings by clicking the gear icon <Codicon name="gear" /> → Checkpoints
56-
2. Check or uncheck the "Enable automatic checkpoints" checkbox
56+
2. Configure checkpoint behavior:
57+
- Check or uncheck the "Enable automatic checkpoints" checkbox
58+
- Adjust the "Checkpoint initialization timeout" (10-60 seconds, default: 30s)
5759

5860
<img src="/img/checkpoints/checkpoints.png" alt="Checkpoint settings in Roo Code configuration" width="500" />
5961

62+
#### Checkpoint Initialization Timeout
63+
64+
Controls how long the system waits for checkpoint initialization to complete before showing a warning. If your project has many files or is on slower storage, increasing this timeout can prevent premature warnings.
65+
66+
- **Range**: 10-60 seconds
67+
- **Default**: 30 seconds
68+
- **When to increase**: Large projects, slow disk I/O, or network-mounted directories
69+
- **Location**: Settings → Checkpoints → "Checkpoint initialization timeout"
70+
6071
---
6172

6273
## How Checkpoints Work
@@ -85,13 +96,13 @@ Checkpoints appear directly in your chat history:
8596
- **Regular checkpoints** are created before file modifications, allowing easy undo of any changes
8697
<img src="/img/checkpoints/checkpoints-2.png" alt="Regular checkpoint indicator in chat" width="500" />
8798

88-
Each checkpoint provides two primary functions:
99+
Each checkpoint provides two primary functions that are always available in both the chat history and checkpoint menu:
89100

90101
### Viewing Differences
91102

92103
To compare your current workspace with a previous checkpoint:
93104

94-
1. Locate the checkpoint in your chat history
105+
1. Locate the checkpoint in your chat history or open the checkpoint menu
95106
2. Click the checkpoint's `View Differences` button
96107

97108
<img src="/img/checkpoints/checkpoints-6.png" alt="View Differences button interface" width="100" />
@@ -107,10 +118,12 @@ To compare your current workspace with a previous checkpoint:
107118

108119
### Restoring Checkpoints
109120

121+
Restore options are always visible in checkpoint buttons and dialogs, regardless of whether changes are detected. This ensures you can always revert to any checkpoint state.
122+
110123
To restore a project to a previous checkpoint state:
111124

112-
1. Locate the checkpoint in your chat history
113-
2. Click the checkpoint's `Restore Checkpoint` button
125+
1. Locate the checkpoint in your chat history or checkpoint menu
126+
2. Click the checkpoint's `Restore Checkpoint` button (always visible)
114127
<img src="/img/checkpoints/checkpoints-7.png" alt="Restore checkpoint button interface" width="100" />
115128
3. Choose one of these restoration options:
116129

docs/providers/openrouter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ OpenRouter provides an [optional "middle-out" message transform](https://openrou
5858
* **Prompt Caching:**
5959
* OpenRouter passes caching requests to underlying models that support it. Check the [OpenRouter Models page](https://openrouter.ai/models) to see which models offer caching.
6060
* For most models, caching should activate automatically if supported by the model itself (similar to how Requesty works).
61+
* **Models with prompt caching support include:**
62+
* Anthropic Claude Sonnet 3.5, 3.7
63+
* Anthropic Claude Haiku 3.5
64+
* **Anthropic Claude Haiku 4.5** (newly added)
65+
* Google Gemini models (with manual activation - see below)
6166
* **Exception for Gemini Models via OpenRouter:** Due to potential response delays sometimes observed with Google's caching mechanism when accessed via OpenRouter, a manual activation step is required *specifically for Gemini models*.
6267
* If using a **Gemini model** via OpenRouter, you **must manually check** the "Enable Prompt Caching" box in the provider settings to activate caching for that model. This checkbox serves as a temporary workaround. For non-Gemini models on OpenRouter, this checkbox is not necessary for caching.
6368
* **Bring Your Own Key (BYOK):** If you use your own key for the underlying service, OpenRouter charges 5% of what it normally would. Roo Code automatically adjusts the cost calculation to reflect this.

docs/providers/zai.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ Z AI (Zhipu AI) provides advanced language models with the GLM-4.5 series. The p
4545
Z AI provides different model catalogs based on your selected region:
4646

4747
### International Models
48+
* **GLM-4.6** - Context: 200K tokens
49+
* **GLM-4.5-X** - Enhanced reasoning and analysis capabilities
50+
* **GLM-4.5-AirX** - Balanced performance and efficiency
51+
* **GLM-4.5-Flash** - Optimized for speed with lower latency
4852
* GLM-4.5 series models
4953
* GLM-4.5-Air models
5054

5155
### China Mainland Models
56+
* **GLM-4.6** - Context: 200K tokens
57+
* **GLM-4.5-X** - Enhanced reasoning and analysis capabilities
58+
* **GLM-4.5-AirX** - Balanced performance and efficiency
59+
* **GLM-4.5-Flash** - Optimized for speed with lower latency
5260
* GLM-4.5 series models
5361
* GLM-4.5-Air models
5462

docs/roo-code-cloud/analytics.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
description: Track usage and credits in Roo Code Cloud. View tokens, tasks, estimated cost, and credit consumption over time; learn where to check spend for Cloud Agents.
3+
keywords:
4+
- Roo Code Cloud
5+
- analytics
6+
- usage
7+
- tokens
8+
- credits
9+
- cost
10+
image: /img/social-share.jpg
11+
redirect_from:
12+
- /roo-code-cloud/dashboard
13+
- /roo-code-cloud/dashboard/
14+
- /roo-code-cloud/dashboard#usage-analytics-page
15+
---
16+
17+
# Analytics
18+
19+
Analytics lets you track tokens, tasks, inference cost, and Cloud Agent credits usage in aggregate or according to a range of filters, defined by you. It's all free.
20+
21+
## Access
22+
23+
- Just go to the [Analytics](https://app.roocode.com/usage) tab
24+
25+
## What's tracked
26+
27+
- For Cloud Agents, all tasks are tracked and considered for analytics
28+
- For the extension, only tasks you run while logged in get reported for analytics. You can turn off [task sync](/roo-code-cloud/task-sync) so the contents of tasks aren't sent to Cloud, but usage numbers are always reported while you're logged into the extension. That allows you to keep certain tasks away from Cloud while still benefiting from usage analytics.

0 commit comments

Comments
 (0)