fix(kb): persist vlm_config on knowledge base update#1777
Open
lyra-planet wants to merge 1 commit into
Open
Conversation
eb5b6a3 to
7c75028
Compare
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.
Description
Fixes the knowledge base update API so top-level
vlm_configis accepted and persisted byPUT /api/v1/knowledge-bases/{id}.Previously,
UpdateKnowledgeBaseRequestdid not exposevlm_config, so Gin ignored the field during JSON binding and the service update path never saw it. The frontend already sendsvlm_configwhen editing a knowledge base, but the backend response and follow-up GET kept the old disabled VLM configuration.This PR adds
vlm_configto the update request DTO, passes it through the knowledge base service update path, persists it only when explicitly provided, and keeps omittedvlm_configrequests preserving the existing KB configuration. It also syncs the Go client request type, frontend API typing, and API docs.Type of Change
Related Issue
Fixes #1723
Testing
gofmton changed Go filesgo test ./internal/handler ./internal/application/service ./internal/agent/tools(cd client && go test ./...)UpdateKnowledgeBaseRequestnow binds a top-levelvlm_configfield from the update JSON body.UpdateKnowledgeBasepreserves the existing VLM config whenvlm_configis omitted.UpdateKnowledgeBaseoverwrites the stored VLM config whenvlm_configis provided.PUT /api/v1/knowledge-bases/{kbId}with{"name":"test","vlm_config":{"enabled":true,"model_id":"<vlm-model-id>"}}.GET /api/v1/knowledge-bases/{kbId}both returnedvlm_config.enabled=truewith the samemodel_id.Checklist
Screenshots / Recordings
N/A; backend API fix with no UI-visible layout change.