mirror of
https://github.com/lukaszraczylo/claude-mnemonic.git
synced 2026-10-12 04:55:18 +00:00
fix(hooks,db,mcp,worker): add type safety and error handling (#21)
- [x] Add type checking and error handling for JSON type assertions in user-prompt hook - [x] Add error handling for session update query in CreateSDKSession - [x] Update MCP tool description to reference sqlite-vec instead of ChromaDB - [x] Fix MinConfidence sentinel value check from 0 to -1 - [x] Pass project parameter to vector search filter in handleSearchByPrompt - [x] Return empty map instead of nil for successful responses without JSON body
This commit is contained in:
@@ -164,7 +164,7 @@ func (s *Server) handleToolsList(req *Request) *Response {
|
||||
tools := []Tool{
|
||||
{
|
||||
Name: "search",
|
||||
Description: "Unified search across all memory types (observations, sessions, and user prompts) using vector-first semantic search (ChromaDB).",
|
||||
Description: "Unified search across all memory types (observations, sessions, and user prompts) using vector-first semantic search (sqlite-vec).",
|
||||
InputSchema: map[string]any{
|
||||
"type": "object",
|
||||
"properties": map[string]any{
|
||||
@@ -599,7 +599,8 @@ func (s *Server) handleFindRelatedObservations(ctx context.Context, args json.Ra
|
||||
return "", fmt.Errorf("id is required")
|
||||
}
|
||||
|
||||
if params.MinConfidence == 0 {
|
||||
// Use -1 as sentinel for "not provided" since 0.0 is a valid threshold
|
||||
if params.MinConfidence < 0 {
|
||||
params.MinConfidence = 0.5
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user