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

[v13] Embedded Assist SSH #30811

Merged
merged 5 commits into from Aug 22, 2023
Merged

[v13] Embedded Assist SSH #30811

merged 5 commits into from Aug 22, 2023

Conversation

jakule
Copy link
Contributor

@jakule jakule commented Aug 21, 2023

Backport of SSH Embedded AI to v13 related PRs:

#30513
#30642
#30319
#30496
#29716

hugoShaka and others added 5 commits August 21, 2023 17:06
…tunistic node lookup (#29716)

* assist: extract embedding types into a dedicated module

* assist: allow the embedding tool to query nodes from proxy cache

This commit does two things:
- Introduce a new toolsConfig structure to pass all required clients to
  the tools. This can also be used to enable or disable specicifc tools,
  which helps with testing
- Pass the proxy node cache and the request access checker to the
  embedding tool so it can try to lookup nodes from cache in if the user
  has less than 10 nodes available.

* Add tests for the opportunistic proxy node lookup

* Apply suggestions from code review

* Update lib/ai/client.go
* Add Assist to the terminal UI

* Use getPlatform()

* Fix spacing beneath the message box
* Add in SSH context Assist endpoints

This change introduces web endpoints used by Assist to support in SSH context functionality in the WebUI. Now a user will be able to generate Bash command and explain output in the terminal (like application logs).

* Remove mockup web UI

* Make the linter happy

* Remove unnecessary comments and add missing documentation

This commit removes a redundant comment on the AI model selection in client.go that suggested a model change that is not needed. It also adds missing documentation in chat.go, to clarify the purpose and functionality of the Reply function.

* Revert ws.WriteControl to use real time.

Usage of the fake clock was failing the tests, and it's not really beneficial in this case.
The caret symbol (^) previously used in the Terminal utility was not universally recognized or understanding. To increase usability, it has been replaced with the Windows key symbol (⊞). This should make the tool more intuitive to use for a wider range of users.
…ting (#30513)

* Add AssistAction and AssistAccessRequest PostHog event reporting

This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.

* "Removed userName in AssistAccessRequest and AssistAction"

Both "AssistAccessRequest" and "AssistAction" messages in usageevents.proto file and their corresponding Go structures were modified to remove the "userName" field.

* Add GoDoc
@jakule jakule marked this pull request as ready for review August 22, 2023 00:45
@public-teleport-github-review-bot

@jakule - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from avatus August 22, 2023 12:44
@jakule jakule added this pull request to the merge queue Aug 22, 2023
Merged via the queue into branch/v13 with commit 23aeceb Aug 22, 2023
34 checks passed
@jakule jakule deleted the jakule/v13/assist-in-context-ssh branch August 22, 2023 14:00
@camscale camscale mentioned this pull request Aug 23, 2023
@fheinecke fheinecke mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants