This repository was archived by the owner on Mar 29, 2026. It is now read-only.
Fix #1069 #1073 #1078 #190 + RetryLlmService, CachingLlmService, LoggingObservabilityProvider + 58 new tests#1101
Open
mrigankad wants to merge 2 commits into
Open
Conversation
added 2 commits
February 21, 2026 10:56
…, SQL validation, and no-SQL handling
New integrations: - RetryLlmService: exponential-backoff retry for transient LLM failures - CachingLlmService: SHA-256 keyed LRU in-memory cache for LLM responses - LoggingObservabilityProvider: zero-dependency observability via Python logging Bug fixes: - Pinecone: replace MD5 placeholder with real sentence-transformers encoding - thinking indicator: yield StatusIndicatorComponent before first LLM call - evaluation runner: add _RecordingLlmMiddleware for trajectory recording Tests (58 new, all offline): - tests/test_regression_fixes.py: 14 tests (FastAPI, SQL injection, no-SQL) - tests/test_openai_responses.py: 16 tests (OpenAIResponsesService) - tests/test_local_wrappers.py: 28 tests (Retry, Caching, Logging wrappers) tox.ini: - Add py311-openai-responses environment - Re-enable py311-gemini environment
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
This PR addresses several bugs reported in the issue tracker, adds three new utility integrations, improves the evaluation runner, and ships 58 new offline tests.
Bug Fixes
#1069 — FastAPI
TypeError: multiple values for keyword argumentservers/fastapi/app.py: copy theapp_configdict, then.pop()title/description/versionbefore spreading with**app_configso user-provided keys never collide with positional arguments.#1073 — Gemini 3
thought_signaturesupportcore/tool/models.py: addedthought_signature: Optional[bytes] = NonetoToolCall.integrations/google/gemini.py:_parse_response()capturespart.thought_signature;stream_request()scans all chunks (not just the last) for tool calls;_build_payload()pre-builds athought_sig_by_call_idlookup and passes the signature through both function-call and function-responsePartkwargs.#1078 — SQL injection via prompt injection (legacy API)
legacy/base/base.py:ask()callsis_sql_valid()before displaying or executing SQL; non-SELECT statements are blocked and the raw LLM text is printed instead.legacy/flask/__init__.py:/api/v0/run_sqlendpoint validates SQL before running, returns a JSON error for disallowed statements.#190 — Graceful handling when LLM returns no SQL
is_sql_valid()guard inask()— plain-text LLM responses fail validation cleanly and are printed as informational messages rather than crashing.Pinecone embedding —
_create_embedding()was producing MD5 hashesintegrations/pinecone/agent_memory.py: replaced the MD5 placeholder with realsentence-transformersencoding (all-MiniLM-L6-v2by default, configurable viaembedding_modelparameter). Similarity search now works correctly.New Features
Thinking indicator
core/agent/agent.py: the TODO stub now yields a realStatusIndicatorComponent(status="loading", message="Thinking...", pulse=True)before the first LLM call whenconfig.include_thinking_indicatorsis enabled.Evaluation runner — trajectory recording
core/evaluation/runner.py: added_RecordingLlmMiddleware(one instance per test case, no shared state across concurrent runs)._execute_agent()now creates a per-run agent copy with a freshMemoryConversationStoreand the recorder appended tollm_middlewares, soAgentResult.tool_calls,llm_requests, andtotal_tokensare fully populated instead of empty.RetryLlmService(integrations/local/retry_llm.py)LlmServicedecorator with exponential-backoff retry for transient failures (httpxtimeouts, connection errors, HTTP 429/500/502/503/504).stream_requestonly retries if zero chunks have been yielded — prevents duplicate content in the caller's accumulator.max_retries=3,base_delay=1.0s,max_delay=30.0s,jitter=True.CachingLlmService(integrations/local/caching_llm.py)LlmServicedecorator with a SHA-256 keyed, insertion-order LRU in-memory cache.system_prompt,messages,tools,temperature,max_tokens— deliberately excludesuserandmetadataso different users asking the same question share the cached answer.stats(hits/misses/size) andinvalidate().LoggingObservabilityProvider(integrations/local/logging_observability.py)ObservabilityProviderimplementation that writes span lifecycle events (start, end with duration) and metric measurements to Python's standardloggingmodule.Tests Added
tests/test_regression_fixes.pytests/test_openai_responses.pyOpenAIResponsesService: tool serialization, payload building, response extraction, streamingtests/test_local_wrappers.pyRetryLlmService,CachingLlmService,LoggingObservabilityProvider58 new tests total, all passing offline (no real API keys required).
tox.inipy311-openai-responsesenvironment for the newOpenAIResponsesServicetest suite.py311-geminienvironment (was previously commented out).Files Changed
src/vanna/servers/fastapi/app.pysrc/vanna/core/tool/models.pythought_signaturefield (#1073)src/vanna/integrations/google/gemini.pythought_signatureplumbing (#1073)src/vanna/legacy/base/base.pyask()(#1078, #190)src/vanna/legacy/flask/__init__.py/api/v0/run_sql(#1078)src/vanna/integrations/pinecone/agent_memory.pysrc/vanna/core/agent/agent.pysrc/vanna/core/evaluation/runner.pysrc/vanna/integrations/local/retry_llm.pyRetryLlmServicesrc/vanna/integrations/local/caching_llm.pyCachingLlmServicesrc/vanna/integrations/local/logging_observability.pyLoggingObservabilityProvidersrc/vanna/integrations/local/__init__.pytests/test_regression_fixes.pytests/test_openai_responses.pytests/test_local_wrappers.pytox.ini