Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API key passthrough missing for custom OpenAI-compatible models #14288

Closed
dannaf opened this issue Oct 10, 2024 · 4 comments · Fixed by #14299
Closed

API key passthrough missing for custom OpenAI-compatible models #14288

dannaf opened this issue Oct 10, 2024 · 4 comments · Fixed by #14299
Milestone

Comments

@dannaf
Copy link

dannaf commented Oct 10, 2024

Bug Description:

Theia 1.54.0 claims to support custom OpenAI-compatible models including "in the cloud" but it really only supports non-api-key-protected models, as it does not seem to pass through a custom-model API key environment variable from the AI features settings. So there seems to be no straightforward/non-hacky way to connect an API key requiring cloud-hosted OpenAI-compatible AI model (e.g. Perplexity Pro API).

And there is not even a straightforwardly-hacky way of doing it, without customizing theia code (e.g. by utilizing the official OpenAI API environment variable for non-official/OpenAI-compatible APIs), as the current implementation outright drops the api key for a hardcoded 'no-key' string when calling a custom model; here:

return new OpenAI({ apiKey: this.url ? 'no-key' : apiKey, baseURL: this.url });

Steps to Reproduce:

  1. Enable AI features in 1.54.0
  2. Configure a custom OpenAI-compatible model in the settings.json — try to add an API key for this custom model in "ai-features.openAiCustom.customOpenAiModels" but...
  3. Observe that the custom model will not work if it requires an API key

Additional Information

  • Operating System:
  • Theia Version: 1.54
@JonasHelming
Copy link
Contributor

@sdirix

@sdirix
Copy link
Member

sdirix commented Oct 11, 2024

The intention was to avoid accidental key leakage of Open AI keys to non-Open AI parties.

Suggestion:

  • We allow the user to specify an own key for each custom model
  • If there is no custom key, but the OPENAI_API_KEY environment variable is set, we will use it instead of stripping it on purpose because this is the default behavior of the official OpenAI API

@dannaf Does this work for you?

Workaround for adopters:

  • If you're working on a Theia-based application, you can override the current behavior by rebinding the OpenAiLanguageModelsManager with an own subclass. In it you register your own subclass of OpenAiModel in which you overwrite the initializeOpenAi function.

@dannaf
Copy link
Author

dannaf commented Oct 11, 2024

The first point sounds great, I think it's exactly what should be done: that for each custom model there could be set by the user an (optional) apiKey environment/settings variable. (It would be optional for situations where it is not needed, like a model running locally or whatever you had in mind at the initial implementation.)

Avoiding accidental leakage of the OpenAI api key to non-OpenAI models is also correct. I don't think it's an issue at all to require the user of a custom model that requires an api key to explicitly indicate it via an environment/settings variable. There is no need to allow the official OpenAI to be used for custom models when there is an intentionally implemented custom api key specification method via an env/settings variable; I had only suggested that as a temporary workaround, which also was not available, just to further motivate implementing a solution. I don't think it needs to be a feature of an intentional implementation, but if you think it could be a convenience (I am not sure it would be, as the api key for the custom model isbpresumably different) then maybe there should be something like an allowOpenAiKeyForCustomModelUse variable that the user would need to 'opt in' to as part of the official OpenAi settings, and that would enable the user to conviently/quickly set another useOfficialOpenAiKey=true variable in the custom model's settings. This way it would be secure against custom leakage, but if a custom model actually uses the official OpenAI api key it could quickly and easily be set via the iseOfficialOpenAiKey variable instead of having to retype it (assuming the user has set the allowOpenAiKeyForCustomModelUse setting to true). This may also improve the security of such a situation as it helps the user to avoid quickly pasting in plaintext the repeated official OpenAi key into the settings.json of the custom model, which could defeat the security of having loaded the official key in an environment variable if that was done. This way the environment variable would need to be set once and could be easily used multiple times via the settings.

What exactly do you mean is the default OpenAI behavior that you mentioned? Can you link docs to this?

@sdirix
Copy link
Member

sdirix commented Oct 11, 2024

The OPENAI_API_KEY environment variable is a concept of the official client library, see here. So when someone uses the official client library and does not set a key, then automatically the environment variable is used.

I like the idea of an additional useOpenAiKey setting for custom models to make this fallback explicitly available for users.

sdirix added a commit to eclipsesource/theia that referenced this issue Oct 11, 2024
The configuration for custom OpenAI models now allows specifying a
unique 'apiKey' for each model, or reusing the global OpenAI API key.

fixes eclipse-theia#14288
@sdirix sdirix closed this as completed in fc1b88e Oct 17, 2024
dorateq added a commit to dorateq/theia that referenced this issue Oct 26, 2024
* Generate Extension Info in server application (#13590)

fixes #13481

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* fixes clear cell outputs command and improves toolbar creation (#13640)

* fixes clear cell outputs command and improves toolbar creation

Signed-off-by: Jonah Iden <[email protected]>

* fix output mime type change

Signed-off-by: Jonah Iden <[email protected]>

* fix change presentation somtimes firing on old output

Signed-off-by: Jonah Iden <[email protected]>

* removed console logs

Signed-off-by: Jonah Iden <[email protected]>

* removed additional forgotten console.log

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Reorder back-end plugin deployment to prevent early promise resolution (#13643)

Workaround for #13638

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix spawn calls for node LTS versions (#13614)

* Update DropMetada and documentPaste proposed API for 1.88 compatibility (#13632)

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Bump API version to 1.88.1 (#13646)

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Translation update for version 1.49.0 (#13654)

Co-authored-by: jfaltermeier <[email protected]>

* feat: splash screen support for Electron (#13505)

Enhances the ElectronMainApplication to optionally render a splash
screen until the frontend is ready.

The splash screen can be configured via the application config object
"theia.frontend.config.electron.splashScreenOptions". Mandatory is the
option "content" which specifies a relative path from the application
root to the content of the splash screen. Optionally "width", "height",
"minDuration" and "maxDuration" can be handed over too.

Configures the Electron example application to show a Theia logo splash
screen.

Implements #13410

Contributed on behalf of Pragmatiqu IT GmbH

* Fix unix terminals for bundled apps (#13658)

* core: update re-exports for 1.49.0

* v1.49.0

* docs: updated changelog for 1.49.0

Contributed on behalf of STMicroelectronics

* Fix incorrect URI conversions in `custom-editors-main.ts` (#13653)

* select next node when on first or last line of editor (#13656)

Signed-off-by: Jonah Iden <[email protected]>

* Add dummy command to fix github authentication built-int flows (#13611)

Also includes code to consider sessions which are not created, but
restored from storage at registration time

Fixes #13599
Partial fix for #12821

Contributed on behalof of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Use transitive binding for TerminalFrontendContribution (#13667)

Allows downstream to customize the frontend lifecycle behavior of the TerminalFrontendContribution class.

Signed-off-by: Leo Zhu <[email protected]>

* Added additional css to notebook output webviews (#13666)

* Added additional css to notebook ooutput webviews

Signed-off-by: Jonah Iden <[email protected]>

* renamed symbol to be more descriptive

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Fixed storing of the notebook-outlineview state data (#13648)

* fixed storing of the notebook-outlineview state data

Signed-off-by: Jonah Iden <[email protected]>

* fixed is function and URI handling

Signed-off-by: Jonah Iden <[email protected]>

* improved is method for NotebookCellOutlineNode

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Align to vscode notebook commands (#13645)

* aligned commands to vscodes commands
this makes more keybindings available.
Also implements to notbookOutputInputFocused context key

Signed-off-by: Jonah Iden <[email protected]>

* fixed type and forgotten dispose of emitter

Signed-off-by: Jonah Iden <[email protected]>

* fixed lint

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Use responsive design for the main notebook toolbar (#13663)

* main toolbar adjusting to maximum size by putting items in to a context menu

Signed-off-by: Jonah Iden <[email protected]>

* fixed memory leak

Signed-off-by: Jonah Iden <[email protected]>

* fixed issues with max and min hidden items

Signed-off-by: Jonah Iden <[email protected]>

* fixed lint

Signed-off-by: Jonah Iden <[email protected]>

* fixed when incresing width of notebook

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Improve notebook cell model lifecycle (#13675)

* Handle `isFileSystemResource` context key (#13664)

* Update built-ins to 1.88.1 level (#13673)

Contributed on behalf of ST Microelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix "Open With..." command visibility (#13678)

* chore: refer to commit sha of actions instead of tags (#13625)

Instead of using tags to refer to a version of an action
(e.g. `actions/checkout@v3`), we now use its commit sha.

The problem with tags is that they are mutable and can be
changed to point to a different commit. This opens a vector
for supply chain attacks.

For one action, the user account had been renamed from
'nick-invision' to 'nick-fields' which caused a redirect
when resolving the action with the old username.
This is potentially dangerous when the account name gets
claimed again, so we now use the new user name
to refer to the action.

Increases the version of the create-pull-request action
from v4 to v6 to have matching versions of the action across
workflows.

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <[email protected]>

* Stub `registerMappedEditProvider` (#13681)

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* chore: update electron to ^28.2.8 (#13580)

Updates the Electron dependency to ^28.2.8 which is also used in VS
Code.

Additional changes:
 - update electron-mocha to ^12.3.0 to fix the Electron smoke test
 - adds a workaround for a type clash in rebuild.ts

* Improve support for creating new notebooks (#13696)

* Added basics for notebook cell drag image renderers (#13698)

* added basics for drag image renderers and improved basic drag image slightly

Signed-off-by: Jonah Iden <[email protected]>

* fix lint

Signed-off-by: Jonah Iden <[email protected]>

* reiew chages

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Remove git Theia extension from examples (#13274)

* Fail tests if selected repo is undefined
* Fix handling selected repository
* Wait more robustly for dismissal of widgets via escape.

Signed-off-by: Jonas Helming <[email protected]>
Co-authored-by: Thomas Mäder <[email protected]>

* Stop execution when deleting cell (#13701)

* Stop execution when deleting cell

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Perform yarn upgrade (#13423)

The commit performs a `yarn upgrade` of the framework to better
represent what downstream applications pull with our version ranges, and
to resolve known security vulnerabilities which were pulled by our
lockfile. The changes also make sure that our declared ranges for
dependencies are correct and fixes any compilation errors.

Contributed on behalf of STMicroelectronics

* Make browserWindow of splashScreen transparent (#13699)

Currently an image with a transparent background is rendered with a white background.
This looks weird and is not the expected behavior when a transparent image is used.
With this change the browserWindow is set to transparent, so that the background is not rendered.
If adoptors want a white background they can simply use an image with a white background (or any other color).

* Don't reveal the focused element when updating the tree rows (#13703)

Fixes #13461

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* TreeWidget: Ensure globalSelection is correctly set when opening context menu (#13710)

* TreeWidget: Ensure globalSelection is correctly set when opening context menu

Signed-off-by: Jonah Iden <[email protected]>

* nicer solution than only checking when opening context menu

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* removed forgotten artifact

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Support plugin copying for remote feature (#13369)

* fix: do not override user-defined THEIA_CONFIG_DIR (#13708)

Fixes #13700

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <[email protected]>

* doc: improve WebSocketConnectionProvider deprecation message (#13713)

The current deprecation message leads to confusion as the referenced class is not exported and not usable as an injection symbol.
The message is improved and the new ServiceConnectionProvider is exported.

Contributed on behalf of STMicroelectronics

* notebook: Select the Last Cell when deleting selected last cell (#13715)

* notebook: Select the Last Cell when deleting selected cell with index larger than avaialable cells

Signed-off-by: Jonah Iden <[email protected]>

* better length check

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Refactor auto save mechanism (#13683)

* Upgrade the Theia build to use Typescript 5.4.5 (#13628)

Most changes are just typing to accomodate stricter checks in 5.4.5.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix README documentation link (#13726)

* Update msgpckr to 1.10.2 (#13722)

Fixes #13532

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix ESLint on Windows (#13731)

* Delegate showing help to the back end process. (#13729)

Fixes #13727

The approach is to add non-functional cli contributions for any
arguments that concern only the electron-main process.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Add WindowState active in plugin API (#13718)

fixes #13692

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* [vscode] Update DropMetadata and DocumentPaste to 1.89 version (#13733)

Update DropMetadata and DocumentPaste to 1.89 version

fixes #13694

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* chore: add cross-env dependency to examples/playwright (#13634)

This allows running the Playwright tests in Windows.

Contributed on behalf of STMicroelectronics

Signed-off-by: Olaf Lessenich <[email protected]>

* Fixed focus loss of the notebook editor widget when a cell editor was unfocused (#13741)

Signed-off-by: Jonah Iden <[email protected]>

* Dev container improvements (#13714)

* basics for preferences, remoteUser and Post Create Command

Signed-off-by: Jonah Iden <[email protected]>

* setting preferences from command line when starting theia

Signed-off-by: Jonah Iden <[email protected]>

* implemented more devcontainer properties:
PostCreateCommand, RemoteUser, sttings and extensions

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* more lint

Signed-off-by: Jonah Iden <[email protected]>

* modify /etc/profile if possible to not have it overwrite the path when launching a terminal

Signed-off-by: Jonah Iden <[email protected]>

* fixed stopping containers on conenction dispose

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* added displaying of default forwarded ports by the container

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* more lint because my local eslint is not working

Signed-off-by: Jonah Iden <[email protected]>

* dynamic forwarded ports from devcontainer.json

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* more lint

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Fix quick pick separators from plugins (#13740)

* Bump API version to 1.89.1 (#13738)

fixes #13693
Contributed on behalf of STMicroelectronics
Signed-off-by: Remi Schnekenburger <[email protected]>

* Notebooks: Aligned scroll into view behaviour with vscode (#13742)

* Fixed focus loss of the notebook editor widget when a cell editor was unfocused

Signed-off-by: Jonah Iden <[email protected]>

* aligned the scroll into view behaviour with vscode

Signed-off-by: Jonah Iden <[email protected]>

* inserting new cell scrolls

Signed-off-by: Jonah Iden <[email protected]>

* fixed delete still scrolling

Signed-off-by: Jonah Iden <[email protected]>

* dont scroll into cell when click into text

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Improve VSCode tab API (#13730)

Signed-off-by: Jonah Iden <[email protected]>
Co-authored-by: Mark Sujew <[email protected]>

* fix notebook cell divider size (#13745)

Signed-off-by: Jonah Iden <[email protected]>

* Fix performance issues in terminal (#13735)

Do not search for matches in the workspace when creating links in the
terminal, as this impacts performance in large workspaces. Instead,
search for a match only when the user wants to open a link. If the match
can't be found, open the quick input service and let the user select
from a list of possible matches.

Additionally, the LocalFileLinkProvider no longer matches single words,
to avoid polluting the terminal with links.

Contributed on behalf of STMicroelectronics

* Fix an API test failure on macOS (#13732)

Before this fix, Monaco API KeybindingService.resolveKeybinding test was failing
on macOS with

```
AssertionError: expected { label: '⌃⇧⌥⌘K', …(6) } to deeply equal { label: '⌃⇧⌥⌘K', …(7) }
+ expected - actual

{
 "WYSIWYG": true
 "ariaLabel": "⌃⇧⌥⌘K"
+  "chord": false
 "dispatchParts": [
   "ctrl+shift+alt+meta+K"
 ]
 "electronAccelerator": "Ctrl+Shift+Alt+Cmd+K"
```

The `chord: false` was removed from the expected object for other platforms
as part of #13217.

This fix removes it from the expected object for macOS.

* Update nls metadata for VSCode API 1.89.0 (#13743)

* Improve dev-container label

Change-Id: I1bb27d0caea9f8a72bbdc2fa5a8dc7ee13bd807b

* Translation update for version 1.50.0 (#13749)

* core: update re-exports for 1.50.0

* v1.50.0

* docs: updated changelog for 1.50.0

Contributed on behalf of STMicroelectronics

* Fix overflow behavior of sidebars (#13483)

* Fix overflow behavior of sidebars

- Ensure that last visible element also gets added to `...` overflow menu if there is not enough space
- Remove special behavior for only one overflowing element
  -  This behavior would always add a second element to the `overflow` menu if only one element is currently overflowing. This did not work for the case where only two tabs where open in the first place. In addition, it unnecessarily hide a tab in some cases even if there was enough space to render it.
- Extract logic to compute and hide hidden tabs into `hideOverflowingTabs` method
- Invoke this method from `computeOverflowingTabsData`. At this point the actual tabs bar is already
  rendered so we can use the actual position/height information to compute overflowing tabs instead
  of manually composing the available height with the hidden tabs bar in `updateTabs`
- Update `AdditionalViewsMenuWidget` to use a dedicated menu path for each side.  This ensures that
  only the hidden tabs of the corresponding sidebar are displayed when clicking the '...' button

Fixes #13482

Contributed on behalf of STMicroelectronics

* fix editors theme change and widget not attached error (#13757)

Signed-off-by: Jonah Iden <[email protected]>

* Improved Upload Command (#13775)

- if nothing is selected uploads to the workspace root
- if a folder is selected uploads to that folder
- if a file is selected uploads to the parent folder

Signed-off-by: Jonah Iden <[email protected]>

* Stop moving to next cell when suggestion widget is visible (#13774)

Signed-off-by: Jonah Iden <[email protected]>

* Improved ability to overwrite notebook services (#13776)

* improved ability to overwrite notebook services
private fields and methods to protected

Signed-off-by: Jonah Iden <[email protected]>

* more private to protected

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Added notebook output options and tag preference search (#13773)

* Added notebook output options and the ability to search for tags in settings

Signed-off-by: Jonah Iden <[email protected]>

* review changes

Signed-off-by: Jonah Iden <[email protected]>

* review fixes

Signed-off-by: Jonah Iden <[email protected]>

* improved tag search

Signed-off-by: Jonah Iden <[email protected]>

* fixed line height when set to 0

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Update jsdiff(#13787)

Fixes #13772

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix type definition of `TheiaAppFactory` (#13799)

Ensure that the `TheiaAppFactory` type does  match the constructor function of TheiaApp.
`InitialWorkspace` is required in the TheiaApp constructor butwas optional in `TheiaAppFactory`
This ensures that (sub)classes of TheiaApp can properly be used as app factory without type casting

Contributed on behalf of STMicroelectronics

* Improved notebook cell drag images (#13791)

* IMproved notebook cell drag images

Signed-off-by: Jonah Iden <[email protected]>

* review improvements

Signed-off-by: Jonah Iden <[email protected]>

* fixed small issue where the drag over indicator stayed when dropping outside of the notebook editor

Signed-off-by: Jonah Iden <[email protected]>

* remove triple backticks from code block

Signed-off-by: Jonah Iden <[email protected]>

* Fix code escaping

* Optimize algorithm

---------

Signed-off-by: Jonah Iden <[email protected]>
Co-authored-by: Mark Sujew <[email protected]>

* Fix programmatic save for custom editors (#13684)

* fix: load correct messaging module in browser-only (#13827)

The frontend generator erroneously included the Electron messaging
module instead of the browser messaging module. Consequently, the
browser-only environment attempted to establish a WebSocket connection
to the backend. This issue has now been resolved.

Fixes #13820

* set notebook editor as active when opening in foreground (#13828)

Signed-off-by: Jonah Iden <[email protected]>

* wip (#13810)

Send notification with a Promise to respect order between requests and notifications
Test run profile constructor updates observable properties that send a notification to the main test run profile, without main being told to create this profile.  This leads to a profile not found issue when activating the test extension.

fixes #13811

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Always resolve existing before showing new notification (#13668)

* Propagate "Save As" operation to plugin host (#13689)

* improved shown keybindings in context menu (#13830)

* improved shown keybindings in context menu

Signed-off-by: Jonah Iden <[email protected]>

* small performance improvement

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Serialize saveables to disk for "Save As" (#13833)

* Fix tab group API event order (#13812)

* Disable cell editor search widget (#13836)

* Fix account menu order, icon and badge (#13771)

* Return empty appRoot in web plugin host (#13762)

* Support `PluginExt#extensionKind` properly (#13763)

* Use `openWithSystemApp` to open uri on `vscode.env.openExternal`(#13676)

* Support dynamic menu contributions (#13720)

* Use `targetPlatform` when installing plugin from open-vsx (#13825)

* [vscode] Stub Chat and Language Model API (#13778)

Stub Chat and Language Model API

fixes #13756

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Fix data race in problem view tree (#13841)

* Switch single instance on per default. (#13831)

Fixes #10890

Also implements VS Code-like behavior when opening second instances

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Add an indicator for loading notebooks (#13843)

* Update doc comments on service-connection-provider.ts (#13805)

Add some documentation to make the usage of the local/remote service id's more understandable.

contributed on behalf of STMicroelectronics

* Block local navigation and open new windows externally in electron (#13782)

Fixes #13592

Allow to open https/http links externally and ask the user for all other
protocols.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Avoid changing context key view when changing selection (#13768)

fixes #13375

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Translation update for version 1.51.0

* [vscode] Stub DebugThread and DebugStackFrame (#13847)

fixes #13758

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* [vscode] Support TestRunRequest.preserveFocus (#13839)

Add a progress service for tests to support activation of views
Forward Test Run to be started event to progress service to activate view if needed

fixes #13759

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Bump API version to 1.90.2 (#13849)

fixes eclipse-theia#13770
Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Improve implementation around widget management (#13818)

Mainly, ensures that any widget promises returned by the `WidgetManager`
will only resolve when the entire widget creation process has completed
successfully, including the 'onWillCreateWidget` part.

* v1.51.0

* core: update re-exports for 1.51.0

* docs: updated changelog for 1.51.0

Contributed on behalf of STMicroelectronics

* Codicon color and URI support for TerminalOptions (#13413)

Co-authored-by: FernandoAscencio <[email protected]>
Co-authored-by: Mark Sujew <[email protected]>

* Refactor trademark section for better readability (#13866)

* Add support for 256 truecolor (#13853)

Beforehand the `terminfo[colors]` and `COLORTERM` were not set properly.
The terminal already supports 256 truecolor, but cli tools might not use it, as the env variables were not set correctly.
This is fixed with this PR, the color is not set to `256` and `COLORTERM` is set to `truecolor`.

Fixes #13523.

* Refactor preference tree layouting (#13819)

* Use relative paths for ctx.importScripts() (#13854)

Before we tried to load absolute paths e.g. `/context/`.
This is a problem, when working in deployed use cases, where Theia might be hosted under a path (e.g. try.theia-cloud.io).
Because then the loaded path will be from the root of the page and not, like wanted, from the current path.
Simply changing it to relative paths (e.g. `./context/`) solves this issue.

Fixes #13813

* Add breaking change entry for `OpenWithService` (#13893)

* fixed reload for remote feature and added option to the electron handler to add change url (#13891)

Signed-off-by: Jonah Iden <[email protected]>

* Fix FileResource not adding event listener to the disposable collection (#13880)

Signed-off-by: Vivien Jovet <[email protected]>
Co-authored-by: Vivien Jovet <[email protected]>

* Update Mac OS version to 14 in CI (#13908)

Signed-off-by: Thomas Mäder <[email protected]>

* Stub proposed APIs used by Python debugger (#13894)

* Fix plugin version comparison (#13907)

* Add logging to `download:plugins` script (#13905)

Attempted mitigation for #13902 

- do not eat exceptions and properly log errors
- reduces request rate to 3/sec.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Make sure UI loads when minimized. (#13887)

Fixes #13798

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Update dead/broken README links (#13931)

Signed-off-by: Danielle De Leo <[email protected]>

* Make Notebook preferences registration substitutable (#13926)

Implement the commonly employed pattern for preference contribution
registration to enable substitution of the Notebook preference schema.

Fixes #13913

Signed-off-by: Christian W. Damus <[email protected]>

* change cell type when selecting markdown as  a code cells language (#13933)

Signed-off-by: Jonah Iden <[email protected]>

* Fix python version doc (#13928)

Signed-off-by: Thomas Mäder <[email protected]>
Co-authored-by: Johannes Faltermeier <[email protected]>

* Introduce environment variable to override connexion settings (#13936)

fixes #13800

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
Co-authored-by: Philip Langer <[email protected]>

* tab selected should be adjacent when closing last one. (#13912)

fixes #13886

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* upgrade ws to 8.17.1 and jsdom to 24.1.0 (#13903)

fixes #13848

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Bug fix: "core.saveAll" command shall only save dirty widgets (#13942)

* Prevent tooltip if no caption is provided and add caption for settings (#13945)

* [vscode] Implement stubbed API for activeStackFrame API (#13900)

fixes #13846

contributed on behalf of STMicroelectronics

* Add border and fix indentation for editable markdown cell (#13947)

* Translation update for version 1.52.0 (#13953)

Co-authored-by: sgraband <[email protected]>

* Add DebugSessionOptions.testRun (#13939)

Fixes #13872

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* [chore] downgrade jsdom to 22.1.0 (#13944)

fixes #13943

* Bump API version to 1.91.1 (#13955)

fixes #13954
Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* docs: updated changelog for 1.52.0

* core: update re-exports for 1.52.0

* v1.52.0

* Fix flaky playwright Theia Main Menu test

We are observing cases where the `.getByRole('button', { name: 'OK' })` resolved to multiple elements (e.g. [here](https://github.com/eclipse-theia/theia/actions/runs/10025491100)).

With this change we limit the selection to the dialog shell and hopefully remove this ambiguity.

Contributed on behalf of STMicroelectronics.

Change-Id: I5ee5b3fc6a683f68da99e219b32784c3f5d4bfb7

* Support find widget in notebooks (#13982)

* Use correct cell type for selected language (#13983)

* Support for "--headless-hosted-plugin-inspect" cmd argument  (#13918)

* introduce getServerName method on backend 
* add preferences to specify node js debug ports per hosted plugin server
* adjust PluginDebugConfiguration to also accept and array of server-name to debug port entries

* Refactor undo-redo action for editors (#13963)

* Fix notebook output scrolling and text rendering (#14016)

* Notebook: Support for Alt+Enter keybinding (#14022)

Co-authored-by: Mark Sujew <[email protected]>

* Actually create notebook model on `openNotebookDocument` (#14029)

* Don't use ChannelMultiplexer in RPCProtocol (#13980)

Fixes #13960

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix 429 errors on OVSX requests (#14030)

* Add aliases for `list.focusUp` and `list.focusDown` for notebooks (#14042)

Signed-off-by: Jonah Iden <[email protected]>

* Drop support for Node 16.x (#14027)

Fixes #13956

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Add notebook selected cell status bar item and center selected cell command (#14046)

Signed-off-by: Jonah Iden <[email protected]>

* Rely on IConfigurationService change event to update model options (#13994)

Fixes #13920, #13929

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Update electron to version 30.1.2 (#14041)

Fixes #14014

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Allow opening changes for files associated with custom editors (#13916)

* Fix loading of webview resources that depend on query params

Some resource url (notably git) use the query part of the url to store
additional information. The query part of the url was incorrectly being
dropped while attempting to load these resources inside of webviews.

See also https://github.com/microsoft/vscode/commit/48387dfc3d691558404cff1ea2582e3862a40080

* Fix `Error: Unknown Webview` messages in the log

* Fix design and implementation issues surrounding `CustomEditorOpener`

This commit ensures that the promise returned by `CustomEditorOpener.open`
will only resolve to a properly initialized and opened `CustomEditorWidget`.
In particular, it ensures that the widget is opened according to the specified
`WidgetOpenerOptions`, including `widgetOptions.ref` and `mode`.

Essentially, it revises the work done in #9671 and #10580
to fix #9670 and #10583.

* Restore custom editors as part of layout

Fixes an incorrect assumption that a custom editor cannot be restored
if no `WebviewPanelSerializer` is registered for its view type. (Actually,
custom editors are created and restored using a custom editor provider.)

Also, ensures that `CustomEditorWidget.modelRef` satisfies the shape for the
`CustomEditorWidget` defined in `editor.ts` and cannot return `undefined`.
(However, `CustomEditorWidget.modelRef.object` can be `undefined`
until the custom editor is resolved.)

Fixes #10787

* Fix a race condition when file system provider is activated

When file system provider is activated, wait until it is registered.

* git: add support for custom editors

* Uses `OpenerService` instead of `EditorManager` to open editors

* Contributes a `FileSystemProvider` for git-resources

* Fixes an issue with getting blob contents

* custom editor: open a diff-uri in a side-by-side editor

`CustomEditorOpener` is now able to open a diff-uri in a side-by-side editor,
which contains the corresponding `CustomEditor`s.

Fixes #9079

* Fix preference tree for plugins (#14036)

* Stub Terminal Shell Integration VS Code API (#14058)

* Correctly revert saveable on widget close (#14062)

* Creating a new untitled notebook doesn't work (#14031)

* Download json schema catalog at build-time instead of run-time (#14065)

Fixes #11881

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Add support for reverting a composite saveable (#14079)

* Support the menu contribution point "testing/profiles/context"

fixes #14013

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
Co-authored-by: Thomas Mäder <[email protected]>

* Bump API version to 1.92.2 (#14076)

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Implement stubbed window#registerURIhandler (#13306)

fixes #13169

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Enhance notebook cell divider (#14081)

* Support collaboration feature (#13309)

* Align available locales to VS Code (#14039)

* Translation update for version 1.53.0 (#14089)

Co-authored-by: jfaltermeier <[email protected]>

* Support notebook selection VS Code API (#14087)

* Add 3 vscode command implementations (#14093)

* Produce failure on translation error (#14092)

* docs: updated changelog for 1.53.0

Contributed on behalf of STMicroelectronics

* core: update re-exports for 1.53.0

Contributed on behalf of STMicroelectronics

* v1.53.0

* Remove the timeout handler when an request is handled. (#14118)

Fixes #14117

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix FileResource sometimes sending contents change (#14043)

Add a lock to the write operation so that checking
if the file is synced must wait for the write
operation to be done.

Fixes #14021

Contributed on behalf of Toro Cloud

Signed-off-by: Vivien Jovet <[email protected]>

* Support proxy env variables for schema catalog download (#14130)

Co-authored-by: Mark Sujew <[email protected]>

* Fix selection of contributed menu action argument adapters (#14132)

Fixes #14072

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>om>

* Theia AI LLM Support [Experimental]

    Implements AI LLM support via optionally consumable Theia extensions.

    The base functionality is provided by the following extensions:
    - @theia/ai-core
    - @theia/ai-chat
    - @theia/ai-chat-ui

    'ai-core' contains the basic LLM integration and defines the core
    concepts for interacting with LLM via agents, prompts and variables.
    'ai-chat' builts on top to define a model for chat like conversations.
    'ai-chat-ui' provides the actual Chat UI.

    The AI integration was built from the ground up to be flexible,
    inspectible, customizable and configurable.

    This feature is still highly experimental. Therefore, even when the AI
    extensions are included in a Theia based application, they are turned
    off by default and need to be enabled in the preferences. The
    preferences include a convenient "Turn all AI features on/off" setting.

    Additional features and integrations are offered by the remaining
    extensions:
    - @theia/ai-history
    - @theia/ai-code-completion
    - @theia/ai-terminal
    - @theia/ai-workspace-agent
    - @theia/ai-openai

    'ai-history' offers a service to record requests and responses. The
    recordings can be inspected via the 'AI History View'.
    'ai-code-completion' offers AI based code completion via completion
    items and inline suggestions.
    'ai-terminal' offers a specialized AI for the Theia terminal which
    will suggest commands to execute.
    'ai-workspace-agent' is a specialized agent which is able to inspect
    the current workspace content for context specific questions.
    'ai-openai' integrates the LLM offerings of Open AI into Theia.

    Co-authored-by: Alexandra Muntean <[email protected]>
    Co-authored-by: Camille Letavernier <[email protected]>
    Co-authored-by: Christian W. Damus <[email protected]>
    Co-authored-by: Eugen Neufeld <[email protected]>
    Co-authored-by: Haydar Metin <[email protected]>
    Co-authored-by: Johannes Faltermeier <[email protected]>
    Co-authored-by: Jonas Helming <[email protected]>
    Co-authored-by: Lucas Koehler <[email protected]>
    Co-authored-by: Martin Fleck <[email protected]>
    Co-authored-by: Maximilian Koegel <[email protected]>
    Co-authored-by: Nina Doschek <[email protected]>
    Co-authored-by: Olaf Lessenich <[email protected]>
    Co-authored-by: Philip Langer <[email protected]>
    Co-authored-by: Remi Schnekenburger <[email protected]>
    Co-authored-by: Simon Graband <[email protected]>
    Co-authored-by: Tobias Ortmayr <[email protected]>

* feat: Ollama integration for Theia AI

Integrates Ollama language models into Theia via the new 'ai-ollama'
package. The endpoint and models can be configured via the preferences.

* ai: Improve prompt of workspace agent (#14159)

Fixes #14128

Extend the prompt of the Theia AI workspace agent to get better answers
and get the agent to base the answers on the actual workspace contents
instead of assuming general workspace and file contents.

* Add handling of multiple accounts to authentication api (#14149)

* Adds handling of multiple accounts to authentication api

Fixes #14110

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Consistent prompt ids (#14162)

fixed #14161

Signed-off-by: Jonas Helming <[email protected]>

* Adapt default LLM for Theia AI to gpt-4o (#14165)

Add gpt-4o-2024-05-13 as an option

fixed #14164

Signed-off-by: Jonas Helming <[email protected]>

* fix: integrate AI preferencex context key

The ai-core package offers a preference context key, which can be used
in scenarios like 'when' clauses for menus. This key was not integrated,
leading to the deactivation of all dependent features. This is now fixed.

* Support `workbench.editorAssociations` preference (#14139)

* Move TerminalShellIntegration stubs to main theia API (#14168)

fixes #14107

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Remove stub tag from `TerminalOptions#color` (#14171)

* Focus notebook cell container correctly (#14175)

* Consitently name agents and add tags (#14182)

* Consitently name agents and add tags

fixed #14180

Signed-off-by: Jonas Helming <[email protected]>

* Properly support `executeDocumentSymbolProvider` command (#14173)

* Fix notebook context selection (#14179)

* Expand plugin preferences on scroll correctly (#14170)

* feat: support models served via Open AI API (#14172)

* feat: support models served via Open AI API

The Open AI settings now allow to configure additional models and their
associated endpoints. This can be used to integrate any custom model
running locally or in the Cloud as long as it supports the Open AI API.

Co-authored-by: Philip Langer <[email protected]>

* fix: disabling an agent also disables its UIContribution (#14184)

- agent service had a loop so that a single instance was not created
- code completion agents now check whether they are active
- terminal agent now check whether it is active
- chat-service correctly handles no available agents now

fixes #14167

* Handle only user workspace trust settings (#14147)

* Leak fix, use same signature in disconnect (#14186)

The disconnect from the signal was not passing the this reference
as it was used in the connect, hence the disconnect failed to find
the handler.

* Makes the cell editor border grey when not focused (#14195)

* chore: polish AI code completion

- removes code completion item provider as it blocks the completion
  popup
- reworks the code completion prompt so that it can be easier
  customized
- catches abort errors in the Open AI Api which are triggered very
  often when using code completion. This avoids spamming the log with
  "non-errors".

* Refine Experimental Message for AI Features (#14187)

* Refine Experimental Message for AI Features

fixed #14185

Signed-off-by: Jonas Helming <[email protected]>

* Refine AI settings (#14202)

* Refine AI settings

fixed #14201

Signed-off-by: Jonas Helming <[email protected]>

* Aligned active text and notebook editor more towards vscode (#14190)

* active notebook editor now undefined when a text editor is selected

Signed-off-by: Jonah Iden <[email protected]>

* working vscode api active text editor for cells

Signed-off-by: Jonah Iden <[email protected]>

* fixed backend focused cell when creating new

Signed-off-by: Jonah Iden <[email protected]>

* fixed notebook and text editors side by side not being set as active correctly

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* feat: show variables and function on ai agent configuration (#14177)

* feat: show variables and function on ai agent configuration

The agent configuration now shows also the variables (global and agent specific) as well as the functions that the agents uses.
If a variable or function is used in the prompt but is not declared by
the agent then this is also marked in the view.

All agents are updated to declare the variables and functions they use.

fixes #14133

* fix missing emit on propmt template folder switch

* Add enable state of agent to preferences (#14206)

* Add enable state of agent to preferences

The selected model was already persisted in the preferences,
but the enablement state was not.
Here the settings were extended to include the enablement state.
The new setting is consumed and updated from the AgentService.

Fixes #14205

* chore: align with ai-features preferences

* feat(ai): Add toolbar actions for chat nodes (#14181)

Introduces a `ChatNodeToolbarActionContribution` which allows to add icons to the chat nodes in the Chat UI on hover. Clicking these icons will trigger a command that gets the respective chat node as argument.

Possible use cases are actions for reporting the content, giving feedback, or perform other actions within the tool based on the response.

Contributed on behalf of STMicroelectronics.

Co-authored-by: Stefan Dirix <[email protected]>

* Support evolution on proposed API extensionAny (#14199)

fixes #14115

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* Support TestMessageStackFrame API (#14154)

Support TestMessageStackFrame API

fixes #14111

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* [vscode] TreeView reveal options are now readonly (#14198)

fixes #14109

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>

* remove type duplication for kind property (#14207)

* fix ai-settings retrieval (#14221)

The languageModelRequirements can be undefined and
this needs to be correcly handled by callers.

* Update default API version to 1.93.1 (#14224)

Fixes #14116

Contributed on behalf of ST Microelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Translation update for version 1.54.0

* docs: update changelog for 1.54.0

* core: update re-exports for 1.54.0

* v1.54.0

* Fix incorrect import in `split-widget.ts` (#14232)

`Emitter` was incorrectly imported from 'vscode-languageserver-protocol'
instead of 'common'.

* fix notebook editor focusing (#14229)

* fix notebook editor focusing

Signed-off-by: Jonah Iden <[email protected]>

* added tabindex to loading editor

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* fix: render html text in Theia AI markdown renderers

Adapt rendering of all Theia AI markdown renderers to use markdown-it directly.

The MarkdownRenderer exposed by Theia automatically strips html tags while we still want
to show them as text in requests and responses. The html is not interpreted and therefore
can't be used for injections.

fixes #14208

* Fix duplicate text editor entry (#14238)

* feat(ai): Make response parsing extensible (#14196)

Turns the response parsing method into a more flexible algorithm
that can work with multiple response content matchers. Each response
content matcher has a start and end regexp to define a match, as well
as a `contentFactory` function that turns the matched content into a
`ChatResponseContent` object.

Additionally, the parsing method has a fallback content factory that
will be applied to all unmatched parts, e.g. markdown by default.

Both, the response content matchers and the fallback content factory
and the list of matchers are extensible via DI.

Contributed on behalf of STMicroelectronics.

* Improve widget specific status bar handling (#14239)

* [Theia AI] Terminal agent records its requests (#14246)

* Terminal agent records its requests

fixed #14245

Signed-off-by: Jonas Helming <[email protected]>

* feat(ai): Update OpenAI models supporting structured output

* Wrap api objects returned to clients in a proxy (#14213)

Fixes #13522

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Fix css calc expression to have space around operator (#14241)

Fixes #14204

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Update Plugin-API.md (#14254)

Fixed the "RCP" typo to "RPC"

* Replace `nsfw` with `@parcel/watcher` (#14194)

* Ensure notebook document event registration (#14242)

* fixed notebook editor staying current until another editor is selected (#14262)

Signed-off-by: Jonah Iden <[email protected]>

* Notebook webview output optimization (#14234)

* basic single backlayer webview

Signed-off-by: Jonah Iden <[email protected]>

* allow interacting with outputs

Signed-off-by: Jonah Iden <[email protected]>

* output presentation change and more smaller improvements

Signed-off-by: Jonah Iden <[email protected]>

* output height fixes

Signed-off-by: Jonah Iden <[email protected]>

* output height calculation

Signed-off-by: Jonah Iden <[email protected]>

* collapsing outputs

Signed-off-by: Jonah Iden <[email protected]>

* fixed ouptut presentation change

Signed-off-by: Jonah Iden <[email protected]>

* removed testing console logs

Signed-off-by: Jonah Iden <[email protected]>

* fixed interacting with cells regardless of position focusing it

Signed-off-by: Jonah Iden <[email protected]>

* fixed some errors when closing a notebook

Signed-off-by: Jonah Iden <[email protected]>

* improved renderer failing

Signed-off-by: Jonah Iden <[email protected]>

* fixed issue with cell height changes

Signed-off-by: Jonah Iden <[email protected]>

* fixed outputs when reopening  notebook editors

Signed-off-by: Jonah Iden <[email protected]>

* fix iframe height

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>

* Notebook: Split cell command implementation (#14212)

* Pin Ubuntu CI versions to 22.04 (#14275)

* Update rimraf to 5 (#14273)

* Update rimraf to 5

fixed #14272

Signed-off-by: Jonas Helming <[email protected]>

* Playwright API for Notebooks (#14098)

* Allow to order and clear AI History view (#14233)

* Allow to order and clear AI History view

fixed #14183

Signed-off-by: Jonas Helming <[email protected]>

* Orchestrator logs its own requests (#14255)

* Orchestrator logs its own requests

- add data field to request
- add option to turn off default logging
- extracted getJsonOfText
- add docu for getTextOfResponse

fixed #14252

Signed-off-by: Jonas Helming <[email protected]>

* Optimize showing recent workspaces (#14260)

* Notebook Cell Tag Support (#14271)

* added cell tag and status bar item support for notebooks

---------

Signed-off-by: Jonah Iden <[email protected]>

* Start menu handler ids at one, not zero (#14282)

Fixes #14279

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* blur cell on shift+enter, only update cell height when changed (#14277)

* fix cell focus on shift+enter, only update cell height when changed

Signed-off-by: Jonah Iden <[email protected]>

* feat(ai): Allow customizing the LLM request settings

With this change, we enable more easily customizing the LLM settings, such as `temperature`, for the LLM requests in a chat agent.

Contributed on behalf of STMicroelectronics

* feat(ai): Improve styling of the chat widget

* General improvements of margins and paddings
* Give code a nicer border and more space
* Replace aggressive buttons for code parts with more subtle icons
* Format tool call result more nicely

Contributed on behalf of STMicroelectronics

* Add support for proposed signature for workspace.createFileSystemWatcher (#14303)

Fixes #13957

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Upgrade puppeteer to 23.1.0. (#14261)

Fixes #14141

Newer versions have an issue with headless mode.
Also fixes test flakiness with the new version.

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Upgrade express to 4.21.0 (#14283)

Fixes #14258, #14259

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* Add preference to exclude files from AI code completion (#14315)

Adds the preference 'ai-features.codeCompletion.excludedFileExtensions'
to filter code completion requests before they are delegated to the
AICodeInlineCompletionsProvider.

fixed #14313

Signed-off-by: Jonas Helming <[email protected]>

* Set menu bar less often at startup (#14295)

Fixes #14280

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

* feat: add support for llamafile as ai model provider (#14281)

Support llm execution via llamafiles.

- The configured llamafiles are stored in the preferences
- As a user you have to provide:
  - a custom modelname
  - the file uri to the llamafile
  - the port to run the llama.cpp server on
- Llamafiles can be started and stopped via Theia commands
- The llamafile output is send to a new output channel <mymodel>-llamafile

The current implementation does not support tools/functions so that
agents like the workspace-agent don't work well with models provided
via llamafiles.

fixes #14286

* Fix: use @theia/ai-core package in import

Signed-off-by: Olaf Lessenich <[email protected]>

* fix onDidChangeActiveNotebookEditorEmitter to fire correctly when editor changed (#14321)

Signed-off-by: Jonah Iden <[email protected]>

* feat: support custom keys for custom Open AI models

The configuration for custom OpenAI models now allows specifying a
unique 'apiKey' for each model, or reusing the global OpenAI API key.

fixes #14288

* feat: add support for custom agents (#14301)

This adds support for custom agents which are basically a custom
system prompt with additional metadata (id, name and description).
This features allows to add very specific agents without coding.
All features, like variable and functions are supported.

* Notebook: Escaping code completion pop-up disables cell edit mode (#14328)

* Notebook: Escaping code completion pop-up disables cell edit mode

* Added some more tests

* Show error message when uploading fails (#14349)

* Accept a string argument in env.openExternal API (#14350)

Fixes #14335

contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>

---------

Signed-off-by: Remi Schnekenburger <[email protected]>
Signed-off-by: Jonah Iden <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Leo Zhu <[email protected]>
Signed-off-by: Olaf Lessenich <[email protected]>
Signed-off-by: Jonas Helming <[email protected]>
Signed-off-by: Vivien Jovet <[email protected]>
Signed-off-by: Danielle De Leo <[email protected]>
Signed-off-by: Christian W. Damus <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>om>
Co-authored-by: Remi Schnekenburger <[email protected]>
Co-authored-by: Jonah Iden <[email protected]>
Co-authored-by: Thomas Mäder <[email protected]>
Co-authored-by: Mark Sujew <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jfaltermeier <[email protected]>
Co-authored-by: Stefan Dirix <[email protected]>
Co-authored-by: Vladimir Piskarev <[email protected]>
Co-authored-by: Maddobun <[email protected]>
Co-authored-by: Dennis Huebner <[email protected]>
Co-authored-by: Olaf Lessenich <[email protected]>
Co-authored-by: Jonas Helming <[email protected]>
Co-authored-by: Thomas Mäder <[email protected]>
Co-authored-by: Simon Graband <[email protected]>
Co-authored-by: Eugen Neufeld <[email protected]>
Co-authored-by: Eric <[email protected]>
Co-authored-by: Alexandra Buzila <[email protected]>
Co-authored-by: Philip Langer <[email protected]>
Co-authored-by: Tobias Ortmayr <[email protected]>
Co-authored-by: FernandoAscencio <[email protected]>
Co-authored-by: rifat87 <[email protected]>
Co-authored-by: Hanksha <[email protected]>
Co-authored-by: Vivien Jovet <[email protected]>
Co-authored-by: Dani De Leo <[email protected]>
Co-authored-by: Christian W. Damus <[email protected]>
Co-authored-by: Chris Radke <[email protected]>
Co-authored-by: Haydar Metin <[email protected]>
Co-authored-by: pchuong <[email protected]>
Co-authored-by: Lucas Koehler <[email protected]>
Co-authored-by: dfriederich <[email protected]>
Co-authored-by: eyyyyyyy3 <[email protected]>
@jfaltermeier jfaltermeier added this to the 1.55.0 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants