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
-6
lines changed
assets/javascripts/discourse/components Expand file tree Collapse file tree 2 files changed +13
-6
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 257257 ai_pm_homepage . llm_selector . expand
258258 ai_pm_homepage . llm_selector . select_row_by_name ( claude_2_dup . display_name )
259259 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 )
260264 end
261265
262266 it "renders back to forum link" do
You can’t perform that action at this time.
0 commit comments