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

Deep Cody: Allow toggle in UI & implement CodyChatMemory #6066

Merged
merged 21 commits into from
Nov 6, 2024

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Nov 5, 2024

CLOSE: https://linear.app/sourcegraph/issue/CODY-4246/remove-deep-cody-from-the-model-list
CLOSE: https://linear.app/sourcegraph/issue/CODY-4247/add-toggle-for-35-sonnet

Deep Cody is now an experimental feature that users can toggle on/off with a feature flag enabled.
This allows us to remove Deep Cody from the model drop-down list, and makes it easier to enable Deep Cody for other models in the future.

UI Change:

  • Remove Deep Cody from model list
  • Stops treating Deep Cody as model
  • Integrates Deep Cody toggle functionality into the chat UI
  • Updates the ContextCell and HumanMessageEditor components to display and handle the Deep Cody toggle
  • Adds new API methods to the WebviewToExtensionAPI interface to enable/disable Deep Cody
  • Updates the ChatController to handle the Deep Cody feature flag and toggle
  • Removes the automatic selection of Deep Cody as the default model
  • Adds unit tests for the Deep Cody feature

Deep Cody Agent class refactor:

  • Introduce CodyChatAgent as the base class for managing chat agents
  • Implement CodyChatMemory to store and retrieve temporary chat context
  • Refactor CodyToolProvider to use a registry-based approach for managing tools
  • Add new tool - MemoryTool - a tool that allows Cody to build memory when asekd
  • Improve handling of OpenContext-based tools

Add agent field to chat messages

This allows for more flexibility in enabling different chat agents.

  • Added agent field to ChatMessage and SerializedChatMessage interfaces
  • Updated ChatController and webview components to use the agent field
  • Enabled Deep Cody context when the agent is set to 'deep-cody'
  • Updated tests and other related code to reflect the new agent field

Test plan

Start branch locally and confirmed everything works as expected

image

Memory Tool

image

image

Changelog

- Introduce `CodyChatAgent` as the base class for managing chat agents
- Implement `CodyChatMemory` to store and retrieve temporary chat context
- Refactor `CodyToolProvider` to use a registry-based approach for managing tools
- Add new tools like `MemoryTool` and `EditorTool`
- Improve handling of OpenContext-based tools
Copy link

github-actions bot commented Nov 5, 2024

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

@abeatrix abeatrix marked this pull request as ready for review November 5, 2024 05:20
Add an `agent` field in chat messages. This allows for more flexibility in enabling different chat agents.

The key changes are:

- Added `agent` field to `ChatMessage` and `SerializedChatMessage` interfaces
- Updated `ChatController` and webview components to use the `agent` field
- Enabled Deep Cody context when the `agent` is set to `'deep-cody'`
- Updated tests and other related code to reflect the new `agent` field
Copy link
Member

@valerybugakov valerybugakov left a comment

Choose a reason for hiding this comment

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

Tested locally, approving with some feedback inline. It works!

Screenshot 2024-11-05 at 17 28 05

vscode/webviews/chat/Transcript.tsx Outdated Show resolved Hide resolved
vscode/src/chat/agentic/DeepCody.ts Show resolved Hide resolved
vscode/src/chat/agentic/CodyChatMemory.ts Show resolved Hide resolved
Co-authored-by: Valery Bugakov <[email protected]>
Copy link
Member

@valerybugakov valerybugakov left a comment

Choose a reason for hiding this comment

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

To align with our recent efforts to enhance release stability and enforce stricter PR reviews, I recommend breaking PRs into smaller, focused changes where possible. This approach has several benefits: if an issue arises, we can roll back only the specific change rather than the entire function, and focused changes make the review process much easier.

Since this is an experimental feature and it's already reviewed, splitting it isn't required, but let's keep this in mind for future submissions. We can aim to keep non-generated changes in PRs to a minimum necessary for the PR's primary goal.

@abeatrix
Copy link
Contributor Author

abeatrix commented Nov 5, 2024

To align with our recent efforts to enhance release stability and enforce stricter PR reviews, I recommend breaking PRs into smaller, focused changes where possible. This approach has several benefits: if an issue arises, we can roll back only the specific change rather than the entire function, and focused changes make the review process much easier.

Since this is an experimental feature and it's already reviewed, splitting it isn't required, but let's keep this in mind for future submissions. We can aim to keep non-generated changes in PRs to a minimum necessary for the PR's primary goal.

Agree, and noted!
Thanks for the thorough review @valerybugakov 🙇‍♀️

@abeatrix abeatrix merged commit b78f3e7 into main Nov 6, 2024
22 checks passed
@abeatrix abeatrix deleted the bee/deep-toggler branch November 6, 2024 00:10
abeatrix added a commit that referenced this pull request Nov 6, 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 this pull request may close these issues.

4 participants