-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: lossless terminal output with on-demand retrieval #10944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Re-review complete. No new issues found; all previously flagged items are resolved.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Flagged a few correctness and contract issues to address before merge.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
- 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
…utput 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.
- 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
Prevent unbounded memory growth during long-running commands by trimming the accumulated output buffer. The full output is preserved by the OutputInterceptor; this buffer is only used for UI display.
- 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
53939b6 to
e61dc7c
Compare
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
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
…imit 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
Summary
Refactors terminal command output handling to preserve full output losslessly. Instead of truncating large outputs and losing information, Roo now saves complete output to disk and provides the LLM with a preview plus the ability to retrieve the full content on demand.
Closes #10941
Problem
Users experienced several pain points with the previous terminal output handling:
npm install,cargo build, test suites, or other commands that produce significant output, important error messages at the end could get truncated awaySolution
This PR implements a "persisted output" pattern:
read_command_outputtool lets the LLM fetch the complete output or search for specific patterns when neededUser-Facing Changes
Settings
Before: Two confusing sliders
After: One simple dropdown
The new setting controls how much output Roo sees directly in the preview. Full output is always preserved and accessible.
How It Works
npm test)read_command_outputto view the full output or search for specific errorsBenefits
Technical Changes
OutputInterceptorclass: Buffers output and spills to disk when threshold exceededread_command_outputtool: Allows reading full output or searching for patternsExecuteCommandTool: Uses the new interceptor patternTesting
OutputInterceptor(buffering, spilling, cleanup)ReadCommandOutputTool(read, search, error cases)