v0.5.2 - fixed: llm router async, relay-UI mismatch, intake summarization failure, among others.

Memory relevance thresh. increased.
This commit is contained in:
serversdwn
2025-12-12 02:58:23 -05:00
parent 6a20d3981f
commit fe86759cfd
4 changed files with 106 additions and 14 deletions

View File

@@ -9,6 +9,55 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Se
---
## [0.5.2] - 2025-12-12
### Fixed - LLM Router & Async HTTP
- **Critical**: Replaced synchronous `requests` with async `httpx` in LLM router [cortex/llm/llm_router.py](cortex/llm/llm_router.py)
- Event loop blocking was causing timeouts and empty responses
- All three providers (MI50, Ollama, OpenAI) now use `await http_client.post()`
- Fixes "Expecting value: line 1 column 1 (char 0)" JSON parsing errors in intake
- **Critical**: Fixed missing `backend` parameter in intake summarization [cortex/intake/intake.py:285](cortex/intake/intake.py#L285)
- Was defaulting to PRIMARY (MI50) instead of respecting `INTAKE_LLM=SECONDARY`
- Now correctly uses configured backend (Ollama on 3090)
- **Relay**: Fixed session ID case mismatch [core/relay/server.js:87](core/relay/server.js#L87)
- UI sends `sessionId` (camelCase) but relay expected `session_id` (snake_case)
- Now accepts both variants: `req.body.session_id || req.body.sessionId`
- Custom session IDs now properly tracked instead of defaulting to "default"
### Added - Error Handling & Diagnostics
- Added comprehensive error handling in LLM router for all providers
- HTTPError, JSONDecodeError, KeyError, and generic Exception handling
- Detailed error messages with exception type and description
- Provider-specific error logging (mi50, ollama, openai)
- Added debug logging in intake summarization
- Logs LLM response length and preview
- Validates non-empty responses before JSON parsing
- Helps diagnose empty or malformed responses
### Added - Session Management
- Added session persistence endpoints in relay [core/relay/server.js:160-171](core/relay/server.js#L160-L171)
- `GET /sessions/:id` - Retrieve session history
- `POST /sessions/:id` - Save session history
- In-memory storage using Map (ephemeral, resets on container restart)
- Fixes UI "Failed to load session" errors
### Changed - Provider Configuration
- Added `mi50` provider support for llama.cpp server [cortex/llm/llm_router.py:62-81](cortex/llm/llm_router.py#L62-L81)
- Uses `/completion` endpoint with `n_predict` parameter
- Extracts `content` field from response
- Configured for MI50 GPU with DeepSeek model
- Increased memory retrieval threshold from 0.78 to 0.90 [cortex/.env:20](cortex/.env#L20)
- Filters out low-relevance memories (only returns 90%+ similarity)
- Reduces noise in context retrieval
### Technical Improvements
- Unified async HTTP handling across all LLM providers
- Better separation of concerns between provider implementations
- Improved error messages for debugging LLM API failures
- Consistent timeout handling (120 seconds for all providers)
---
## [0.5.1] - 2025-12-11
### Fixed - Intake Integration