Repository navigation
Reject incomplete local model answers before caching - #16
Closed
charan-rathore wants to merge 1 commit into
Closed
charan-rathore wants to merge 1 commit into
charan-rathore wants to merge 1 commit into
Conversation
Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Landed directly on main as f9ed5a7 - closing this stacked draft as superseded. |
This branch was successfully deployed
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.
streamLocalreturned whatever the local model streamed, even when the stream ended without a completion marker or finished withdone_reason: "length". A truncated answer was then treated as a real answer and could be cached. The stream now tracks the terminal event and rejects partial completions, and the reader is cancelled on exit.Added
web/src/lib/rag/ollama-result.test.ts; the new tests fail against the old code and pass with this change.Tested: RAG suite 124 passed (npx tsx --test src/lib/rag/*.test.ts), typecheck clean, build passes; new tests verified failing before the fix and passing after. Lint reports the same 47 pre-existing problems on base.
Not all-green yet: full npm test has 16 inherited template-test failures unrelated to this change, so I am not claiming a fully green suite until Charan decides. Opening as a draft.
This fix was developed with Codex and reviewed and tested; Charan Rathore directs the work and is responsible for it.