Commit graph

321 commits

Author SHA1 Message Date
vagadiya
294b52ef6a
Fix to Bedrock ARN validation (#2538)
Fixes Bedrock ARN validation

Updates the Bedrock ARN regex to allow alphanumeric characters, dots, hyphens, and colons in the resource ID.

This prevents validation errors when using ARNs containing those characters.
2025-04-12 13:43:35 -04:00
KJ7LNW
9c3c93567b
Merge pull request #2427 from KJ7LNW/fix-vscode-lm-content-preservation
fix: preserve content integrity in VS Code LM provider
2025-04-11 17:10:54 -04:00
ronyblum
a031b74bf5
Modification of AWS Bedrock to Amazon Bedrock (#2473)
* Modification of AWS Bedrock to Amazon Bedrock

* Duplicated comment removal
2025-04-10 15:47:34 -04:00
amittell
1445bb0a3c
Make Grok3 streaming work with OpenAI Compatible (#2449) 2025-04-10 00:35:49 -04:00
Matt Rubens
b01615f122
Add the option to use a custom Host header for openai-compatible (#2399) 2025-04-08 22:02:27 -04:00
Matt Rubens
72a9e0bd39
Fix cache usage tracking for openai-compatible (#2401) 2025-04-08 01:20:45 -04:00
Smartsheet-JB-Brown
919bb121d0
Jbbrown/bedrock caching (#2071)
* Bedrock prompt caching

* remove whitespace only change to src/api/providers/base-provider.ts

* remove integration test that calls bedrock

* PR prep cleanup

* test file and redundant code cleanup

* updated multi-cache-point

* optimized cache strategy

* cache logic updated. commit before trying to simplify newConversationPlacements

* simplified initial cachePoint logic

* fix the missing caching params for claude 3.7 on bedrock

* undo unintentional changes to README.md files

* fix merge bug that hid use prompt cache checkbox

* prep for PR

* remove unintended changes

* revert .gitignore change

* undo unintended changes

* Issue 1998 - Unable to use ARN. https://github.com/RooVetGit/Roo-Code/issues/1998 - Simplify region extraction from Arns. Change example of ARN use from the foundational model ARN to an inference profile ARN which is what is needed.

* small updates to error message

* more flexible support for ARNs and hardening of ARN handling

* update comment on regex use for platform indipendent cosideration

* small code comment update

* remove duplicative logic to add a region to the arn when cross-region is selected

* Update README files from main branch

* improve error handling when on-demand throughput is not avialable for a foundational model

* fix prompt router bug

* minor tweaks for simplicity

* error messgae formatting

* set new version of bedrock runtime package

* fixes: 2229 - complete prompt doesn't work and appears like a no-op

* remove commented out logger.debug blocks per PR review request

* localize new prompt cache UI inputs

* single source of truth for AWS Region information

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-04-03 13:05:29 -04:00
Thomas Jeung
e9bcee5e2a
feat: Add support for Azure AI Inference Service with DeepSeek-V3 model (#2241)
* feat: Add support for Azure AI Inference Service with DeepSeek-V3 model

* refactor: extract Azure AI inference path to constant to avoid duplication

* fix(tests): update RequestyHandler tests to properly handle Azure inference and streaming

* fix(api): remove duplicate constant and update requesty tests

* refactor: remove unused isAzure property from OpenAiHandler

* refactor(openai): remove unused isAzure and extract Azure check
2025-04-03 00:29:56 -04:00
Smartsheet-JB-Brown
0409509002
fixes: 2229 - completePrompt doesn't work for bedrock. (#2230)
* fixes: 2229 - completePrompt doesn't work for bedrock.

* fix failing test
2025-04-02 15:35:14 -04:00
Steven T. Cramer
b9f4695d12
Fix Tests to run properly on Windows (#1963)
* fix: remove -p flag from test script to prevent git operation errors

The -p flag in npm-run-all was causing tests to run in parallel, which led to 'Cannot log after tests are done' errors with git operations. These errors don't appear when running test:extension alone.

The issue occurs because git-based tests create temporary directories and run async operations that can interfere with each other when executed in parallel. Running tests sequentially resolves this cleanly.

While it might increase total test time slightly, it ensures more reliable and consistent test results.

* refactor(terminal): improve mock streams and fix test issues

- Create shell-specific mock streams (bash, cmd, pwsh) with proper line ending handling
- Fix open handles in tests by properly managing timeouts
- Standardize stderr redirection across all shell implementations using stdio option
- Improve test reliability and output cleanliness

* fix(tests): add skipVerification option to PowerShell tests to debug Linux issues

* fix(tests): use explicit variable name in PowerShell test to fix Linux compatibility

* Refactor terminal tests to use purpose-based approach instead of command mapping

* Remove reference to non-existent test file

* fix: use printf instead of echo -e for more consistent behavior across platforms

* fix: use single quotes for PowerShell commands to preserve variables on Linux

* Update code-qa workflow to run tests on both Windows and Ubuntu

* fix: use platform-specific PowerShell command execution for Linux and Windows

* Fix toggleToolAlwaysAllow to handle path normalization for cross-platform compatibility

* Fix McpHub tests to handle normalized paths on Windows

* Suppress console.error messages in McpHub tests

* fix: make Bedrock ARN regex patterns Windows-compatible

Fixed an issue where AWS Bedrock tests were timing out on Windows but passing on Linux. The root cause was path separator handling in regex patterns used for model ID extraction from ARNs.

1. Updated model ID extraction regex to handle both forward slashes (Linux) and backslashes (Windows)
2. Modified ARN matching regex to be platform-independent
3. Ensured consistent region prefix handling for all supported regions

This change maintains functionality while ensuring cross-platform compatibility.

* fix: make WorkspaceTracker test cross-platform compatible

Fixed an issue where the WorkspaceTracker test 'should initialize with workspace files' was failing on Windows but passing on Linux. The problem was in the mock implementation of toRelativePath that only handled forward slashes.

- Updated the toRelativePath mock to use path.relative which properly handles platform-specific path separators
- Ensured all paths are converted to forward slashes for consistency in test assertions
- The fix maintains cross-platform compatibility while preserving the test's intent

* fix: make WorkspaceTracker tests cross-platform compatible

Fixed cross-platform compatibility issues in the WorkspaceTracker tests that were causing failures on Windows but passing on Linux:

1. Updated the toRelativePath mock implementation to:
   - Use path.relative which properly handles platform-specific path separators
   - Convert paths to forward slashes for consistency in test assertions

2. Enhanced the 'should not update file paths' test to be platform-agnostic by:
   - Using more flexible assertions that don't depend on specific path formats
   - Checking file path length and content rather than exact string matches
   - Properly typed the test assertions to fix TypeScript errors

These changes preserve the test intent while ensuring they run successfully across different operating systems.

* fix: make McpHub tests cross-platform compatible

Fixed cross-platform compatibility issues in the McpHub tests that were causing failures on Windows but passing on Linux:

1. Made the toggleToolAlwaysAllow tests more platform-agnostic by:
   - No longer relying on specific path formats which differ between Windows and Linux
   - Using the last write call instead of searching for a specific path string
   - Adding more robust assertions that verify structure instead of exact path matches
   - Properly handling array existence checks

2. These tests would fail on Windows because paths are formatted with backslashes instead of
   forward slashes, causing path equality checks to fail.

The changes maintain test intent while ensuring cross-platform compatibility.

* handle escaping of slash and quote

* fix: ensure consistent line endings in git fallback strategy

Fixed an issue where tests would fail on GitHub Windows runners but pass on local Windows machines due to line ending differences. The fix ensures consistent line ending handling by:

1. Normalizing CRLF to LF when reading files in the git fallback strategy
2. Disabling Git's automatic line ending conversion
3. Maintaining consistent line ending usage throughout text operations

* feat: run tests sequentially on Windows, parallel otherwise
2025-03-31 23:17:56 -05:00
Matt Rubens
fe3e9325a5
Include inference-profile in Bedrock arnRegex (#2156) 2025-03-31 13:52:57 -04:00
Chris Estreich
3322e08cb7
Relax provider profiles schema and log parse error to PostHog (#2139)
* Relax provider profiles schema and log parse error to PostHog

* Create wise-moose-shop.md

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-30 23:07:34 -07:00
Duong M. CUONG
af6753608f
Remove hard-coded o3-mini model when streaming is enabled, allowing custom o3-mini-<reasoning> model (#2134)
Remove hard-coded o3-mini model when streaming is enabled
2025-03-30 23:12:18 -04:00
Taiki Maekawa
2985172c61
feat: add bedrock application inference profile (#1938) 2025-03-24 10:17:47 -04:00
teddyOOXX
cc2420ea1a
fix qwq model in openai provider (#1940)
* feat: Add the openAiR1FormatEnabled field to enable this switch in OpenAI compatible mode to support the current QWQ and future additional classes of R1 models.

* feat: Add the openAiR1FormatEnabled field to enable this switch in OpenAI compatible mode to support the current QWQ and future additional classes of R1 models.

* fix: add miss i18n

* fix: add miss i18n

* fix: remove the redundant call

---------

Co-authored-by: xiong <yueminxiong.xym@alibaba-inc.com>
2025-03-24 10:14:44 -04:00
Matt Rubens
e810a886d2
Welcome page OAuth (#1913)
* Add Requesty OAuth flow

* New 1-click onboarding flow

* Requesty: Use correct default model info

* When called from the onboard flow, created the default profile

Glama OAuth handler changed for consistency.

* Add router images

* Shuffle the routers

* Translate

* Appease knip

---------

Co-authored-by: Daniel Trugman <dtrugman@gmail.com>
2025-03-23 10:08:16 -04:00
pugazhendhi-m
003388a5c4
Fix maxTokens to 8192 only for compatible Anthropic models (#1862)
Fix maxTokens to 8096 only for compatible Anthropic models

Co-authored-by: Pugazhendhi <pugazhendhi@unboundsecurity.ai>
2025-03-23 02:23:29 -04:00
Jason Owens
87b9b72b32
Corrected bug in openrouter.ts and pre-commit and pre-push husky scripts (#1853)
- Corrected error causing free models listed under openrouter to show pricing information
- Updated pre-push and pre-commit scripts to work in Windows environments when pushing to branch (windows requires npm/npx to include the ".cmd" extension to recognize and compile.
2025-03-23 02:12:53 -04:00
Matt Rubens
2597347e91
Use openrouter stream_options include_usage (#1905) 2025-03-23 01:52:43 -04:00
Matt Rubens
95ba760daf
Non-thinking sonnet has 8192 max tokens (#1860) 2025-03-21 00:24:57 -04:00
Yukky
b033082523
Reflect Cross-region inference option in ap-xx region (#1842)
* Fix: Enable cross-region inference for 'ap-xx' region in AwsBedrockHandler.completePrompt

* Fix: Enable cross-region inference for 'ap-xx' region in AwsBedrockHandler.createMessage

* Create itchy-waves-move.md

---------

Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2025-03-20 16:03:51 -04:00
pugazhendhi-m
e4c398d888
Discards temperature setting on o3-mini for Unbound (#1836)
* Discards temperature setting on o3-mini for Unbound

* Adds changeset

---------

Co-authored-by: Pugazhendhi <pugazhendhi@unboundsecurity.ai>
2025-03-20 09:11:22 -04:00
Wojciech Kordalski
499b8e4665
Fake AI provider (#1769)
* Fake AI

* Do not show Fake AI in Roo-Code settings

* Rename providers/fake-provider.ts to providers/fake-ai.ts
2025-03-19 19:07:59 -07:00
Chris Estreich
eb74f02094
Choose specific provider when using OpenRouter (#1753)
* Choose specific provider when using OpenRouter

* Add translations
2025-03-17 15:40:27 -07:00
cte
f108dfaeb8 Evals 2025-03-17 10:09:19 -07:00
Matt Rubens
4ada518e58
Merge branch 'main' into jbbrown/bedrock_cost_intelligent_prompt_routing 2025-03-13 17:17:44 -04:00
Smartsheet-JB-Brown
6c74e9ba7b PR review cleanup 2025-03-13 13:04:16 -07:00
Smartsheet-JB-Brown
8d30b6f44a Update src/api/providers/bedrock.ts
agree, sorry old Javascript habits

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-13 09:56:07 -07:00
Smartsheet-JB-Brown
f7675244bd
Update src/api/providers/bedrock.ts
yes, unneeded remnant

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-03-13 08:09:21 -07:00
Matt Rubens
774248be1e Fix more hard-coded openrouter urls 2025-03-12 14:08:17 -04:00
Matt Rubens
93611ea6b5 Merge remote-tracking branch 'origin/main' into support-custom-baseUrl-for-google-ai-studio-gemini 2025-03-12 11:55:14 -04:00
Matt Rubens
c8b3095d93
Merge pull request #1566 from lightrabbit/feature/openai-compatible-deepseek-reasoning-support
feat: openai-compatible deepseek/qwq reasoning support
2025-03-12 11:39:49 -04:00
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
David Leen
10c1e7df2f Add cache control key to messages in OpenAI compatible provider 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
cte
4b6def5f31 ContextProxy fix - constructor should not be async 2025-03-11 14:24:21 -07: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
f306461276 Fix usage tracking for SiliconFlow etc 2025-03-10 22:59:08 -04:00
Matt Rubens
77186e8ee0 Cleanup 2025-03-10 22:15:52 -04:00
Smartsheet-JB-Brown
171037a938 Add enhanced error handling and logging for AWS Bedrock custom ARNs 2025-03-10 14:25:52 -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
dongqing
85b54b33ba support custom base url for gemini in google AI studio 2025-03-10 19:06:58 +08:00
yt3trees
9246cf8f6d Add o3-mini support to openai compatible 2025-03-08 20:23:53 +09:00
Matt Rubens
2a65db61cf
Merge pull request #1444 from moqimoqidea/patch-1
fix claude 3.7 think enhance prompt problem.
2025-03-07 21:39:56 -05:00
Daniel Trugman
c51f59e50b Requesty: Correctly calculate request costs 2025-03-07 16:41:09 +00:00
Daniel Trugman
e14b1b2dab Add OpenAI-style cost calculation 2025-03-07 13:53:32 +00:00