Commit Graph

5 Commits (main)

Author SHA1 Message Date
ordinary being 6dd0a6a3d6
fix(embedding): read the pool's first-error guard under its own mutex (#4014)
BatchEmbedWithPool fans a batch out over the ants pool, so with
BATCH_EMBED_SIZE=1 every text becomes its own sub-batch and several workers run
at once. Each worker starts by testing firstErr to see whether an earlier
sub-batch already failed, but that read was unsynchronised while the writes are
under mu. The race detector reports it between the guard and the failure branch.

The guard exists to stop billing a provider for work whose result will be
discarded. A worker that misses the write issues the request anyway, so the race
defeats the protection it was added for.
2026-10-16 17:42:51 +08:00
ljl 2b31d3681b fix(embedding): prevent ants worker panic and mutex deadlock on empty/mismatched results
If the embedding provider returns an empty slice of vectors (e.g. length 0)
due to api mismatch or empty input, BatchEmbed will return length 0.
Accessing embedding[i] directly in BatchEmbedWithPool results in an out of bounds panic.
Because the panic occurs inside a mu.Lock() block, the mutex is never unlocked,
leading to a permanent deadlock of the document processing queue.

This fix checks the returned embeddings slice length and returns an error
instead of panicking, releasing the mutex properly.
2026-08-04 16:46:57 +08:00
wizardchen 64c44c9e27 refactor: Update tenant ID handling across the application 2025-11-25 16:30:54 +08:00
wizardchen 057cfd9eb0 feat: Enhance FAQ import functionality and UI improvements
- Added support for tracking the status of FAQ import tasks, including progress indicators for ongoing imports.
- Introduced new localization strings for processing tasks and batch operations in multiple languages.
- Updated the FAQ entry manager to display import progress and improved user feedback during the import process.
- Enhanced the KnowledgeBase component to reflect the processing state of knowledge items, improving user experience during document uploads.
- Implemented batch deletion functionality for chunks, streamlining the management of knowledge base content.
2025-11-23 17:32:50 +08:00
wizardchen 56eb2bce33 init commit 2025-08-05 15:08:07 +08:00