fix: pass EXTRA_BODY through to LlamaCppLLM + detect GFM tables without leading/trailing pipes - #3400
Closed
handnewb wants to merge 1 commit into
Closed
Conversation
…nAICompatibleLLM delegate Fixes vectorize-io#3326: The create_llm_provider() factory accepted extra_body but never passed it to LlamaCppLLM, so HINDSIGHT_API_LLM_EXTRA_BODY was silently ignored for the llamacpp provider while working for every other provider (Bedrock, Fireworks, OpenAI-compatible, LiteLLM, etc.). The fix threads extra_body from the factory → LlamaCppLLM.__init__ → OpenAICompatibleLLM delegate, which already supports the parameter. fix(structured-doc): detect markdown tables without leading/trailing pipes Fixes vectorize-io#3361: The table parser required pipes at both start AND end of every row (^\s*\|.*\|\s*$), so GFM-compliant tables like "Col1 | Col2\n--- | ---" fell through to ParagraphBlock which joins all lines with spaces, permanently destroying table structure during delta refresh. The fix adds a lenient fallback: if a chunk contains a separator line AND every non-separator line contains at least one pipe character, it is treated as a table. This covers the common GFM shorthand without false-positiving on non-table content.
handnewb
force-pushed
the
fix/llamacpp-extra-body-and-markdown-table-collapse
branch
from
August 11, 2026 21:28
6276a88 to
bbfc9f9
Compare
nicoloboschi
requested changes
Aug 12, 2026
nicoloboschi
left a comment
Collaborator
There was a problem hiding this comment.
please make 2 separated prs
Contributor
Author
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.
Summary
Two independent fixes for issues discovered during contribution analysis.
Fix 1: llamacpp provider silently ignores HINDSIGHT_API_LLM_EXTRA_BODY (closes #3326)
The create_llm_provider() factory accepted extra_body but never passed it to LlamaCppLLM. Every other provider (Bedrock, Fireworks, OpenAI-compatible, LiteLLM, Gemini, Anthropic) receives extra_body — only llamacpp was missing.
Changes (2 files, +4 lines):
Fix 2: Delta refresh collapses GFM tables without leading/trailing pipes (closes #3361)
The table parser required pipes at both start AND end of every row. GFM-compliant tables without outer pipes fell through to ParagraphBlock which joins lines with spaces, destroying table structure permanently.
Changes (1 file, +11 lines):