Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

refactor: add default prompt mixin to transcripts by default#1479

Merged
abeatrix merged 9 commits into
mainfrom
bee/default-mixin
Oct 24, 2023
Merged

refactor: add default prompt mixin to transcripts by default#1479
abeatrix merged 9 commits into
mainfrom
bee/default-mixin

Conversation

@abeatrix

@abeatrix abeatrix commented Oct 24, 2023

Copy link
Copy Markdown
Contributor

Moved from https://github.com/sourcegraph/cody/pull/1466

refactor: add default prompt mixin to transcripts by default

  • Remove initialization of default prompt mixin by clients.
  • Update Transcript to add the default prompt mixin to all interactions on creation.
  • The PromptMixin class allows mixins to be defined that prepend text to prompts.
  • Transcript mixes in all registered PromptMixin instances into the human prompt text before sending to the assistant.
  • This centralizes default prompt handling in Transcript. Clients no longer need to add the default prompt mixin themselves.
  • This also adds the default prompt mixin to web and other clients that previously have not initialized the PromptMixin at activation.

Test plan

You should see (Reply as Cody, a coding assistant developed by Sourcegraph...) prepended to all users' questions:

image

@abeatrix abeatrix requested review from 0xnmn and rafax October 24, 2023 12:25
@abeatrix abeatrix requested a review from a team October 24, 2023 12:53
Comment thread lib/shared/src/prompt/prompt-mixin.ts Outdated
abeatrix and others added 2 commits October 24, 2023 06:22
Co-authored-by: Rafał Gajdulewicz <rafax@users.noreply.github.com>

@rafax rafax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM, tried running locally but changes don't seem to be picked up, but I trust you :)

@abeatrix abeatrix merged commit 8782509 into main Oct 24, 2023
@abeatrix abeatrix deleted the bee/default-mixin branch October 24, 2023 16:08
@abeatrix abeatrix added the chat/commands Chat and Commands label Nov 1, 2023
burmudar pushed a commit that referenced this pull request Nov 21, 2024
Changes to the enterprise enhanced context panel:

- Pluralizes repo/repos in the repo tree view summary line
- Updates counts in the repo tree view summary line
- Mentions the number of ignored repos in the repo tree view summary
line (if any)
- Adds a help tooltip with a link to documentation
- Removes the help button from the right-hand side toolbar
- Clicking outside the repo picker popup accepts the edits instead of
cancelling them
- Alt-tabbing while the repo picker popup is open does not dismiss it

Part of #1322

## Test plan

Tested manually.

1. Run with `CODY_JETBRAINS_FEATURES=cody.feature.internals-menu=true`
2. Sign into an Enterprise account
3. Verify the repo picker is collapsed, one line and the edit pencil is
visible
4. Hover the repo picker and verify the tooltip, opening the link goes
to context documentation

![Screenshot 2024-05-10 at 20 23
52](https://github.com/sourcegraph/jetbrains/assets/55120/e3f30e14-a740-445d-bdeb-510cd98e98a8)

5. Add repos and verify the summary line language updates, pluralization
is correct, etc.
6. Use Internals, Testing: Cody Ignore and ignore some repositories,
check the "ignored" language updates, etc.

![Screenshot 2024-05-10 at 20 25
19](https://github.com/sourcegraph/jetbrains/assets/55120/023d38f7-6f41-4563-87ba-1d7093c796bd)

7. Verify the details of adding repositories with the pencil:
    - Change text, press ESC, repo list should *not* update
    - Change text, press cmd-enter, repo list should update
- Change text, click outside popup, repo list *should* update (new
behavior)

8. Open the pencil popup, verify that cmd-tab/alt-tab away from IntelliJ
and back does not close the popup
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

chat/commands Chat and Commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants