fix(kb): chunking config persistence#3877
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Background processing is updated accordingly: Written by Cursor Bugbot for commit 003b32d. Configure here. |
|
bugbot run |
Greptile SummaryThis PR fixes a bug where knowledge base chunking configuration was not being respected during document processing — the frontend was passing client-side fallback values (e.g. Key changes:
Findings:
Confidence Score: 5/5Safe to merge — the fix is correct and well-scoped; all remaining findings are P2 style/cleanup suggestions. The core bug (client-side fallbacks overriding KB chunking config) is correctly fixed across all upload paths. No data integrity or correctness regressions were introduced. The three P2 findings (dead parameter fields, missing null fallback for an edge case already guarded by a DB notNull constraint, and unused recipe/lang fields) are cleanup opportunities that do not block correct behavior. apps/sim/lib/knowledge/documents/service.ts — dead Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as AddDocumentsModal
participant Hook as useKnowledgeUpload
participant API as POST /api/knowledge/[id]/documents
participant Queue as processDocumentsWithQueue
participant Worker as processDocumentAsync
participant DB as Database (KB chunkingConfig)
UI->>Hook: uploadFiles(files, kbId, { recipe: 'default' })
Note over UI,Hook: chunkSize / chunkOverlap / minCharactersPerChunk<br/>no longer sent (bug fix)
Hook->>API: POST { documents, processingOptions: { recipe, lang }, bulk: true }
API->>Queue: processDocumentsWithQueue(docs, kbId, processingOptions, reqId)
Queue->>Worker: dispatchDocumentProcessingJob(payload)
Worker->>DB: SELECT chunkingConfig FROM knowledgeBase WHERE id = kbId
DB-->>Worker: { maxSize, minSize, overlap }
Note over Worker: Always uses kbConfig values (bug fix)<br/>processingOptions chunk fields ignored
Worker->>Worker: processDocument(url, name, mime, kbConfig.maxSize, kbConfig.overlap, kbConfig.minSize, ...)
|
Summary
Respect KB chunking configs set correctly.
Type of Change
Testing
Tested manually
Checklist