diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 660960077..a9546e849 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -202,14 +202,31 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" + - uses: actions/cache@v4 + id: vscode-node-modules-cache with: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + - uses: actions/cache@v4 + id: core-node-modules-cache with: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + + - uses: actions/cache@v4 + id: storage-cache + with: + path: extensions/vscode/e2e/storage + key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }} + + - name: Download Dependencies if Cache Miss + if: steps.storage-cache.outputs.cache-hit != 'true' + run: | + cd extensions/vscode + npm run e2e:ci:download + - name: Set up SSH env: SSH_KEY: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }} @@ -220,6 +237,7 @@ jobs: chmod 600 ~/.ssh/id_rsa ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config + - name: Install Xvfb for Linux and run e2e tests run: | sudo apt-get install -y xvfb # Install Xvfb @@ -227,7 +245,8 @@ jobs: export DISPLAY=:99 # Export the display number to the environment cd extensions/vscode npm run package - npm run e2e:ci + npm run e2e:ci:run + - name: Upload e2e test screenshots if: failure() uses: actions/upload-artifact@v4 diff --git a/core/llm/index.ts b/core/llm/index.ts index dc55f8a78..041693363 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -476,15 +476,13 @@ export abstract class BaseLLM implements ILLM { ): AsyncGenerator { const { completionOptions, log } = this._parseCompletionOptions(options); - const madeUpFimPrompt = `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`; + const fimLog = `Prefix: ${prefix}\nSuffix: ${suffix}`; if (log) { if (this.writeLog) { - await this.writeLog( - this._compileLogMessage(madeUpFimPrompt, completionOptions), - ); + await this.writeLog(this._compileLogMessage(fimLog, completionOptions)); } if (this.llmRequestHook) { - this.llmRequestHook(completionOptions.model, madeUpFimPrompt); + this.llmRequestHook(completionOptions.model, fimLog); } } @@ -515,18 +513,14 @@ export abstract class BaseLLM implements ILLM { } } - this._logTokensGenerated( - completionOptions.model, - madeUpFimPrompt, - completion, - ); + this._logTokensGenerated(completionOptions.model, fimLog, completion); if (log && this.writeLog) { await this.writeLog(`Completion:\n${completion}\n\n`); } return { - prompt: madeUpFimPrompt, + prompt: fimLog, completion, completionOptions, }; diff --git a/docs/docs/customize/model-providers/top-level/azure.md b/docs/docs/customize/model-providers/top-level/azure.md index edd890d37..45b49f734 100644 --- a/docs/docs/customize/model-providers/top-level/azure.md +++ b/docs/docs/customize/model-providers/top-level/azure.md @@ -1,13 +1,13 @@ --- -title: Azure OpenAI +title: Azure AI Foundry slug: ../azure --- -Azure OpenAI is a cloud-based service that provides access to OpenAI's models, integrated with the security and enterprise features of the Microsoft Azure platform. To get started, create an Azure OpenAI resource in the [Azure portal](https://portal.azure.com). +Azure AI Foundry is a cloud-based service that provides access to models from OpenAI, Mistral AI, and others, integrated with the security and enterprise features of the Microsoft Azure platform. To get started, create an Azure AI Foundry resource in the [Azure portal](https://portal.azure.com). :::info -For details on model setup, see [General model configuration](#general-model-configuration). +For details on OpenAI model setup, see [Azure OpenAI Service configuration](#general-model-configuration). ::: @@ -28,13 +28,17 @@ We recommend configuring **GPT-4o** as your chat model. ## Autocomplete model -Azure OpenAI currently does not offer any autocomplete models. +We recommend configuring **Codestral** as your autocomplete model. -[Click here](../../model-types/autocomplete.md) to see a list of autocomplete models. - -:::info -**Codestral** will be available on Azure in the near future. -::: +```json title="config.json" +{ + "tabAutocompleteModel": { + "title": "Codestral", + "provider": "mistral", + "model": "codestral-latest" + } +} +``` ## Embeddings model @@ -67,11 +71,11 @@ You need to apply for access to the Azure OpenAI service. Response times are typ **[Click here to apply for access to the Azure OpenAI service](https://azure.microsoft.com/en-us/products/ai-services/openai-service)** ::: -## General model configuration +## Azure OpenAI Service configuration -Azure OpenAI requires a handful of additional parameters to be configured, such as a deployment name and API base URL. +Azure OpenAI Service requires a handful of additional parameters to be configured, such as a deployment name and API base URL. -To find this information in _Azure AI Studio_, first select the model that you would like to connect. Then visit _Endpoint_ > _Target URI_. +To find this information in _Azure AI Foundry_, first select the model that you would like to connect. Then visit _Endpoint_ > _Target URI_. For example, a Target URI of `https://just-an-example.openai.azure.com/openai/deployments/gpt-4o-july/chat/completions?api-version=2023-03-15-preview` would map to the following: diff --git a/extensions/vscode/e2e/tests/SSH.test.ts b/extensions/vscode/e2e/tests/SSH.test.ts index 261f9ab90..664776a9c 100644 --- a/extensions/vscode/e2e/tests/SSH.test.ts +++ b/extensions/vscode/e2e/tests/SSH.test.ts @@ -13,11 +13,7 @@ import { SSHSelectors } from "../selectors/SSH.selectors"; import { AutocompleteActions } from "../actions/Autocomplete.actions"; describe("SSH", function () { - this.retries(2); - - beforeEach(async function () { - this.timeout(DEFAULT_TIMEOUT.XL); - + it("Should display completions", async () => { await TestUtils.waitForSuccess(async () => { await new Workbench().executeCommand( "Remote-SSH: Connect Current Window to Host...", @@ -32,13 +28,6 @@ describe("SSH", function () { DEFAULT_TIMEOUT.XL, ); - // await TestUtils.waitForSuccess(async () => { - // await new Workbench().executeCommand("File: Open Folder..."); - // const inputBox = await InputBox.create(DEFAULT_TIMEOUT.MD); - // await inputBox.setText("/home/ec2-user/test-folder"); - // await inputBox.sendKeys(Key.ENTER); - // }); - await TestUtils.waitForSuccess(async () => { await new Workbench().executeCommand("File: Open File..."); const inputBox = await InputBox.create(DEFAULT_TIMEOUT.MD); @@ -46,9 +35,7 @@ describe("SSH", function () { await inputBox.selectQuickPick("main.py"); await inputBox.sendKeys(Key.ENTER); }, DEFAULT_TIMEOUT.XL); - }); - it("Should display completions", async () => { const editor = await TestUtils.waitForSuccess( async () => (await new EditorView().openEditor("main.py")) as TextEditor, ); @@ -57,5 +44,7 @@ describe("SSH", function () { await editor.clearText(); await AutocompleteActions.testCompletions(editor); await editor.setText(text); - }).timeout(DEFAULT_TIMEOUT.XL); + }) + .timeout(DEFAULT_TIMEOUT.XL) + .retries(2); }); diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index ba3b4e2e2..9aa7c22ae 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -633,7 +633,8 @@ "e2e:clean": "rm -rf ./e2e/_output", "e2e:all": "npm run e2e:build && npm run e2e:compile && npm run e2e:create-storage && npm run e2e:get-chromedriver && npm run e2e:get-vscode && npm run e2e:sign-vscode && npm run e2e:copy-vsix && npm run e2e:install-vsix && npm run e2e:install-extensions && CONTINUE_GLOBAL_DIR=e2e/test-continue npm run e2e:test && npm run e2e:clean", "e2e:quick": "npm run e2e:compile && CONTINUE_GLOBAL_DIR=e2e/test-continue npm run e2e:test && npm run e2e:clean", - "e2e:ci": "npm run e2e:compile && npm run e2e:create-storage && npm run e2e:get-chromedriver && npm run e2e:get-vscode && npm run e2e:copy-vsix && npm run e2e:install-vsix && npm run e2e:install-extensions && CONTINUE_GLOBAL_DIR=e2e/test-continue npm run e2e:test" + "e2e:ci:download": "npm run e2e:create-storage && npm run e2e:get-chromedriver && npm run e2e:get-vscode", + "e2e:ci:run": "npm run e2e:compile && npm run e2e:copy-vsix && npm run e2e:install-vsix && npm run e2e:install-extensions && CONTINUE_GLOBAL_DIR=e2e/test-continue npm run e2e:test" }, "devDependencies": { "@biomejs/biome": "1.6.4", diff --git a/extensions/vscode/src/util/getTheme.ts b/extensions/vscode/src/util/getTheme.ts index a4a570a19..7d7cb2407 100644 --- a/extensions/vscode/src/util/getTheme.ts +++ b/extensions/vscode/src/util/getTheme.ts @@ -2,21 +2,45 @@ import * as fs from "node:fs"; import * as path from "node:path"; import mergeJson from "core/util/merge"; -import { - convertTheme, - IVSCodeTheme, -} from "monaco-vscode-textmate-theme-converter/lib/cjs"; +import { convertTheme } from "monaco-vscode-textmate-theme-converter/lib/cjs"; import * as vscode from "vscode"; /** * Strip comments from theme */ + +function stripInLineComment(line: string): string { + let inString = false; + let pCh = ''; + + for (let i = 0; i < line.length-1; i++) { + const ch = line[i]; + const nCh = line[i + 1]; + + // If we're not in a string and we see '//' this is a comment. + if (!inString && ch === '/' && nCh === '/') { + // Stop processing this line from here. + return line.substring(0, i); + } + + // Toggle inString state if we see a double quote not escaped by a backslash. + if (ch === '"' && pCh !== '\\') { + inString = !inString; + } + + pCh = ch; + } + + return line; +} + function parseThemeString(themeString: string | undefined): any { themeString = themeString ?.split("\n") .filter((line) => { return !line.trim().startsWith("//"); }) + .map(stripInLineComment) .join("\n"); return JSON.parse(themeString ?? "{}"); } @@ -61,7 +85,6 @@ export function getTheme() { ); break; default: - console.log("unknown color theme kind", activeColorTheme); colorTheme = workbenchConfig.get("workbench.colorTheme") ?? "Default Dark Modern";