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

refactor(Deep Cody): Agentic Context Settings into UI Component #6519

Merged
merged 13 commits into from
Jan 3, 2025

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jan 3, 2025

Adds on #6513

This PR introduces a new UI-based approach for managing Cody's agent capabilities, replacing the previous VS Code settings configuration. It also moves Deep Cody out of the model dropdown into its own Agent Settings component

Key Changes

  1. New Agent UI Controls:

    • Added ToolboxButton component in chat input area with:
      • Bot icon indicating agent status (active/inactive)
      • Green pulse animation for active state
      • Popover menu for settings
      • Dedicated switches for agent and terminal features
  2. Deep Cody Architecture Improvements:

    • Simplified agent ID for Deep Cody to 'deep-cody' from previous ModelRef format
    • Added support for model selection between default chat model and Claude 3.5 Haiku
    • Moved shell context permission to UI toggle with warning message
    • Enhanced context handling with deduplication for repeated queries
  3. API & Type Updates:

    • Added toolboxSettings and updateToolboxSettings to WebView API
    • Updated AgentToolboxSettings type to use string-based agent ID
    • Enhanced message types to support agent attribution
    • Added feature flag for chat model selection
  4. Code Organization:

    • Refactored CodyToolProvider into namespace pattern
    • Improved tool factory initialization and management
    • Enhanced test coverage for new UI components
    • Removed deprecated VS Code settings
  5. Default Model

    • Defaulted to use 3.5 Haiku as the reflection model
    • When the ContextAgentDefaultChatModel feature flag is enabled on the instance, reflection model will be set to Sonnet instead

TO-DO

  • Update Deep Cody Notice / upsell with the new changes
  • Remove Deep Cody rate limit

Test plan

  1. Agent Controls:

    • Verify bot icon appears in chat input
    • Check icon states (active/inactive)
    • Confirm green pulse animation when active
    • Test settings popover interaction
  2. Settings Management:

    • Enable/disable agent via toggle
    • Toggle terminal access (when available)
    • Verify warning message for terminal access
    • Confirm settings persist across sessions
  3. Chat Experience:

    • Test chat with agent enabled/disabled
    • Verify model selection works correctly
    • Check context gathering improvements
    • Confirm terminal integration (when enabled)
  4. Settings Transition:

    • Verify existing setting is not respected and is marked as deprecated
    • The Terminal context is disabled by default in the new UI component
    • Test default states as PLG and Enterprise users
    • Check settings sync behavior

Changelog

abeatrix and others added 10 commits January 2, 2025 22:45
- remove Deep Cody specific UI elements and functionality
- default 3.5 haiku as reflection model
- replace cody.agentic.context.experimentalShell user config option with UI component
- deprecate cody.agentic.context.experimentalShell user config

BREAKING CHANGE: Deep Cody model is no longer supported. The UI elements and functionality related to Deep Cody have been removed.
…ture flag

- add FeatureFlag.ContextAgentDefaultChatModel to control whether Deep Cody should use the default chat model or 3.5 Haiku
- update ToolboxManager and DeepCodyAgent to respect the new feature flag
- remove unused code related to Deep Cody model selection

BREAKING CHANGE: Deep Cody will now use the default chat model or 3.5 Haiku based on the new feature flag. The UI elements and functionality related to model selection have been removed.
- Modify `getAgent` function to handle DeepCodyAgent separately and fall back to ChatHandler for unknown agents
- Add `modelId` parameter to `getAgent` to support different model types
- Skip query rewrite for DeepCodyAgent as it will be reviewed by the agent
- Optimize `ToolFactory` to only create new instances when needed
- Modify `getAgent` function to handle DeepCodyAgent separately and fall back to ChatHandler for unknown agents
- Add `modelId` parameter to `getAgent` to support different model types
- Skip query rewrite for DeepCodyAgent as it will be reviewed by the agent
- Optimize `ToolFactory` to only create new instances when needed
- Refactor `CodyToolProvider` to use a namespace-based approach
- Update tests to use the new `CodyToolProvider` API
Copy link

github-actions bot commented Jan 3, 2025

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

@abeatrix abeatrix merged commit b7d31fe into bee/context-agent-cleanup Jan 3, 2025
22 of 23 checks passed
@abeatrix abeatrix deleted the bee/context-agent-button branch January 3, 2025 22:57
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.

1 participant