Skip to content

Commit

Permalink
fix(chat): update recent models when agents added to workspace from c…
Browse files Browse the repository at this point in the history
…hat (Issue #2822) (#2951)

Co-authored-by: Magomed-Elbi Dzhukalaev <[email protected]>
  • Loading branch information
Gimir and Magomed-Elbi Dzhukalaev authored Jan 17, 2025
1 parent 5d38692 commit 245c974
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const AddModelsControl = ({
ModelsActions.addInstalledModels({
references: modelIdsToInstall,
showSuccessToast: true,
updateRecentModels: true,
}),
);
};
Expand Down
7 changes: 7 additions & 0 deletions apps/chat/src/store/models/models.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ const addInstalledModelsEpic: AppEpic = (action$, state$) =>
),
);
}
if (payload.updateRecentModels) {
actions.push(
...newInstalledModels.map(({ id }) =>
of(ModelsActions.updateRecentModels({ modelId: id })),
),
);
}

return concat(
...actions,
Expand Down
1 change: 1 addition & 0 deletions apps/chat/src/store/models/models.reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const modelsSlice = createSlice({
_action: PayloadAction<{
references: string[];
showSuccessToast?: boolean;
updateRecentModels?: boolean;
}>,
) => state,
removeInstalledModels: (
Expand Down

0 comments on commit 245c974

Please sign in to comment.