Commit graph

253 commits

Author SHA1 Message Date
Michael Sloan
985544ffb9
assistant2: Try again with fix use of rust-analyzer with "workspace": false (#23331)
I thought #23326 did the trick, but it didn't

Release Notes:

- N/A
2025-01-18 20:33:24 +00:00
Michael Sloan
9a7b73b161
assistant2: fix use with rust-analyzer "workspace": false (#23326)
Before this was getting errors about `TestAppContext` not existing.

Release Notes:

- N/A
2025-01-18 18:19:16 +00:00
Danilo Leal
e338a177c5
assistant2: Adjust "generating" state design (#23299)
To ensure message readability is not affected in any way.


https://github.com/user-attachments/assets/9a2ad949-1a8a-4c31-ad3c-db70f48e5d98

Release Notes:

- N/A
2025-01-17 20:22:27 -03:00
Agus Zubiaga
938e28f871
assistant2: Thread history keyboard navigation (#23145)
Open and delete threads via keyboard:


https://github.com/user-attachments/assets/79b402ad-a49d-4c52-9d46-28a7bf32ff1f



Note: this doesn't include navigation in the "recent threads" section of
the empty state

Release Notes:

- N/A
2025-01-17 18:41:17 -03:00
Piotr Osiewicz
c9534e8025
chore: Use workspace fields for edition and publish (#23291)
This prepares us for an upcoming bump to Rust 2024 edition.

Release Notes:

- N/A
2025-01-17 17:39:22 +01:00
Danilo Leal
2edeb89a84
assistant2: Adjust "you" message block design (#23281)
Just removing the extra indentation margin.

Release Notes:

- N/A
2025-01-17 10:59:03 -03:00
Piotr Osiewicz
795376cb07
ui: Track changes to UI font size made via actions with settings (#23265)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Linux x86_x64 release bundle (push) Blocked by required conditions
CI / Linux arm64 release bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Fixes #5380

Closes #5380

Release Notes:

- Font size changes made with actions are now persisted in user settings
2025-01-16 23:28:18 +00:00
Marshall Bowers
24495f09f9
Add streaming_diff crate (#23264)
This PR extracts the streaming diff implementation to its own
`streaming_diff` crate.

It was duplicated between `assistant` and `assistant2`, but their
implementations were exactly the same (and I don't see a reason why they
would need to diverge).

Release Notes:

- N/A
2025-01-16 23:12:46 +00:00
Marshall Bowers
1b1c2e55f3
Extract PromptStore and PromptBuilder to new prompt_library crate (#23254)
This PR adds a new `prompt_library` crate and extracts the `PromptStore`
and `PromptBuilder` to it.

Eventually we'll want to house the `PromptLibrary` itself in this crate,
but right now that involves untangling a few dependencies.

Release Notes:

- N/A
2025-01-16 20:06:16 +00:00
Danilo Leal
8a0c22c3bf
assistant2: Add ChatMode action (#23243)
This PR makes the assistant 2 panel switch work with the keyboard via
the `cmd-e` keybinding.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-01-16 13:02:22 -03:00
Danilo Leal
9f52683ebc
Remove the SwitchWithLabel component (#23240)
This PR removes the `SwitchWithLabel` component because we're adding
`label` as a method to `Switch`. Thus, we no longer need an extra
component just to append a label. Additionally, we're also adding
`keybinding` as a method.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-01-16 12:18:59 -03:00
Marshall Bowers
e215ca1d99
Dedupe AssistantSettings (#23190)
This PR dedupes the `AssistantSettings` so we can use the same settings
for both Assistant1 and Assistant2.

We originally forked them so we could change the Assistant2 settings
freely, but given our rollout strategy for the new Assistant, I don't
think that makes sense.

This also fixes the issue where the JSON language server would show a
"Matches multiple schemas when only one must validate" warning in
`settings.json`.

Closes #23171.

Release Notes:

- Fixed the "Matches multiple schemas when only one must validate"
warning for the `assistant` setting.
2025-01-15 18:52:54 +00:00
Danilo Leal
07d582401a
assistant2: Revise thread visual design (#23083)
This PR adjusts the design of the assistant 2 threads with the goal of
reducing visual busyness. My intention is to remove the amount of lines
and borders given it is a relatively tight space. It also refines the
"generating" floating container style, finally leveraging linear
gradients that were recently added to GPUI! Now, we only display headers
for "you" messages. Assistant responses will be rendered right in the
panel; not bounded by a card container.

<img width="800" alt="Screenshot 2025-01-14 at 7 08 39 PM"
src="https://github.com/user-attachments/assets/a8ffa780-0ef2-4d4b-ae19-3f02fd2d63a6"
/>

Release Notes:

- N/A
2025-01-14 22:29:39 +00:00
Yagil Burowski
c038696aa8
Add LM Studio support to the Assistant (#23097)
#### Release Notes:

- Added support for [LM Studio](https://lmstudio.ai/) to the Assistant.

#### Quick demo:


https://github.com/user-attachments/assets/af58fc13-1abc-4898-9747-3511016da86a

#### Future enhancements:
- wire up tool calling (new in [LM Studio
0.3.6](https://lmstudio.ai/blog/lmstudio-v0.3.6))

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-14 20:41:58 +00:00
Agus Zubiaga
de5f023477
assistant2: Cancel generation button (#23137)
Turns the "esc to cancel" label into a button so it can be dispatched
via click or keyboard. The keybinding isn't hardcoded anymore.

![CleanShot 2025-01-14 at 13 44
22@2x](https://github.com/user-attachments/assets/a947f58b-7de2-400b-b95a-384b78c79697)


Release Notes:

- N/A
2025-01-14 19:22:48 +00:00
Marshall Bowers
4febc7ea49
assistant2: Cancel pending completion when an error occurs (#23143)
This PR makes it so the pending completion is cleared when an error
occurs.

This makes it so `Thread::is_streaming()` will return `false` in the
error case (and thus hide the streaming indicator in the UI).

Release Notes:

- N/A
2025-01-14 19:04:47 +00:00
Agus Zubiaga
39ac6e4a75
assistant2: Navigate context strip with keyboard (#23128)
Context pills are now focusable and intractable via the keyboard.

- <kbd>←</kbd> and <kbd>→</kbd> move the focus to the previous or next
item (wrapping if necessary)
- <kbd>↓</kbd> and <kbd>↑</kbd> move the focus vertically
- If the cursor is in the first/last row of the assistant/inline editor,
they will move the focus to the strip
- Inside the strip, they will move the focus to the pill horizontally
overlapping the most
- If already in the first/last row of the strip, they will move to the
first/last pill (like in editors)
- If the first/last pill is focused, they will move the focus back to
the editor
- <kbd>⌫</kbd>  removes the focused pill (unless it's the suggested one)
- <kbd>⏎</kbd> accepts the suggested pill if focused
  


https://github.com/user-attachments/assets/040bc71c-a3ae-4961-9886-2d5c3d290a73



Release Notes:

- N/A
2025-01-14 16:45:11 +00:00
Marshall Bowers
93f117b21a
Improve registration for Assistant code action providers (#23099)
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/22911 to further improve the
registration of code action providers for the Assistant in order to
prevent duplicates.

The `CodeActionProvider` trait now has an `id` method that is used to
return a unique ID for a code action provider. We use this to prevent
registering duplicates of the same provider.

The registration of the code action providers for Assistant1 and
Assistant2 have also been reworked. Previously we were not call the
registration function—and thus setting up the subscriptions—until we
resolved the feature flags. However, this could lead to the registration
happening too late for existing workspace items.

We now perform the registration right away and then remove the undesired
code action providers once the feature flags have been resolved.

Release Notes:

- N/A
2025-01-13 22:25:58 +00:00
Marshall Bowers
830f45e56a
assistant2: Add floating indicator when a response is streaming (#23096)
This PR adds a separate indicator at the bottom of the thread that shows
when a response is being streamed (as well as how to cancel it):

<img width="1309" alt="Screenshot 2025-01-13 at 4 19 07 PM"
src="https://github.com/user-attachments/assets/b64f785b-d522-458d-b915-3f604890597f"
/>

Release Notes:

- N/A
2025-01-13 22:03:45 +00:00
Marshall Bowers
c599ba64bc
assistant2: Only show the streaming indicator on the last Assistant message (#23090)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR is a follow-up to #23078 to ensure that the streaming indicator
only shows up on the last Assistant message.

Release Notes:

- N/A
2025-01-13 21:09:01 +00:00
Agus Zubiaga
4054d4a5b7
assistant2: Fix inline context picker and handle dismiss (#23081)
The new `ContextMenu`-based `ContextPicker` requires initialization when
opened, but we were only doing this for the `ContextStrip` picker, not
the inline one.

Additionally, because we have a wrapper element around ContextMenu, we
need to propagate the `DismissEvent` so that it properly closes when
Escape is pressed.

Release Notes:

- N/A
2025-01-13 21:00:20 +00:00
Marshall Bowers
2179be1855
assistant2: Add an indicator when a response is streaming in (#23078)
This PR adds an indicator to the Assistant message to indicate that it
is still streaming:

<img width="1310" alt="Screenshot 2025-01-13 at 2 10 33 PM"
src="https://github.com/user-attachments/assets/635ee60d-b5ea-40ac-952a-b7bfa7e04fcc"
/>

Release Notes:

- N/A
2025-01-13 19:29:50 +00:00
Marshall Bowers
c1c767a5bd
assistant2: Make Esc cancel current completion (#23076)
This PR makes it so pressing `Esc` in Assistant2 will cancel the current
completion.

Release Notes:

- N/A
2025-01-13 19:09:27 +00:00
Marshall Bowers
40ecc38dd2
assistant2: Make ContextStore::insert_* methods private (#22989)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR makes the `insert_*` methods on the `ContextStore` private, to
reduce confusion with the public `add_*` methods.

Release Notes:

- N/A
2025-01-10 22:50:33 +00:00
Marshall Bowers
dad1a3bd31
assistant2: Inline read calls (#22982)
This PR inlines the `read` calls on models in a few spots.

Release Notes:

- N/A
2025-01-10 21:54:50 +00:00
Marshall Bowers
80cc1f174f
assistant2: Hide the status bar icon when disabled via the settings (#22981)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR makes it so the status bar icon for Assistant2 is hidden when it
is disabled via the settings.

Release Notes:

- N/A
2025-01-10 19:44:57 +00:00
Marshall Bowers
2f07d53cce
assistant2: Remove unneeded #[allow(unused)]s (#22979)
This PR removes some unneeded `#[allow(unused)]`s from the context types
in Assistant2.

We're using these fields now, so we no longer need to suppress the
unused lint.

Release Notes:

- N/A
2025-01-10 19:05:08 +00:00
Danilo Leal
cbc403d3f3
assistant2: Change suggested file context pill label (#22967)
Changing it from "Open File" to "Active Tab" instead.

<img width="800" alt="Screenshot 2025-01-10 at 11 09 54 AM"
src="https://github.com/user-attachments/assets/534e94a4-df61-41d4-ad50-514ab9a87e4e"
/>

Release Notes:

- N/A
2025-01-10 14:37:57 +00:00
Danilo Leal
5310e33356
assistant2: Fix context strip context popover position in relation to trigger (#22966)
Little visual adjustment here.

| Before | After |
|--------|--------|
| <img width="1336" alt="Screenshot 2025-01-10 at 11 08 06 AM"
src="https://github.com/user-attachments/assets/268c6df6-fdb2-4a1c-b3b8-d6a39b93b206"
/> | <img width="1336" alt="Screenshot 2025-01-10 at 11 06 17 AM"
src="https://github.com/user-attachments/assets/fb53feef-9ae4-489b-9d12-bd50b349afc1"
/> |

Release Notes:

- N/A
2025-01-10 14:35:09 +00:00
Danilo Leal
9248458928
assistant2: Change model selector keybinding and make it visible (#22965)
We weren't showing the keybinding in none of the places where the model
selector was visible. Also, I took advantage of the opportunity to
change the keybinding for two reasons:

1. `cmd-shift-m` caused conflict if on an editor (inline assistant case)
2. `cmd-opt-/` is the one Cursor uses; so consistency with something
that might be already consolidated sounds like a low-hanging fruit

| Editor Inline Assist | Terminal Inline Assist | Assistant Panel |
|--------|--------|--------|
| <img width="1336" alt="Screenshot 2025-01-10 at 11 01 24 AM"
src="https://github.com/user-attachments/assets/0782f217-025f-4bc0-b2fa-64b3524c968b"
/> | <img width="1336" alt="Screenshot 2025-01-10 at 11 01 29 AM"
src="https://github.com/user-attachments/assets/d05a3b5c-33fd-4593-b1d8-aa9944de816a"
/> | <img width="1336" alt="Screenshot 2025-01-10 at 11 01 33 AM"
src="https://github.com/user-attachments/assets/8cb075e7-ccde-46f5-aa05-d20a9d42b286"
/> |

Release Notes:

- N/A
2025-01-10 14:27:52 +00:00
Agus Zubiaga
a267911e83
assistant2: Suggest recent files and threads as context (#22959)
The context picker will now display up to 6 recent files/threads to add
as a context:

<img
src="https://github.com/user-attachments/assets/80c87bf9-70ad-4e81-ba24-7a624378b991"
width=400>



Note: We decided to use a `ContextMenu` instead of `Picker` for the
initial one since the latter didn't quite fit the design for the
"Recent" section.

Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2025-01-10 14:26:53 +00:00
Michael Sloan
690ad29ba9
assistant2: Small misc efficiency improvements (#22947)
Release Notes:

- N/A
2025-01-10 09:20:15 +00:00
Michael Sloan
767f44bd27
assistant2: Implement refresh of context on message editor send (#22944)
Release Notes:

- N/A
2025-01-10 08:09:47 +00:00
Michael Sloan
0d6a549950
assistant2: More improvement to prompt building efficiency (#22941)
Release Notes:

- N/A
2025-01-10 04:40:11 +00:00
Agus Zubiaga
ec4c6744d6
assistant2: Show file icons for context entries (#22928)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
https://github.com/user-attachments/assets/d3d6f5f1-23ec-449b-a762-9869b9d4b5a5


Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Michael <michael@zed.dev>
2025-01-10 03:01:42 +00:00
Michael Sloan
0dd7ea4575
assistant2: Background load of context + prep for refresh + efficiency (#22935)
* Now loads context on background threads.

- For file and directory context, buffer ropes can be shared between
threads as they are immutable. This allows for traversal and
accumulation of buffer text on a background thread.

- For url context, the request, parsing, and rendering is now done on a
background thread.

* Prepares for support of buffer reload by individually storing the text
of directory buffers.

* Avoids some string copying / redundant strings.

- When attaching message context, no longer builds a string for each
context type.

- For directory context, does not build a `SharedString` for the full
text, instead has a slice of `SharedString` chunks which are then
directly appended to the message context.

- Building a fenced codeblock for a buffer now computes a precise
capacity in advance.

Release Notes:

- N/A
2025-01-10 01:26:21 +00:00
Marshall Bowers
2143608b5d
Fix duplicated Fix with Assistant code actions (#22911)
This PR fixes the duplicated `Fix with Assistant` code actions that were
being shown in the code actions menu.

This fix isn't 100% ideal, as there is an edge case in buffers that are
already open when the workspace loads, as we may not observe the feature
flags in time to register the code action providers by the time we
receive the event that an item was added to the workspace.

Closes https://github.com/zed-industries/zed/issues/22400.

Release Notes:

- Fixed duplicate "Fix with Assistant" entries showing in the code
action list.
2025-01-09 19:25:12 +00:00
Michael Sloan
05bc6b2abd
assistant2: Split out implementation of Context::snapshot (#22878)
Release Notes:

- N/A
2025-01-09 00:25:16 +00:00
Michael Sloan
a0fca24e3f
assistant2: Add live context type and use in message editor (#22865)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2025-01-08 21:47:58 +00:00
Marshall Bowers
7e39023ea5
assistant2: Push logic for adding thread context down into the ContextStore (#22855)
This PR takes the logic for adding thread context out of the
`ThreadContextPicker` and pushes it down into the `ContextStore`.

Release Notes:

- N/A
2025-01-08 19:54:54 +00:00
Marshall Bowers
69dde8e31d
assistant2: Push logic for adding directory context down into the ContextStore (#22852)
This PR takes the logic for adding file context out of the
`DirectoryContextPicker` and pushes it down into the `ContextStore`.

Release Notes:

- N/A
2025-01-08 18:43:44 +00:00
Marshall Bowers
86f5bb1cc0
assistant2: Push logic for adding file context down into the ContextStore (#22846)
This PR takes the logic for adding file context out of the
`FileContextPicker` and pushes it down into the `ContextStore`.

Release Notes:

- N/A
2025-01-08 17:46:49 +00:00
Agus Zubiaga
36301442dd
assistant2: Handle non-text files in context pickers (#22795)
We'll now show an error message if the user tries to add a directory
that contains no text files or when they try to add a single non-text
file.

Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
2025-01-08 14:06:29 +00:00
Richard Feldman
52f29b4a1f
Fix conversation selector popover menu offset (#22796)
Before, the conversation popover menu covered up what you were typing
because it wasn't offset properly.

Now it's offset properly, using the UI font size so the amount of offset
scales with the font size:

<img width="435" alt="Screenshot 2025-01-07 at 4 34 27 PM"
src="https://github.com/user-attachments/assets/55e40910-8cd4-4548-b4fb-521eb2845775"
/>
<img width="454" alt="Screenshot 2025-01-07 at 4 33 58 PM"
src="https://github.com/user-attachments/assets/30350489-09f1-4cb8-9f95-ed4ee87bc110"
/>
<img width="488" alt="Screenshot 2025-01-07 at 4 34 18 PM"
src="https://github.com/user-attachments/assets/de60d990-2bd9-418d-a616-56beb3e4aa8a"
/>

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-01-08 13:32:48 +00:00
Danilo Leal
9d5ae516fd
assistant2: Add keybinding for "Remove All Context" action (#22783)
Ensuring all of the assistant 2 actions have keybindings.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-07 20:56:10 +00:00
Marshall Bowers
c53615ff61
assistant2: Add intermediate bindings to improve conditional readability (#22790)
This PR adds some intermediate bindings to the checks for if a
file/directory is already included to make the conditional a bit
clearer.

It wasn't immediately obvious what the boolean values corresponded to
when looking at it.

Release Notes:

- N/A
2025-01-07 19:42:38 +00:00
Marshall Bowers
fffa40f973
assistant2: Make context persistent in the thread (#22789)
This PR makes it so the context is persistent in the thread, rather than
having to reattach it for each message.

This PR intentionally does not make an attempt to refresh the attached
context if it changes. That will come in a follow-up.

Release Notes:

- N/A
2025-01-07 19:16:30 +00:00
Danilo Leal
76a8b55f77
assistant2: Add little design improvements (#22784)
The most relevant change in this PR is ensuring that the path tooltip
doesn't overlap with the "Remove Context" tooltip. Now, the former
tooltip only shows if you hover over the context pill's label. This
avoids a little flicker that was happening as the path tooltip would
show first and then quickly followed by the icon button's one.

Release Notes:

- N/A
2025-01-07 19:10:54 +00:00
Agus Zubiaga
deeccd2c63
assistant2: Focus prompt editor after dismissing context picker (#22786)
https://github.com/user-attachments/assets/6d0ac75e-fbc2-4bc2-be13-2d109f61361b




Release Notes:

- N/A
2025-01-07 18:40:16 +00:00
Marshall Bowers
3d8625f25c
assistant2: Store deduped context on the Thread (#22781)
This PR is a small refactoring in advance of some other changes.

Previously we were storing the whole `Context` associated with each
message. However, it's likely that multiple messages may end up using
the same context.

We now store the deduped context in a separate collection and refer to
it from each message by its `ContextId`.

Release Notes:

- N/A
2025-01-07 17:21:39 +00:00