* fix: add cache reporting support for OpenAI-Native provider
- Add normalizeUsage method to properly extract cache tokens from Responses API
- Support both detailed token shapes (input_tokens_details) and legacy fields
- Calculate cache read/write tokens with proper fallbacks
- Include reasoning tokens when available in output_tokens_details
- Ensure accurate cost calculation using uncached input tokens
This fixes the issue where caching information was not being reported
when using the OpenAI-Native provider with the Responses API.
* fix: improve cache token normalization and add comprehensive tests
- Add fallback to derive total input tokens from details when totals are missing
- Remove unused convertToOpenAiMessages import
- Add comment explaining cost calculation alignment with Gemini provider
- Add comprehensive test coverage for normalizeUsage method covering:
- Detailed token shapes with cached/miss tokens
- Legacy field names and SSE-only events
- Edge cases including missing totals with details-only
- Cost calculation with uncached input tokens
* fix: address PR review comments
- Remove incorrect fallback to missFromDetails for cache write tokens
- Fix cost calculation to pass total input tokens (calculateApiCostOpenAI handles subtraction)
- Improve readability by extracting cache detail checks to intermediate variables
- Remove redundant ?? undefined
- Update tests to reflect correct behavior (miss tokens are not cache writes)
- Add clarifying comments about cache miss vs cache write tokens
* feat: add Ollama API key support for Turbo mode
- Add ollamaApiKey field to ProviderSettings schema
- Add ollamaApiKey to SECRET_STATE_KEYS for secure storage
- Update Ollama and NativeOllama providers to use API key for authentication
- Add UI field for Ollama API key (shown when custom base URL is provided)
- Add test coverage for API key functionality
This enables users to use Ollama Turbo with datacenter-grade hardware by providing an API key for authenticated Ollama instances or cloud services.
* fix: use VSCodeTextField for Ollama API key field
Remove non-existent ApiKeyField import and use standard VSCodeTextField with password type, matching other provider implementations
* Add missing translation keys for Ollama API key support
- Add providers.ollama.apiKey and providers.ollama.apiKeyHelp to all 18 language files
- Support for authenticated Ollama instances and cloud services
- Relates to PR #7425
* refactor: improve type safety for Ollama client configuration
- Replace 'any' type with proper OllamaOptions (Config) type
- Import Config type from ollama package for better type checking
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* feat: optimize memory usage for image handling in webview
- Replace base64 image data with webview URIs to reduce memory footprint
- Add proper resource roots to webview for workspace file access
- Implement convertToWebviewUri method for safe file-to-URI conversion
- Update ImageViewer to handle both webview URIs and file paths separately
- Add image message type for proper image rendering in chat
- Improve error handling and display for failed image loads
- Add comprehensive tests for ImageViewer component
- Format display paths as relative for better readability
This change significantly reduces memory usage by avoiding base64 encoding
of images and instead using VSCode's webview URI system for direct file
access. Images are now loaded on-demand from disk rather than being held
in memory as base64 strings.
* fix: address PR review comments
- Use safeJsonParse instead of JSON.parse in ChatRow.tsx
- Add type definition for parsed image info
- Add more specific error types in ClineProvider.ts
- Add comprehensive JSDoc comments to ImageBlock.tsx
- Improve error handling and type safety
* fix: address MrUbens' review comments
- Remove hardcoded 'rc1' pattern in formatDisplayPath, use generic workspace detection
- Internationalize 'No image data' text using i18n system
* chore: remove useless comment
* chore(i18n): add image.noData to all locales to fix translation check
* test: update ImageViewer.spec to align with i18n key and flexible path formatting
- Use CloudService.getUserSettings() for remoteControlEnabled instead of global state
- Update CloudService.updateUserSettings when toggling remote control
- Add BridgeOrchestrator.connectOrDisconnect handling in settings update handler
- Remove dependency on contentProxy/globalSettings for remote control state
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: John Richmond <5629+jr@users.noreply.github.com>
By default, all of the tests run in silent mode with monkey-patched the console logging so no console logging will ever appear in test output.
This confuses the agent- sometimes it will add console logging to help it debug things, and it won't see the logs that it expects.
Adds src/utils/vitest-verbosity.ts to handle verbosity resolution and console logging.
Modifies src/vitest.config.ts and webview-ui/vitest.config.ts to integrate the new verbosity control.
Removes manual console suppression from src/vitest.setup.ts and webview-ui/vitest.setup.ts as it's now handled dynamically.
Co-authored-by: Chris Hasson <noreply@example.com>
- Modified ToolRepetitionDetector to skip repetition detection for browser_action scroll_down and scroll_up actions
- Added isBrowserScrollAction() helper method to identify scroll actions
- Added comprehensive tests for the new behavior
- Fixes issue where multiple scroll actions were incorrectly flagged as being stuck in a loop
Resolves: https://github.com/RooCodeInc/Roo-Code/discussions/7470
Co-authored-by: Roo Code <roomote@roocode.com>