Skip to content

Reject incomplete local model answers before caching - #16

Closed
charan-rathore wants to merge 1 commit into
mainfrom
fix/local-generation-completion
Closed

charan-rathore wants to merge 1 commit into
mainfrom
fix/local-generation-completion

Conversation

@charan-rathore

Copy link
Copy Markdown
Owner

streamLocal returned whatever the local model streamed, even when the stream ended without a completion marker or finished with done_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.

Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
intellirag Ready Ready Preview Oct 5, 2026 7:38pm UTC
intellirag-live-own-track Ready Ready Preview Oct 5, 2026 7:38pm UTC
irag-fix-0904 Ready Ready Preview Oct 5, 2026 7:38pm UTC

@charan-rathore

Copy link
Copy Markdown
Owner Author

Landed directly on main as f9ed5a7 - closing this stacked draft as superseded.

This branch was successfully deployed

3 active deployments
Preview – intellirag-live-own-track — 806bec6d Deployed Oct 5, 2026 by vercel[bot]
Preview – intellirag — 806bec6d Deployed Oct 5, 2026 by vercel[bot]
Preview – irag-fix-0904 — 806bec6d Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant