fix: resolve all critical runtime errors and bugs from audit
- Add COMPLETIONS_API_KEY to config.py (env var + auto-generated fallback) - Fix perplexity auto-search: upstream sends logprobs=true, parse_llama_stream_chunk extracts per-token logprobs, all_logprobs populated during streaming - Fix all /api/models endpoints to target LLAMA_SERVER_BASE (port 8081) not OLLAMA_BASE - Fix RAG embedding endpoint URL from port 11434 (Ollama) to 8081 (llama-server) - Correct misleading error messages: 'inference server' not 'Ollama' - Remove raw_results leak from SSE event stream in /api/search - Fix weather query extractor: pattern-match instead of unconditional suffix append - Escape FTS5 operator keywords (AND/OR/NOT/NEAR) in memory search - Move auth.py BODY_LIMIT_DEFAULT_BYTES imports to module level - Change RAG injection log level from warning to info - Fix all 8 test files after modular refactor (rewire imports from correct modules) - Update AGENTS.md and README.md to reflect v1.8.0 changes
This commit is contained in:
@@ -62,7 +62,13 @@ def search_memories(query: str, limit: int = 5) -> list:
|
||||
if not words:
|
||||
db.close()
|
||||
return []
|
||||
safe_query = " OR ".join(word + "*" for word in words[:10])
|
||||
escaped = []
|
||||
for word in words[:10]:
|
||||
if word.upper() in {"AND", "OR", "NOT", "NEAR"}:
|
||||
escaped.append(f'"{word}"*')
|
||||
else:
|
||||
escaped.append(word + "*")
|
||||
safe_query = " OR ".join(escaped)
|
||||
try:
|
||||
rows = db.execute(
|
||||
"SELECT rowid, fact, topic, source, created_at, bm25(memories) AS rank "
|
||||
|
||||
Reference in New Issue
Block a user