assistant: Don't unwrap built-in step resolution prompt (#15704)

This PR removes some `unwrap`s while loading the built-in step
resolution prompt.

While these `unwrap`s are safe today, they are relying on some implicit
contracts that might change in the future. We're using this in a context
where it's easy to propagate an error upwards, so we may as well avoid
the `unwrap`s entirely and use a `Result`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-02 16:07:43 -04:00 committed by GitHub
parent 24afe7c3f9
commit c6580da889
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -1407,7 +1407,7 @@ impl Context {
async move {
let prompt_store = cx.update(|cx| PromptStore::global(cx))?.await?;
let mut prompt = prompt_store.step_resolution_prompt();
let mut prompt = prompt_store.step_resolution_prompt()?;
prompt.push_str(&step_text);
request.messages.push(LanguageModelRequestMessage {