Skip to content

Commit a71c5f4

Browse files
mini2smrubensgithub-actions[bot]joshualipman123daniel-lxs
authored
Roo to main (#388)
* Follow symlinks in rooignore checks (RooCodeInc#7405) * Sonic -> Grok Code Fast (RooCodeInc#7426) * chore: add changeset for v3.26.0 (RooCodeInc#7428) * Changeset version bump (RooCodeInc#7429) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: Add Vercel AI Gateway provider integration (RooCodeInc#7396) Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: cte <[email protected]> * feat: Enable on-disk storage for Qdrant vectors and HNSW index (RooCodeInc#7182) * fix: use anthropic protocol for token counting when using anthropic models via Vercel AI Gateway (RooCodeInc#7433) - Added condition in getApiProtocol to return 'anthropic' for vercel-ai-gateway when modelId starts with 'anthropic/' - Added tests for Vercel AI Gateway provider protocol detection This ensures proper token counting for Anthropic models accessed through Vercel AI Gateway, as Anthropic and OpenAI count tokens differently (Anthropic excludes cache tokens from input count, OpenAI includes them). * fix: remove duplicate cache display in task header (RooCodeInc#7443) * Random chat text area cleanup (RooCodeInc#7436) * Update @roo-code/cloud to enable roomote control for cloud agents (RooCodeInc#7446) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Always set remoteControlEnabled to true for cloud agents (RooCodeInc#7448) * chore: add changeset for v3.26.1 (RooCodeInc#7459) * feat: show model ID in API configuration dropdown (RooCodeInc#7423) * feat: update tooltip component to match native VSCode tooltip shadow styling (RooCodeInc#7457) Co-authored-by: Roo Code <[email protected]> Co-authored-by: cte <[email protected]> * Add support for Vercel embeddings (RooCodeInc#7445) Co-authored-by: daniel-lxs <[email protected]> * Remove dot before model display (RooCodeInc#7461) * Update contributors list (RooCodeInc#7109) Co-authored-by: mrubens <[email protected]> * Update 3.26.1 changeset (RooCodeInc#7463) * Changeset version bump (RooCodeInc#7460) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Add type for RooCodeEventName.TaskSpawned (RooCodeInc#7465) * fix: hide .rooignore'd files from environment details by default (RooCodeInc#7369) * fix: change default showRooIgnoredFiles to false to hide ignored files - Changed default value from true to false across all files - Updated tests to reflect the new default behavior - This prevents ignored files from appearing in environment details Fixes RooCodeInc#7368 * fix: update tests to match new showRooIgnoredFiles default * fix: update test expectation to match new showRooIgnoredFiles default value The PR changed the default value of showRooIgnoredFiles from true to false, so the test needs to expect false instead of true when calling formatFilesList. --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * fix: exclude browser scroll actions from repetition detection (RooCodeInc#7471) - 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: RooCodeInc#7470 Co-authored-by: Roo Code <[email protected]> * Fix GPT-5 Responses API issues with condensing and image support (RooCodeInc#7067) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> * Bump cloud to 0.25.0 (RooCodeInc#7475) * feat: add image generation tool with OpenRouter integration (RooCodeInc#7474) Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: cte <[email protected]> * Make the default image filename more generic (RooCodeInc#7479) * Release v3.26.2 (RooCodeInc#7490) * Support free imagegen (RooCodeInc#7493) * feat: update OpenRouter API to support input/output modalities and filter image generation models (RooCodeInc#7492) * Add padding to image model picker (RooCodeInc#7494) * fix: prevent dirty state on initial mount in ImageGenerationSettings (RooCodeInc#7495) * Changeset version bump (RooCodeInc#7491) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Show console logging in vitests when the --no-silent flag is set (RooCodeInc#7467) 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 <[email protected]> * Move @roo-code/cloud to the Roo-Code repo (RooCodeInc#7503) * Refactor the extension bridge (RooCodeInc#7515) * Implement deferred task subscriptions (RooCodeInc#7517) * feat: add optional input image parameter to image generation tool (RooCodeInc#7525) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Daniel Riccio <[email protected]> * feat: sync extension bridge settings with cloud (RooCodeInc#7535) - 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 <[email protected]> Co-authored-by: John Richmond <[email protected]> * refactor: flatten image generation settings structure (RooCodeInc#7536) * chore: add changeset for v3.26.3 (RooCodeInc#7541) * Changeset version bump (RooCodeInc#7542) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Mode and provider profile selector (RooCodeInc#7545) * Putting the Roo in Roo-leases (RooCodeInc#7546) * Fix evals (RooCodeInc#7547) * fix: special tokens should not break task processing (RooCodeInc#7540) * docs: update PR template branding from Roo Code to Costrict * feat: optimize memory usage for image handling in webview (RooCodeInc#7556) * 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 * feat: rename Account tab to Cloud tab (RooCodeInc#7558) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * feat: add Ollama API key support for Turbo mode (RooCodeInc#7425) * 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 RooCodeInc#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 <[email protected]> Co-authored-by: Daniel Riccio <[email protected]> --------- Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Josh <[email protected]> Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: cte <[email protected]> Co-authored-by: Daniel <[email protected]> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: mrubens <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> Co-authored-by: Chris Hasson <[email protected]> Co-authored-by: Chris Hasson <[email protected]> Co-authored-by: John Richmond <[email protected]> Co-authored-by: Piotr Wilkin (ilintar) <[email protected]>
1 parent d5a40e1 commit a71c5f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+569
-142
lines changed

packages/build/src/__tests__/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe("generatePackageJson", () => {
6868
when: "activeWebviewPanelId == zgsm.TabPanelProvider",
6969
},
7070
{
71-
command: "zgsm.accountButtonClicked",
71+
command: "zgsm.cloudButtonClicked",
7272
group: "navigation@6",
7373
when: "activeWebviewPanelId == zgsm.TabPanelProvider",
7474
},
@@ -181,7 +181,7 @@ describe("generatePackageJson", () => {
181181
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
182182
},
183183
{
184-
command: "roo-code-nightly.accountButtonClicked",
184+
command: "roo-code-nightly.cloudButtonClicked",
185185
group: "navigation@6",
186186
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
187187
},

packages/types/src/global-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export const SECRET_STATE_KEYS = [
185185
"awsSecretKey",
186186
"awsSessionToken",
187187
"openAiApiKey",
188+
"ollamaApiKey",
188189
"geminiApiKey",
189190
"openAiNativeApiKey",
190191
"cerebrasApiKey",

packages/types/src/message.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export const clineSays = [
146146
"api_req_retry_delayed",
147147
"api_req_deleted",
148148
"text",
149+
"image",
149150
"reasoning",
150151
"completion_result",
151152
"user_feedback",

packages/types/src/provider-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ const openAiSchema = baseProviderSettingsSchema.extend({
202202
const ollamaSchema = baseProviderSettingsSchema.extend({
203203
ollamaModelId: z.string().optional(),
204204
ollamaBaseUrl: z.string().optional(),
205+
ollamaApiKey: z.string().optional(),
205206
})
206207

207208
const vsCodeLmSchema = baseProviderSettingsSchema.extend({

packages/types/src/vscode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const commandIds = [
4747
"historyButtonClicked",
4848
"marketplaceButtonClicked",
4949
"popoutButtonClicked",
50-
"accountButtonClicked",
50+
"cloudButtonClicked",
5151
"settingsButtonClicked",
5252

5353
"openInNewTab",

src/activate/registerCommands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ export const registerCommands = (options: RegisterCommandOptions) => {
8787

8888
const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOptions): Record<CommandId, any> => ({
8989
activationCompleted: () => {},
90-
accountButtonClicked: () => {
90+
cloudButtonClicked: () => {
9191
const visibleProvider = getVisibleProviderOrLog(outputChannel)
9292

9393
if (!visibleProvider) {
9494
return
9595
}
9696

97-
TelemetryService.instance.captureTitleButtonClicked("account")
97+
TelemetryService.instance.captureTitleButtonClicked("cloud")
9898

99-
visibleProvider.postMessageToWebview({ type: "action", action: "accountButtonClicked" })
99+
visibleProvider.postMessageToWebview({ type: "action", action: "cloudButtonClicked" })
100100
},
101101
plusButtonClicked: async () => {
102102
const visibleProvider = getVisibleProviderOrLog(outputChannel)

src/api/providers/__tests__/ollama.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ describe("OllamaHandler", () => {
9292
})
9393
expect(handlerWithoutUrl).toBeInstanceOf(OllamaHandler)
9494
})
95+
96+
it("should use API key when provided", () => {
97+
const handlerWithApiKey = new OllamaHandler({
98+
apiModelId: "llama2",
99+
ollamaModelId: "llama2",
100+
ollamaBaseUrl: "https://ollama.com",
101+
ollamaApiKey: "test-api-key",
102+
})
103+
expect(handlerWithApiKey).toBeInstanceOf(OllamaHandler)
104+
// The API key will be used in the Authorization header
105+
})
95106
})
96107

97108
describe("createMessage", () => {

src/api/providers/native-ollama.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Anthropic } from "@anthropic-ai/sdk"
2-
import { Message, Ollama } from "ollama"
2+
import { Message, Ollama, type Config as OllamaOptions } from "ollama"
33
import { ModelInfo, openAiModelInfoSaneDefaults, DEEP_SEEK_DEFAULT_TEMPERATURE } from "@roo-code/types"
44
import { ApiStream } from "../transform/stream"
55
import { BaseProvider } from "./base-provider"
@@ -140,10 +140,19 @@ export class NativeOllamaHandler extends BaseProvider implements SingleCompletio
140140
private ensureClient(): Ollama {
141141
if (!this.client) {
142142
try {
143-
this.client = new Ollama({
143+
const clientOptions: OllamaOptions = {
144144
host: this.options.ollamaBaseUrl || "http://localhost:11434",
145145
// Note: The ollama npm package handles timeouts internally
146-
})
146+
}
147+
148+
// Add API key if provided (for Ollama cloud or authenticated instances)
149+
if (this.options.ollamaApiKey) {
150+
clientOptions.headers = {
151+
Authorization: `Bearer ${this.options.ollamaApiKey}`,
152+
}
153+
}
154+
155+
this.client = new Ollama(clientOptions)
147156
} catch (error: any) {
148157
throw new Error(`Error creating Ollama client: ${error.message}`)
149158
}

src/api/providers/ollama.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,20 @@ export class OllamaHandler extends BaseProvider implements SingleCompletionHandl
2525
super()
2626
this.options = options
2727

28+
// Use the API key if provided (for Ollama cloud or authenticated instances)
29+
// Otherwise use "ollama" as a placeholder for local instances
30+
const apiKey = this.options.ollamaApiKey || "ollama"
31+
32+
const headers: Record<string, string> = {}
33+
if (this.options.ollamaApiKey) {
34+
headers["Authorization"] = `Bearer ${this.options.ollamaApiKey}`
35+
}
36+
2837
this.client = new OpenAI({
2938
baseURL: (this.options.ollamaBaseUrl || "http://localhost:11434") + "/v1",
30-
apiKey: "ollama",
39+
apiKey: apiKey,
3140
timeout: getApiRequestTimeout(),
41+
defaultHeaders: headers,
3242
})
3343
}
3444

src/core/tools/generateImageTool.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { fileExistsAtPath } from "../../utils/fs"
88
import { getReadablePath } from "../../utils/path"
99
import { isPathOutsideWorkspace } from "../../utils/pathUtils"
1010
import { EXPERIMENT_IDS, experiments } from "../../shared/experiments"
11-
import { safeWriteJson } from "../../utils/safeWriteJson"
1211
import { OpenRouterHandler } from "../../api/providers/openrouter"
1312

1413
// Hardcoded list of image generation models for now
@@ -237,12 +236,18 @@ export async function generateImageTool(
237236

238237
cline.didEditFile = true
239238

240-
// Display the generated image in the chat using a text message with the image
241-
await cline.say("text", getReadablePath(cline.cwd, finalPath), [result.imageData])
242-
243239
// Record successful tool usage
244240
cline.recordToolUsage("generate_image")
245241

242+
// Get the webview URI for the image
243+
const provider = cline.providerRef.deref()
244+
const fullImagePath = path.join(cline.cwd, finalPath)
245+
246+
// Convert to webview URI if provider is available
247+
const imageUri = provider?.convertToWebviewUri?.(fullImagePath) ?? vscode.Uri.file(fullImagePath).toString()
248+
249+
// Send the image with the webview URI
250+
await cline.say("image", JSON.stringify({ imageUri, imagePath: fullImagePath }))
246251
pushToolResult(formatResponse.toolResult(getReadablePath(cline.cwd, finalPath)))
247252

248253
return

0 commit comments

Comments
 (0)