This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
assets/javascripts/discourse/components Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -148,21 +148,24 @@ export default class AiPersonaLlmSelector extends Component {
148148 this .setAllowLLMSelector ();
149149
150150 if (this .hasLlmSelector ) {
151- let llm = this .keyValueStore .getItem (LLM_SELECTOR_KEY );
151+ let llmId = this .keyValueStore .getItem (LLM_SELECTOR_KEY );
152+ if (llmId) {
153+ llmId = parseInt (llmId, 10 );
154+ }
152155
153156 const llmOption =
154- this .llmOptions .find ((innerLlmOption ) => innerLlmOption .id === llm ) ||
157+ this .llmOptions .find ((innerLlmOption ) => innerLlmOption .id === llmId ) ||
155158 this .llmOptions [0 ];
156159
157160 if (llmOption) {
158- llm = llmOption .id ;
161+ llmId = llmOption .id ;
159162 } else {
160- llm = " " ;
163+ llmId = " " ;
161164 }
162165
163- if (llm ) {
166+ if (llmId ) {
164167 next (() => {
165- this .currentLlm = llm ;
168+ this .currentLlm = llmId ;
166169 });
167170 }
168171 }
Original file line number Diff line number Diff line change 254254 it "Allows choosing persona and LLM" do
255255 ai_pm_homepage . visit
256256
257- ai_pm_homepage . persona_selector . expand
258- ai_pm_homepage . persona_selector . select_row_by_name ( persona . name )
259- ai_pm_homepage . persona_selector . collapse
260-
261257 ai_pm_homepage . llm_selector . expand
262258 ai_pm_homepage . llm_selector . select_row_by_name ( claude_2_dup . display_name )
263259 ai_pm_homepage . llm_selector . collapse
260+
261+ # confirm memory works for llm selection
262+ ai_pm_homepage . visit
263+ expect ( ai_pm_homepage . llm_selector ) . to have_selected_name ( claude_2_dup . display_name )
264264 end
265265
266266 it "renders back to forum link" do
You can’t perform that action at this time.
0 commit comments