Commit graph

3400 commits

Author SHA1 Message Date
Hannes Rudolph
bb5ee6c0f2 fix: add activeTerminalSessions to initial state in ExtensionStateContext and test mock 2026-01-28 14:55:27 -07:00
Hannes Rudolph
1071717537 feat(ui): add terminal session indicator in TaskHeader
- Add activeTerminalSessions count to ExtensionState type
- Add ProcessManager query in ClineProvider.getState() to count running sessions
- Add TerminalSquare icon indicator in TaskHeader showing session count
- Show indicator only when there are active sessions (green icon + count)
- Add i18n translations for terminal session tooltip
- Update ExtensionStateContext test with new property
2026-01-28 14:40:13 -07:00
Hannes Rudolph
cb28f75fff feat: add stdin support for ExecaTerminalProcess
- Add writeStdin method to RooTerminalProcess interface
- Add abstract writeStdin to BaseTerminalProcess
- Implement writeStdin in ExecaTerminalProcess using stdin pipe
- Implement writeStdin in TerminalProcess using terminal.sendText
- Change ExecaTerminalProcess from stdin: 'ignore' to stdin: 'pipe'
- Update WriteStdinTool to use unified process.writeStdin() method

This enables write_stdin tool to work with both VSCode terminals and
Execa terminals, providing consistent interactive terminal support.
2026-01-28 14:40:13 -07:00
Hannes Rudolph
c9af762114 feat: add terminate_session and list_sessions tools
- Add terminate_session tool to kill running terminal sessions
- Add list_sessions tool to view active terminal sessions
- Add listSessions and terminateSession methods to ProcessManager
- Create native tool schemas for both tools
- Create tool handlers (TerminateSessionTool, ListSessionsTool)
- Add routing in presentAssistantMessage.ts
- Add parsing support in NativeToolCallParser.ts
- Add 8 new tests for ProcessManager methods (23 total tests)

These tools complement write_stdin to provide complete terminal session management:
- execute_command starts a process (returns session_id if still running)
- write_stdin sends input to running processes
- list_sessions shows all active sessions
- terminate_session kills a running session
2026-01-28 14:40:13 -07:00
Hannes Rudolph
3b99b936f8 feat: add write_stdin tool for interactive terminal support
This commit implements the interactive terminal feature from the terminal
integration specification (plans/extract-terminal-integration.md).

Changes:
- Add write_stdin to toolNames in packages/types/src/tool.ts
- Create write_stdin native tool schema in src/core/prompts/tools/native-tools/
- Create WriteStdinTool handler in src/core/tools/
- Add ProcessManager to track running processes by session_id
- Modify ExecuteCommandTool to register processes when still running
- Add write_stdin to tool routing in presentAssistantMessage.ts
- Add write_stdin to NativeToolCallParser for streaming support
- Add tests for ProcessManager

The write_stdin tool enables the LLM to:
- Send input to running terminal processes (y/n prompts, passwords)
- Send control characters like Ctrl+C (\x03)
- Poll for new output from long-running processes

When execute_command starts a process that's still running after the
yield time, it registers the process with ProcessManager and returns
a session_id. The LLM can then use write_stdin with that session_id
to interact with the process.
2026-01-28 14:40:13 -07:00
Hannes Rudolph
d6aab9fcaf fix: display search pattern and match count in read_command_output UI
When using search mode, the UI now shows the search pattern and match count
instead of the misleading byte range (0 B - totalSize).

- Added searchPattern and matchCount fields to ClineSayTool type
- Updated ReadCommandOutputTool to return match count from search operations
- Updated ChatRow to display 'search: "pattern" • N matches' for search mode
2026-01-28 14:40:13 -07:00
Hannes Rudolph
70787f7a4a feat: align output limits with terminal integration spec
- Update preview sizes: 2KB/4KB/8KB → 5KB/10KB/20KB (default 10KB)
- Update read_command_output default limit: 32KB → 40KB
- Match spec's MODEL_TRUNCATION_BYTES (10KB) for preview
- Match spec's DEFAULT_MAX_OUTPUT_TOKENS (10000 tokens × 4 bytes = 40KB) for retrieval
- Update all related tests and documentation
2026-01-28 14:39:41 -07:00
Hannes Rudolph
5711f1f32b fix: ensure onCompleted callback finishes before using persistedResult
- Update RooTerminalCallbacks.onCompleted type to allow async callbacks (void | Promise<void>)
- Track onCompleted completion with a promise and await it before using persistedResult
- This fixes a race condition where exitDetails could be set before the async finalize() completes
- Fix test callback to not return assignment value
2026-01-28 14:39:41 -07:00
Hannes Rudolph
6bc2a14d61 fix: address review feedback for lossless terminal output
- OutputInterceptor.finalize() now awaits stream flush before returning
  This ensures artifact files are fully written before the artifact_id
  is advertised to the LLM, preventing partial reads.

- Remove strict mode from read_command_output native tool schema
  With strict: true, OpenAI requires all params in 'required', forcing
  the LLM to provide explicit null values for optional params. This
  created verbose tool calls. Now optional params can be omitted entirely.

- Update tests to handle async finalize() method
2026-01-28 14:38:53 -07:00
Hannes Rudolph
f5faf0ff93 fix: use chunked streaming for search to avoid memory blowup
Replace fs.readFile with chunked streaming in searchInArtifact() to keep
memory usage bounded for large command outputs. Instead of loading the
entire file into memory, reads in 64KB chunks and processes lines as
they are encountered.

This addresses the concern that loading 100MB+ build logs into memory
defeats the purpose of the persisted output feature.
2026-01-28 14:36:56 -07:00
Hannes Rudolph
2dcd3a187f fix: ensure lossless artifact storage and strict mode compatibility
- OutputInterceptor: Buffer ALL chunks before spilling to disk to preserve
  full content losslessly. Previously, the rolling tail buffer could drop
  middle content before the spill decision was made.

- read_command_output schema: Include all properties in 'required' array
  for OpenAI strict mode compliance. With strict: true, all properties
  must be listed in required (optional ones use null union types).
2026-01-28 14:36:56 -07:00
Hannes Rudolph
cf7472945d feat: update OutputInterceptor to use 50/50 head/tail split like Codex
- Replace single buffer with separate headBuffer and tailBuffer
- Each buffer gets 50% of the preview budget
- Head captures beginning of output, tail keeps rolling end
- Middle content is dropped when output exceeds threshold
- Preview shows: head + [omission indicator] + tail
- Add tests for head/tail split behavior

This approach ensures the LLM sees both:
- The beginning (command startup, environment info, early errors)
- The end (final results, exit codes, error summaries)
2026-01-28 14:36:56 -07:00
Hannes Rudolph
e60d6898df refactor: remove terminalOutputLineLimit and terminalOutputCharacterLimit settings
These settings were redundant with terminalOutputPreviewSize which controls
the preview shown to the LLM. The line/char limits were for UI truncation
which is now handled with hardcoded defaults (500 lines, 50K chars) since
they don't need to be user-configurable.

- Remove settings from packages/types schemas
- Remove DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT constant
- Update compressTerminalOutput() to use hardcoded limits
- Update ExecuteCommandTool to not pass limit parameters
- Update ClineProvider state handling
- Update webview context and settings
- Update tests to not use removed settings
2026-01-28 14:36:55 -07:00
Hannes Rudolph
47c3f496a0 feat(ui): add read_command_output activity indicator
Show read progress in chat when read_command_output tool is used:
- Display 'Roo read command output (0 B - 100 KB of 263.3 KB)'
- Shows the specific byte range being read each call
- Uses same visual style as read_file tool
- Add 'tool' to ClineSay types
- Add readCommandOutput to ClineSayTool with readStart/readEnd/totalBytes
2026-01-28 14:36:08 -07:00
Hannes Rudolph
cd1b9f43fd fix(parser): add read_command_output to NativeToolCallParser
chore: remove terminalCompressProgressBar setting

- Fix: Add missing read_command_output case to parser (was causing 'Invalid arguments' errors)
- Remove: Delete compress progress bar setting from all components (redundant with preview size control)
- Clean up: Remove from global-settings, OutputInterceptor, BaseTerminal, ExecuteCommandTool, SettingsView, TerminalSettings, ExtensionStateContext
- Clean up: Remove from all i18n locale files
2026-01-28 14:34:54 -07:00
Hannes Rudolph
980e616c54 fix: resolve CI failures for PR #10944
- Remove unused barrel file (src/integrations/terminal/index.ts) to fix knip check
- Fix Windows path test in OutputInterceptor.test.ts by using path.normalize()
- Add missing translations for terminal.outputPreviewSize settings to all 17 locales
2026-01-28 14:33:57 -07:00
Hannes Rudolph
525bf9f3ad fix: address PR review comments
- Read terminalOutputPreviewSize from providerState instead of hardcoded default
- Fix native tool schema to only require artifact_id (optional params no longer required)
- Fix Buffer allocation for line numbers using chunked 64KB reads to avoid memory blowup
2026-01-28 14:32:56 -07:00
Hannes Rudolph
0a70e046e7 feat: add read_command_output tool for retrieving truncated command output
Implements a new tool that allows the LLM to retrieve full command output
when execute_command produces output exceeding the preview threshold.

Key components:
- ReadCommandOutputTool: Reads persisted output with search/pagination
- OutputInterceptor: Intercepts and persists large command outputs to disk
- Terminal settings UI: Configuration for output interception behavior
- Type definitions for output interception settings

The tool supports:
- Reading full output beyond the truncated preview
- Search/filtering with regex patterns (like grep)
- Pagination through large outputs using offset/limit

Includes comprehensive tests for ReadCommandOutputTool and OutputInterceptor.
2026-01-28 14:32:55 -07:00
Hannes Rudolph
d7fa963b13
docs: clarify read_command_output search param should be omitted when not filtering (#11056) 2026-01-28 13:30:01 -07:00
Daniel
fe722dad23
feat: add AI SDK dependencies and message conversion utilities (#11047) 2026-01-28 14:05:53 -05:00
Daniel
f5004ac40a
fix: prevent time-travel bug in parallel tool calling (#11046) 2026-01-28 13:25:02 -05:00
Hannes Rudolph
e7965d9b45
feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
github-actions[bot]
c6d0306550
Changeset version bump (#11037)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-27 23:05:16 -05:00
Matt Rubens
7632807021
Release v3.45.0 (#11036) 2026-01-27 22:59:23 -05:00
Hannes Rudolph
d748de6fae
feat(condense v2.1): add smart code folding (#10942)
* feat(condense): add smart code folding with tree-sitter signatures

At context condensation time, use tree-sitter to generate folded code
signatures (function definitions, class declarations) for files read
during the conversation. Each file is included as its own <system-reminder>
block in the condensed summary, preserving structural awareness without
consuming excessive tokens.

- Add getFilesReadByRoo() method to FileContextTracker
- Create generateFoldedFileContext() using tree-sitter parsing
- Update summarizeConversation() to accept array of file sections
- Each file gets its own content block in the summary message
- Add comprehensive test coverage (12 tests)

* fix: skip tree-sitter error strings in folded file context

- Add isTreeSitterErrorString helper to detect error messages
- Skip files that return error strings instead of embedding them
- Add test for error string handling

* refactor: move generateFoldedFileContext() inside summarizeConversation()

- Update summarizeConversation() to accept filesReadByRoo, cwd, rooIgnoreController instead of pre-generated sections
- Move folded file context generation inside summarizeConversation() (lines 319-339)
- Update ContextManagementOptions type and manageContext() to pass new parameters
- Remove generateFoldedFileContext from Task.ts imports - folding now handled internally
- Update all tests to use new parameter signature
- Reduces Task.ts complexity by moving folding logic to summarization module

* fix: prioritize most recently read files in folded context

Files are now sorted by roo_read_date descending before folded context
generation, so if the character budget runs out, the most relevant
(recently read) files are included and older files are skipped.

* refactor: improve code quality in condense module

- Convert summarizeConversation to use options object instead of 11 positional params
- Extract duplicated getFilesReadByRoo error handling into helper method
- Remove unnecessary re-export of generateFoldedFileContext
- Update all test files to use new options object pattern

* fix: address roomote feedback - batch error logging and early budget exit

---------

Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
2026-01-27 18:47:24 -05:00
github-actions[bot]
7607c684e9
Changeset version bump (#11027)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-27 15:52:37 -05:00
Daniel
17d3456e96
fix: remove duplicate tool_call emission from Responses API providers (#11008) 2026-01-27 13:33:15 -05:00
Daniel
b9cf163b87
fix: use relative paths in isPathInIgnoredDirectory to fix worktree indexing (#11009) 2026-01-27 12:43:47 -05:00
Matt Rubens
dc5e765e9c
Revert "Revert "Enable parallel tool calling with new_task isolation safeguards"" (#11006) 2026-01-27 10:31:03 -05:00
github-actions[bot]
2078537201
Changeset version bump (#11005)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-27 10:28:20 -05:00
Matt Rubens
5b3626f1a6
Revert "Enable parallel tool calling with new_task isolation safeguards" (#11004) 2026-01-27 10:20:12 -05:00
Daniel
2584504b9b
Enable parallel tool calling with new_task isolation safeguards (#10979)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Hannes Rudolph <hrudolph@gmail.com>
2026-01-27 00:26:49 -05:00
Daniel
f5d32e771a
Fix LiteLLM tool ID validation errors for Bedrock proxy (#10990) 2026-01-26 23:54:48 -05:00
github-actions[bot]
3edf71e29a
Changeset version bump (#10989)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-26 23:26:46 -05:00
Matt Rubens
826e6da416
chore: add changeset for v3.44.0 (#10987) 2026-01-26 23:19:13 -05:00
Hannes Rudolph
2f92cb7a8d
fix: prevent nested condensing from including previously-condensed content (#10985) 2026-01-26 22:34:04 -05:00
Daniel
dd245cc40c
fix: VS Code LM token counting returns 0 outside requests, breaking context condensing (EXT-620) (#10983)
- Modified VsCodeLmHandler.internalCountTokens() to create temporary cancellation tokens when needed
- Token counting now works both during and outside of active requests
- Added 4 new tests to verify the fix and prevent regression
- Resolves issue where VS Code LM API users experienced context overflow errors
2026-01-26 19:43:10 -05:00
Daniel
27708f3038
feat: new_task tool creates checkpoint the same way write_to_file does (#10982) 2026-01-26 17:21:49 -07:00
Hannes Rudolph
bd29766406
fix: record truncation event when condensation fails but truncation succeeds (#10984) 2026-01-26 17:19:27 -07:00
Hannes Rudolph
7534e19c60
chore: remove POWER_STEERING experiment remnants (#10980) 2026-01-26 15:26:47 -07:00
roomote[bot]
c28478eda7
feat: add wildcard support for MCP alwaysAllow configuration (#10948)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-24 22:42:47 -05:00
Bruno Bergher
c56f0f43c7
ux: improve worktree selector and creation UX (#10940)
* Delete modal

* Restructured

* Much more prominent

* UI

* i18n

* Fixes i18n

* Remove mergeresultmodel

* i18n

* tests

* knip

* code review
2026-01-24 22:06:37 +00:00
Bruno Bergher
5848db66be
ux: Improve subtask visibility and navigation in history and chat views (#10864)
* Taskheader

* Subtask messages

* View subtask

* subtasks in history items

* i18n

* Table

* Lighter visuals

* bug

* fix: Align tests with implementation behavior

* refactor: extract CircularProgress component from TaskHeader

- Created reusable CircularProgress component for displaying percentage as a ring
- Moved inline SVG calculation from TaskHeader.tsx to dedicated component
- Added comprehensive tests for CircularProgress component (14 tests)
- Component supports customizable size, strokeWidth, and className
- Includes proper accessibility attributes (progressbar role, aria-valuenow)

* chore: update StandardTooltip default delay to 600ms

As mentioned in the PR description, increased the tooltip delay to 600ms
for less intrusive tooltips. The delay is still configurable via the
delay prop for components that need a different value.

---------

Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-24 07:21:25 -05:00
Daniel
84f7409f3c
feat: remove MCP SERVERS section from system prompt (#10895)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-24 01:16:26 -05:00
Daniel
f9a3a178db
fix: truncate AWS Bedrock toolUseId to 64 characters (#10902) 2026-01-24 00:49:33 -05:00
Daniel
3877d02498
Replace hyphen encoding with fuzzy matching for MCP tool names (#10775) 2026-01-24 00:49:13 -05:00
github-actions[bot]
83f123f270
Changeset version bump (#10934)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-23 23:57:16 -05:00
Matt Rubens
4bff2ab191
chore: add changeset for v3.43.0 (#10933) 2026-01-23 23:47:44 -05:00
Hannes Rudolph
b042866ee1
fix: auto-migrate v1 condensing prompt and handle invalid providers on import (#10931) 2026-01-23 22:32:04 -05:00
Michaelzag
4e67357ab5
fix: use json-stream-stringify for pretty-printing MCP config files (#9864)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-23 19:19:35 -08:00