Commit graph

5236 commits

Author SHA1 Message Date
Matt Rubens
9b5ee27320
Merge pull request #1587 from dleen/cache
feat: Add prompt caching to OpenAI-compatible custom models
2025-03-12 11:35:42 -04:00
Matt Rubens
6fb61a2def
Merge pull request #1590 from ATempsch/add_deepseek_r1_to_bedrock
Add Deepseek R1 On-Demand to Bedrock
2025-03-12 11:30:32 -04:00
Matt Rubens
28e745124a PR cleanup 2025-03-12 11:23:06 -04:00
Matt Rubens
00bf91470b Add i18n 2025-03-12 11:23:06 -04:00
Matt Rubens
baa346dc46 Remove preferredLanguage and just rely on VSCode language 2025-03-12 11:23:04 -04:00
Chris Estreich
ae6903b26c
Merge pull request #1579 from RooVetGit/cte/context-proxy-fixes
ContextProxy fix - constructor should not be async
2025-03-12 08:16:30 -07:00
aheizi
505f86d75c replace eventsource with reconnecting-eventsource to optimize the code. 2025-03-12 19:25:50 +08:00
aheizi
e45f515e62 Merge branch 'main' into feature/add_sse_mcp 2025-03-12 19:09:07 +08:00
aheizi
f9cc13cb1e upgrade @modelcontextprotocol/sdk to latest version 2025-03-12 18:57:59 +08:00
Andreas Tempsch
d3d1a27460 Add Deepseek R1 On-Demand to Bedrock 2025-03-12 09:16:22 +01:00
David Leen
10c1e7df2f Add cache control key to messages in OpenAI compatible provider 2025-03-11 22:43:33 -07:00
Matt Rubens
421e1972ad Add prompt caching to OpenAI-compatible custom model info 2025-03-11 22:43:33 -07:00
Smartsheet-JB-Brown
d8df9a5e2c Cost display updating for Bedrock custom ARNs that are prompt routers 2025-03-11 21:58:07 -07:00
Chris Estreich
0fafe06e15
Merge pull request #1586 from RooVetGit/cte/fix-tests-macos
Fix terminal process unit tests on MacOS
2025-03-11 21:48:14 -07:00
Chris Estreich
13d54ad1c1
Merge pull request #1583 from cannuri/cannuri/fix-markdownblock-text-color
Fix MarkdownBlock text color for Dark High Contrast theme
2025-03-11 21:38:01 -07:00
Chris Estreich
30770ede77
Update src/integrations/terminal/__tests__/TerminalProcessExec.test.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-11 21:35:18 -07:00
cte
0d55593fa8 Remove references to base64 from comments 2025-03-11 21:33:01 -07:00
cte
7806829ef0 Fix unit tests on MacOS 2025-03-11 21:29:22 -07:00
Eric Wheeler
50b7326aa0 fix: add workspace configuration mock to TerminalProcess test
Add VSCode workspace configuration mock to TerminalProcess.test.ts to handle PowerShell detection in terminal tests, matching the fix in TerminalProcessExec.test.ts

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-11 21:08:53 -07:00
Eric Wheeler
f29a5fa9a4 test: add workspace configuration mock for terminal tests
Mock VSCode workspace configuration to handle PowerShell detection in terminal tests. This prevents TypeError when accessing getConfiguration() in TerminalProcess.run()

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-11 21:03:13 -07:00
Eric Wheeler
a25f1d949d fix: add PowerShell-specific command handling
PowerShell requires special handling for command output due to two issues:
- A sleep delay is required to prevent the ]633;D marker from losing the
  original output
- A counter is needed to work around a bug where identical commands are not executed

Changes:
- Add cmdCounter to Terminal class for unique command tracking
- Add PowerShell detection via platform and default shell profile
- Add sleep delay to ensure output is captured before command completion

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-11 20:54:15 -07:00
cannuri
49fca1074f Fix MarkdownBlock text color for Dark High Contrast theme 2025-03-12 02:32:59 +01:00
Chris Estreich
80d1fae033
Update src/shared/globalState.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-11 14:27:18 -07:00
cte
4b6def5f31 ContextProxy fix - constructor should not be async 2025-03-11 14:24:21 -07:00
Chris Estreich
b73bc39c8d
Merge pull request #1365 from KJ7LNW/roo-fix-terminal-undefined-exit-code
refactor terminal architecture to address critical issues with the current design
2025-03-11 13:59:04 -07:00
Matt Rubens
3b2d6bce64
Merge pull request #1564 from cannuri/cannuri/fix_subtask_cancel_resume_bug
fix: Preserve parent-child relationship when cancelling subtasks
2025-03-11 14:47:17 -04:00
aheizi
5e788fc5f1 remove rejectUnauthorized 2025-03-12 01:11:22 +08:00
aheizi
f534e80f78 fix ut 2025-03-12 00:46:04 +08:00
Matt Rubens
99258e4a9c
Merge pull request #1572 from RooVetGit/fix_openrouter_generation_check
Use baseURL in OpenRouter generation check
2025-03-11 12:00:37 -04:00
aheizi
29aa464ce3 Merge remote-tracking branch 'origin/main' into feature/add_sse_mcp 2025-03-11 23:06:12 +08:00
aheizi
8b76206cc1 update MCP prompt instructions 2025-03-11 22:58:57 +08:00
Matt Rubens
b5f6e37982
Merge pull request #1543 from shohei-ihaya/vertex
add gemini-2.0-pro-exp-02-05 model to vertex
2025-03-11 09:57:24 -04:00
Matt Rubens
76f91819c1 Use baseURL in OpenRouter generation check 2025-03-11 09:41:57 -04:00
dongqing
9d0b824b90 fix test error for wrong arguments after additional base url added 2025-03-11 17:37:07 +08:00
dongqing
a3a5592654 add config for gemini custom base url 2025-03-11 16:46:40 +08:00
dqroid
8b0956666c
Merge branch 'main' into support-custom-baseUrl-for-google-ai-studio-gemini 2025-03-11 16:15:52 +08:00
lightrabbit
7114cef03e feat: openai-compatible deepseek/qwq reasoning support 2025-03-11 14:13:17 +08:00
Matt Rubens
ff54c63ffa
Merge pull request #1526 from qdaxb/fix_progress_status
Fix progress status
2025-03-11 01:23:45 -04:00
axb
8917ab7591 fix duplicate ask 2025-03-11 13:08:02 +08:00
axb
621fc0e867 Revert "Merge pull request #1518 from RooVetGit/revert_tool_progress_for_now"
This reverts commit dba9116d26, reversing
changes made to 85dd1a1977.
2025-03-11 13:07:55 +08:00
cannuri
6ce8e56db5 fix: Preserve parent-child relationship when cancelling subtasks
This commit fixes an issue where subtasks weren't properly reporting back to parent tasks when cancelled and resumed. Previously, when a subtask was cancelled and a new task was started with the same message, the parent task would incorrectly resume, causing unexpected behavior.

The fix:
1. Stores parent-child relationship information before cancelling a task
2. Restores this relationship after task reinitialization
3. Ensures parent tasks only resume when explicitly instructed to do so

This approach maintains the correct task hierarchy throughout the cancellation and resumption process, preventing parent tasks from automatically resuming when unrelated tasks with similar messages are started.
2025-03-11 06:05:48 +01:00
Eric Wheeler
701b5a7d87 test: align terminal tests with shell integration safeguards
Update TerminalProcessExec tests to properly handle shell integration
event sequences:

- Set terminal.running=true before command execution
- Remove duplicate command execution that could trigger extra events
- Replace arbitrary timeout with event-based waiting for output
- Ensure proper event sequence (run -> start -> output -> end)

This aligns the tests with the safeguards added in 62ffa797 that
prevent spurious shell integration events from corrupting terminal
state.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 21:22:19 -07:00
Eric Wheeler
62ffa7973c fix: prevent spurious onDidEndTerminalShellExecution from breaking terminal output
Add explicit checks and error logging to handle problematic event sequence:

0. terminal.running=false
1. terminal.shellIntegration.executeCommand(command)
2. onDidEndTerminalShellExecution  // from unexpected 'OSC 633 D' sequence
3. onDidStartTerminalShellExecution
4. stream begins
5. onDidEndTerminalShellExecution

The first onDidEndTerminalShellExecution (from unexpected OSC 633 D) is
ignored because terminal.running is false, preventing process=undefined
from being set prematurely. After the stream begins and sets
terminal.running to true, the second onDidEndTerminalShellExecution
proceeds normally.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
e3adee4f15 fix: allow background terminals to broadcast output across tasks
Fix issue where background processes (like compilers) couldn't broadcast their
output to new tasks after the launching task was closed. Previously commit
851a4cd prevented terminals from responding to any task except the one that
started them.

The fix allows background terminals (taskId undefined) to act as broadcast
sources that can update any task through getEnvironmentDetails, while still
maintaining proper isolation for task-specific terminals. This enables common
workflows where:

1. A task launches a background compiler
2. That task is closed and a new task is started
3. The new task can still receive compiler errors when making changes

This gives us the best of both worlds:
- Task isolation: Active tasks only see their own terminal output
- Background broadcasting: Background processes can inform any task that needs
  their output

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
0b4fa0b1d6 feat: compress repeated terminal output lines
Add Terminal.compressTerminalOutput static method to apply run-length encoding
before truncating terminal output. This significantly reduces output size for
repeated lines while maintaining readability.

- Add compressTerminalOutput static method to Terminal class
- Replace all truncateOutput calls with Terminal.compressTerminalOutput
- Import required functions from extract-text

Test program demonstrating compression:
```python
def generate_repeats():
    patterns = [
        ("A\n", 10),          # 10 lines
        ("AA\n", 100),        # 100 lines
        ("AAA\n", 1000),      # 1K lines
        ("AAAA\n", 10000),    # 10K lines
        ("AAAAA\n", 100000),  # 100K lines
        ("AAAAAA\n", 1000000) # 1M lines
    ]

    for text, count in patterns:
        print(text * count, end="")
```

Sample output showing compression:
```
A
A
A
A
A
A
A
A
A
A
AA
<previous line repeated 99 additional times>
AAA
<previous line repeated 999 additional times>
AAAA
<previous line repeated 9999 additional times>
AAAAA
<previous line repeated 99999 additional times>
AAAAAA
<previous line repeated 999999 additional times>
```

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
131f9ad0d9 feat: add run-length encoding for repeated lines
Implement applyRunLengthEncoding function to compress repeated lines in text output:
- Add line repetition compression with count message
- Focus on single line repetitions
- Only compress when beneficial
- Add tests for empty input and single line repetitions

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
269ddf9a0e fix: avoid duplicate terminal output accumulation
Optimize terminal output handling to reduce memory pressure by:
- Remove continuous result accumulation during line processing
- Only store the same final output from the "completed" event that came from TerminalProcess

Also:
- Add clear error messages for undefined exit details

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
5be49e1d15 fix: apply terminal output line limits consistently
Apply terminalOutputLineLimit to command output lines as they are received,
rather than only at the end of command execution. Also apply the limit to
terminal output shown in environment details.

This ensures consistent output truncation behavior across all terminal
output paths, preventing potential memory issues from large outputs.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
c31a5e5bcd perf: optimize truncateOutput for large inputs
Use string indices to find line boundaries instead of splitting into array.
This avoids creating large arrays in memory when truncating big inputs.

- Replace split/join with indexOf/lastIndexOf for line counting
- Use slice to extract start/end sections directly from string
- Maintain same 20/80 ratio for before/after content

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00
Eric Wheeler
8b8c4fde50 fix: handle undefined exit codes in terminal output
When a terminal command completes with an undefined exit code:

- Add explicit handling for undefined exit code case
- Include clear message in output that exit code is undefined
- Notify user to help diagnose potential terminal issues

This helps identify and debug cases where the terminal process
completes but the exit code is not properly captured.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
2025-03-10 20:55:05 -07:00