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

Add Ruby Copilot chat agent with domain driven design command #2366

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

vinistock
Copy link
Member

Motivation

Add a Ruby Copilot chat agent with a domain driven design command (/design for short). The idea of the command is to assist the user in designing a concept into the model and database implementation.

For example, they can ask the following: I'm working on a school web application. How can I model courses? And how do they relate to students?. The chat will then reply with a suggested schema and buttons to run the Rails generate command for the proposed solution. Users can continue chatting back and forth until they arrive at the desired state.

Implementation

The first commit only bumps the VS Code engine and @types package to v1.90, which is the first to include the chat related types we need.

The second commit includes the chat agent implementation. I will add comments in the PR explaining each part.

Manual Tests

copilot_chat_ddd.mov

@vinistock vinistock added enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes labels Jul 25, 2024
@vinistock vinistock self-assigned this Jul 25, 2024
@vinistock vinistock requested a review from a team as a code owner July 25, 2024 18:32
@vinistock vinistock requested review from andyw8 and st0012 July 25, 2024 18:32
vscode/package.json Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the vs/add_ddd_chat_agent branch from a7e15fc to 5a5261d Compare July 25, 2024 20:29
@isidorn
Copy link

isidorn commented Jul 26, 2024

Hi VS Code PM here 👋

This is super cool to see 🎉

I am curios if having a @ruby participant is too broad. Imagine the following: I am a new user, and I am interacting with Copilot Chat. I want to learn about Ruby and I ask “How do I create a new Rails application”. This question can get well answered by GH Copilot, but how does the user know if they should use @ruby.
Or - we will have intent detection, and we might decide to forward some user queries to your participant. How do we make sure that we do not "over-send” some questions which you participant does not want to handle.

For example, none of our 1st party language teams are not contributing their participants @python, @java...

So, I would think more about the scenarios, and I like the current /design one. To make sure that the participant is an expert in a specific area where the default GH Copilot sucks.

Just my thinking, curious to hear other thoughts.

@vinistock
Copy link
Member Author

@isidorn this is a really good point and to be honest, I'm not sure where the right balance lies exactly.

The guidelines mention this:

To have a great user experience, we discourage extensions from contributing multiple chat participants

So my rationale was that we would create a @ruby participant with several commands that are related to the Ruby language. To "put it all in one place" if you will.

This PR introduces the Rails domain driven design command, but we could also add things like

  • @ruby /ask_rails a command to ask Rails specific questions that pulls in the context from the Rails guides
  • @ruby /ask_sorbet a command to ask Sorbet (Ruby's gradual type checker) specific questions pulling context from the docs
  • @ruby /ask_workspace a command that would pull all indexed declarations from the language server and then answer questions about the codebase
  • @ruby /create_gem a command that would take a bunch of specifications from the user and then expose a button for the user to generate the gem (a package in the Ruby world). This would involve first invoking Ruby's dependency manager (Bundler) to create the basic skeleton and then applying the user desired changes to the specific files

However, for chat interactions that are less specific or that do not require any information about the user's codebase, the regular chat is indeed more than enough to satisfy the user's needs.

How are the Python and Java teams organizing their chat participants? Do you have suggestions on how to organize ours with these possible use cases?

@isidorn
Copy link

isidorn commented Jul 26, 2024

Thanks for sharing the thinking process. I love some of the ideas you are outlining.

How are the Python and Java teams organizing their chat participants? Do you have suggestions on how to organize ours with these possible use cases?

They do not contribute a chat participant. They are all experimenting with different approaches. I want to brainstorm more with the team next week on the recommended approach for language extensions on extending GH Copilot. But it might be something like:

  • Improve the Inline Completions experience (similar to what C++ did in this blog). For this we need to have nicer pluggable story for GH Copilot inline completions.
  • (still in discussion) Contribute #ruby variable, that we would automatically append to user queries based on the current file / intent detection. Then you would resolve that variable. This would cover your ask_rails, ask_sorbet, ask_workspace scenarios. Basically you could dynamically resolve it based on the question and provide proper context.
  • Help us improve the core Copilot experience for your specific language. Example (we need a cross platform docker-based Ruby diagnostics provider, and tree-sitter queries for ruby that we need for summarisastion of files). The downside here is that Copilot extension is closed source, so I do not know if you want to contribute.
  • Only contribute a participant if there is still some functionality that is not improved by the above

Having said this, things are still in the air, and from our side you can go ahead with your current approach to learn and get user feedback.

fyi @roblourens @aeschli

@vinistock
Copy link
Member Author

Awesome! Thank you for context. The idea was always to start with this as an experimental feature anyway, so we'd be happy to change the implementation based on your guidelines.

@vinistock vinistock force-pushed the vs/add_ddd_chat_agent branch 2 times, most recently from e21090d to a55f4a5 Compare August 8, 2024 14:39
Copy link
Contributor

@dirceu dirceu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this forward! This is a worthwhile experiment to run 👍

vscode/README.md Outdated Show resolved Hide resolved
vscode/README.md Show resolved Hide resolved
vscode/README.md Show resolved Hide resolved
@vinistock vinistock force-pushed the vs/add_ddd_chat_agent branch from a55f4a5 to e8b5522 Compare August 13, 2024 15:52
@vinistock vinistock enabled auto-merge (squash) August 13, 2024 15:56
@vinistock vinistock merged commit 884ebf8 into main Aug 13, 2024
35 checks passed
@vinistock vinistock deleted the vs/add_ddd_chat_agent branch August 13, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants