Commit graph

1427 commits

Author SHA1 Message Date
Eric Wheeler
e24e5b24d4 refactor: move getTerminalContents to Terminal class
This commit partially addresses the issue of duplicate handler calls by
removing an unnecessary instantiation of TerminalManager in
registerTerminalActions.ts.

Move the getTerminalContents method from TerminalManager to Terminal
class as a static method and update all references to use the new
location.

Fixes: #1380

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
daf36f38ea refactor: move interpretExitCode from TerminalManager to TerminalProcess
This commit moves the interpretExitCode method from TerminalManager to
TerminalProcess class, as part of the terminal refactoring effort. The
method is responsible for translating exit codes into detailed results,
including signal information.

Changes include:
- Moved interpretExitCode method to TerminalProcess class
- Updated imports in TerminalManager and Cline to reference
  ExitCodeDetails from TerminalProcess
- Added findTerminalIdByVscodeTerminal helper method in TerminalManager
- Added comprehensive unit tests for interpretExitCode in
  TerminalProcess
- Tests cover undefined exit codes, normal exit codes (0-127), and
  signal exit codes (128+)

This change improves code organization by placing the exit code
interpretation logic closer to where it's primarily used, in the
TerminalProcess class.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
3a950bbc15 refactor: Rename TerminalInfo to Terminal and relocate to Terminal.ts
Transformed the TerminalInfo interface into a proper Terminal class and
moved it to its own file. This improves code organization and
encapsulation by centralizing terminal-related functionality.

The change establishes a clearer object model for terminal management,
setting the foundation for a more maintainable terminal architecture.
All references throughout the codebase have been updated to use the new
Terminal class while preserving existing functionality.

Tests have been updated and verified to ensure compatibility with the
new structure.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
60c14d8f5e test: add comprehensive terminal command execution testing
This commit combines three related improvements to terminal testing:

- Create a reusable function for testing terminal commands with real output
- Update tests to properly invoke terminal shell execution handlers
- Add microsecond timing to measure execution performance

Key improvements:
- Added testTerminalCommand function that takes command and expected output
- Use child_process.execSync to run real commands and feed output into mock terminal stream
- Properly trigger VSCode onDidStartTerminalShellExecution and onDidEndTerminalShellExecution events
- Add timeout mechanism to prevent hanging tests
- Measure execution time from terminal process creation to command completion
- Display both microseconds and milliseconds in test output
- Add test for base64 encoded zeros with configurable line count
- Increase buffer size for execSync to handle large outputs
- Limit output display to avoid cluttering the terminal

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
070a36baa2 Revert "Smart truncation for terminal output"
This reverts commit 7eee3e0878.

Middle-out truncation is a really great feature and it should still be
implemented, however it unnecessarily interferes with #1365 because it
hooked into the low-level chunk management that comes directly from VSCE
shell integration.

The best place to hook OutputBuilder is as follows depending on the
state of terminal interaction:

1. Foreground terminals:

Cline.ts:
	 executeCommandTool(...) {
	     process.on("line", (line) => {
		    lines.push(line)
		    ...
	    }
	 }

2. For background terminals: hook in at the point that getUnretrievedOutput is consumed for active or
   inactive terminals in Cline.ts:getEnvironmentDetails()

Please note:

The Terminal classes are very sensitive to change, partially because of
the complicated way that shell integration works with VSCE, and
partially because of the way that Cline interacts with the Terminal*
class abstractions that make VSCE shell integration easier to work with.

At the point that PR#1365 is merged, it is unlikely that any Terminal*
classes will need to be modified substantially.  Generally speaking, we
should think of this is a stable interface and minimize changes.

Reverts: #1390
2025-03-10 20:54:53 -07:00
Eric Wheeler
13c75a19d1 Revert "Disable terminal actions for now"
This reverts commit 93a394dd93 which has
been fixed by PR #1365.

Fixes: #1380
2025-03-10 20:53:39 -07:00
Eric Wheeler
75de043ded Revert "Remove terminal actions"
This reverts commit 75dcc2ffcf which has
been fixed by PR #1365.

Fixes: #1380
2025-03-10 20:53:36 -07:00
Eric Wheeler
384b469bf1 Revert "Handle outputless commands"
This reverts commit 710284cc3d which has
been superseded by PR #1365.

Fixes: #1416
2025-03-10 20:50:10 -07:00
Eric Wheeler
7e0a4dd426 Revert "Try to prevent additional cases in which terminal commands lock the task UI"
This reverts commit eee7bbe104 which has
been superseded by PR #1365.

Fixes: #1435
2025-03-10 20:50:10 -07:00
Chris Estreich
edb53bf433
Merge pull request #1546 from RooVetGit/cte/roo-code-api
Rename ClineAPI to RooCodeAPI and improve types
2025-03-10 20:45:39 -07:00
Chris Estreich
90a607f111
Merge branch 'main' into cte/roo-code-api 2025-03-10 20:29:36 -07:00
Matt Rubens
f306461276 Fix usage tracking for SiliconFlow etc 2025-03-10 22:59:08 -04:00
Matt Rubens
9eab941d5c
Merge pull request #1550 from Smartsheet-JB-Brown/jbbrown/aws_custom_arn_for_intelligent_prompt_routing
Users need the ability to use custom ARNs (Amazon Resource Names) with AWS Bedrock for intelligent prompt routing.
2025-03-10 22:21:36 -04:00
Matt Rubens
77186e8ee0 Cleanup 2025-03-10 22:15:52 -04:00
Matt Rubens
d6a9e0fbe9
Merge pull request #1552 from RooVetGit/mcp-home-dir
fix: update MCP servers directory path for platform compatibility
2025-03-10 21:47:08 -04:00
Chris Estreich
00bca30695
Merge pull request #1545 from RooVetGit/cte/action-registraion-cleanup 2025-03-10 18:45:00 -07:00
Matt Rubens
6cfc1cd4c9
Merge pull request #1528 from afshawnlotfi/chrome-remote-webtools
Chrome remote webtools
2025-03-10 21:37:20 -04:00
Hannes Rudolph
7462906b7a
Update ClineProvider.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-10 18:49:25 -06:00
cannuri
a9773b70c8 fix browser_action system prompt 2025-03-11 01:03:18 +01:00
Hannes Rudolph
abcb7c18b4
Update src/core/webview/ClineProvider.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-10 16:23:43 -06:00
Afshawn Lotfi
ce3e22ecfe Refactor Docker gateway IP retrieval to use a dedicated shell command execution function 2025-03-10 21:40:08 +00:00
Smartsheet-JB-Brown
171037a938 Add enhanced error handling and logging for AWS Bedrock custom ARNs 2025-03-10 14:25:52 -07:00
hannesrudolph
102a996875 fix: update MCP servers directory path for platform compatibility 2025-03-10 15:18:19 -06:00
Chris Estreich
0a03c88e92
Update src/exports/README.md
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-10 11:24:21 -07:00
cte
f8a592aac9 Rename ClineAPI to RooCodeAPI and improve types 2025-03-10 11:16:38 -07:00
cte
5a3c20764a Follow the established pattern for command registration 2025-03-10 11:12:11 -07:00
Matt Rubens
6644202b55
Merge pull request #1451 from dtrugman/feat/add-openai-style-cost-calculation
Add openai style cost calculation
2025-03-10 10:11:30 -04:00
Matt Rubens
03045d8e75
Update src/core/Cline.ts 2025-03-10 09:54:45 -04:00
Afshawn Lotfi
66e3b9610c Add remote browser connection support and related state management 2025-03-10 03:41:38 +00:00
Matt Rubens
732eeddc6c Add model telemetry too 2025-03-09 23:18:44 -04:00
Matt Rubens
9c08d044b3 Add telemetry for checkpoint save/restore/diff 2025-03-09 22:55:23 -04:00
Matt Rubens
85775ce0a5
Merge pull request #573 from Szpadel/fix-listing-exclude
Do not exclude whole project dir when listing in case where project i…
2025-03-09 21:59:54 -04:00
Matt Rubens
f4734dedb9
Merge pull request #721 from kohii/kotlin
feat: Add Kotlin support in list_code_definition_names
2025-03-09 21:49:54 -04:00
Matt Rubens
e5ac33a146
Merge pull request #996 from qdaxb/optimize_diagnostics
Reduce the probability of errors when the model tries to fix the problems
2025-03-09 21:38:03 -04:00
Matt Rubens
c70595b9f0
Merge pull request #1507 from hannesrudolph/optional-mode-creation
feat: Add toggle for custom mode creation
2025-03-09 18:54:49 -04:00
Matt Rubens
183e47b1bd Revert "support tool progress status"
This reverts commit 80139d88d7.
2025-03-09 18:35:56 -04:00
Matt Rubens
78be1b8977 Revert "Clean up the tool progress UX"
This reverts commit 1c8071bbb3.
2025-03-09 18:35:48 -04:00
Afshawn Lotfi
22f51304a2 Add support for remote browser connection and settings 2025-03-09 20:11:52 +00:00
Hannes Rudolph
bb87b7896b
Update src/shared/globalState.ts
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-08 22:31:20 -07:00
Hannes Rudolph
f6efa2b589
Update src/core/prompts/sections/modes.ts
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-08 22:31:10 -07:00
Roo Code
2a08c7c3db feat: Add toggle for custom mode creation
This commit adds a new setting to allow users to disable custom mode creation,
which can help reduce token usage in Roo's prompts.

Key changes:

Add enableCustomModeCreation setting to global state
Conditionally include custom modes documentation in prompt only when enabled
Add UI toggle in PromptsView with explanatory text
Default the setting to enabled (true) for backward compatibility
Update necessary interfaces and message handlers for the new setting
The setting is placed in PromptsView rather than SettingsView since it directly
relates to the modes functionality managed in that component.
2025-03-08 22:05:27 -07:00
Matt Rubens
e10757d6fa Iterate on subtasks UX 2025-03-08 23:46:28 -05:00
Matt Rubens
1c8071bbb3 Clean up the tool progress UX 2025-03-08 22:55:04 -05:00
Matt Rubens
e2bdee3366
Merge pull request #1494 from qdaxb/support_tool_progress_status
support tool progress status
2025-03-08 21:17:35 -05:00
Matt Rubens
e945dcf94f
Merge pull request #1491 from shaybc/sbc_subtasks_approve_btn
Sbc subtasks approve button
2025-03-08 21:16:44 -05:00
Matt Rubens
585d5aba5a Strip all BOMs 2025-03-08 18:44:03 -05:00
Matt Rubens
3806ea9f69
Merge pull request #1500 from RooVetGit/strip_bom_string
Strip BOM twice when applying diffs
2025-03-08 17:56:17 -05:00
Matt Rubens
4cf7754e65 Strip BOM when applying diffs 2025-03-08 17:50:49 -05:00
axb
80139d88d7 support tool progress status 2025-03-09 00:21:09 +08:00
ShayBC
27624a25a5 fixed the missing case of cmd execution at the end of a subyask and added auto aprove option for finish task (and continue to the next task) 2025-03-08 16:25:45 +02:00