Repository navigation
fix(embedding): treat the built-in local backend as available - #56
Merged
Merged
Conversation
SourcePanel decided whether the notebook could take documents by checking connections.embedding. Selecting the built-in local backend removes that connection, so the panel claimed embedding was not configured, disabled Add Source and blocked file/URL/paste/note import. Embedding is infrastructure now: EmbeddingService falls back to the built-in local model when no remote connection exists and downloads it on first RAG use. Read the real backend state from embedding:get-status instead and refresh it on connection and download changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes the Knowledge Base panel treat the built-in local embedding backend as configured, instead of showing "Please configure a default embedding model in settings first" and disabling Add Source.
Why?
SourcePanelcomputedhasEmbeddingModelfromconnections.embedding:Selecting the built-in local backend clears that connection (that is the point of the local mode), so the check was always
falsefor the default configuration. The result:alerts.Since #54, embedding is infrastructure:
EmbeddingService.resolveBackend()falls back to the built-in local model when no remote connection exists, andensureReady()downloads the weights on first RAG use. Availability therefore has to come from the real backend, not from the presence of a connection.Related issue
No open issue; reported from manual testing. Related to #54.
What changed?
SourcePanelnow readswindow.api.embedding.getStatus()and setshasEmbeddingModelwhenactiveBackend === 'local'or a remote connection is configured.connections.onChanged(local ↔ custom switch) and onembedding.onDownloadProgress(install state changes).How was this tested?
Verified with Electron CDP against
npm run dev, with no embedding connection configured (i.e. built-in local backend active):Knowledge Base / Please configure a default embedding model in settings first, andAdd Sourcewasdisabled=true.Add Sourceisdisabled=false, so documents can be added and the local model downloads on first use.Also checked:
npm run typecheck:webpasses.npm testpasses (49/49).npx prettier --check src/renderer/src/components/notebook/SourcePanel.tsxpasses.Screenshots / recordings
Not captured (text/state change only).
Checklist
npm run typecheckpasses.npm run buildpasses.Desktop / build changes