fix(dsh): make extraction drain lossless and auditable - #97
Merged
Conversation
The DSH adapter's extractPending loop pulled a fixed 50 unextracted messages per batch with no length bound, built an unbounded existingNames hint list, and on any error left the whole batch unextracted while stopping the drain. A batch that stalled the LLM stream (no finish/error chunk) was retried on every restart forever, pinning the backlog. - bound each extraction request by accumulated normalized characters (8K) then message count (15); a single long message always fits so the drain always progresses - cap the existingNames hint list (150 entries / 3K chars) - hard-bound the LLM stream with a 180s timeout (previously none) - retry transient failures with backoff (5s/15s), then bisect the batch, and mark a lone failing message extracted as a last resort so the drain can never deadlock Verified: 129 vitest tests pass; a backlog that previously stalled forever now drains to zero on a real deployment.
…th capping) Three new adapter tests drive a real in-memory-file store through the backfill -> scheduleExtract -> drainBatch path: - a transient LLM failure is retried and the backlog drains to zero - a permanently failing batch is bisected and each singleton is marked extracted (no deadlock), with the drain still progressing - an oversized message batch is split by accumulated normalized length so no single extraction request exceeds the size cap Also expose extractionStreamTimeoutMs / extractionRetryDelaysMs as adapter config so hosts can tune (and tests can shorten) the resilience knobs.
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.
Integrates and supersedes #95 while preserving both original contributor commits and authorship. Thank you @evilh2019 and @penggaolai for identifying the fixed-size backlog stall and contributing the initial bounded batching, retry and bisect implementation.
Root-cause corrections added during maintainer validation:
Validation:
This prepares version 1.6.0-beta.11.