-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: pre-populate memory onboarding step from existing settings #1992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,14 @@ export function MemoryStep({ onNext, onBack }: MemoryStepProps) { | |
| const { settings, updateSettings } = useSettingsStore(); | ||
|
|
||
| const [config, setConfig] = useState<MemoryPanelConfig>({ | ||
| enabled: true, | ||
| embeddingProvider: 'ollama', | ||
| enabled: settings.memoryEnabled ?? true, | ||
| embeddingProvider: settings.memoryEmbeddingProvider || 'ollama', | ||
| openaiApiKey: settings.globalOpenAIApiKey || '', | ||
| openaiEmbeddingModel: settings.memoryOpenaiEmbeddingModel || '', | ||
| azureOpenaiApiKey: '', | ||
| azureOpenaiBaseUrl: '', | ||
| azureOpenaiEmbeddingDeployment: '', | ||
| voyageApiKey: '', | ||
| azureOpenaiApiKey: settings.memoryAzureApiKey || '', | ||
| azureOpenaiBaseUrl: settings.memoryAzureBaseUrl || '', | ||
| azureOpenaiEmbeddingDeployment: settings.memoryAzureEmbeddingDeployment || '', | ||
| voyageApiKey: settings.memoryVoyageApiKey || '', | ||
| voyageEmbeddingModel: settings.memoryVoyageEmbeddingModel || '', | ||
| googleApiKey: settings.globalGoogleApiKey || '', | ||
| googleEmbeddingModel: settings.memoryGoogleEmbeddingModel || '', | ||
|
Comment on lines
23
to
34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To avoid re-creating this configuration object on every render, you can use the lazy initialization form of This ensures the object is created only once on the initial render, not on every render. const [config, setConfig] = useState<MemoryPanelConfig>(() => ({
// ... all the properties
})); |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The memory onboarding step incorrectly uses the global
globalGoogleApiKeysetting instead of the memory-specificmemoryGoogleApiKey, leading to incorrect key persistence and retrieval for Google embeddings.Severity: MEDIUM
Suggested Fix
Update
MemoryStep.tsxto use thememoryGoogleApiKeysetting for both reading the initial value and for saving the updated value. Specifically, changesettings.globalGoogleApiKeytosettings.memoryGoogleApiKeywhere it's read and written. Additionally, ensure thememory-service-factory.tsusessettings.memoryGoogleApiKeywhen creating the embedding configuration.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.