mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-09 07:42:37 +02:00
fix: resolve UTF-8 string slicing bugs and feature flag issues
- Fix silent errors in stdio.rs: clients now receive fallback error responses instead of hanging when JSON serialization fails - Fix UTF-8 panics in keyword.rs: use char-aware slicing instead of byte offsets for query sanitization and term highlighting - Fix UTF-8 panics in prospective_memory.rs: replace hard-coded byte offsets with char-aware slicing for natural language parsing - Fix UTF-8 panics in git.rs: convert byte positions to char positions before slicing commit messages - Fix feature flag bug in vestige-mcp: add proper [features] section to forward embeddings and vector-search features from vestige-core, enabling the #[cfg(feature = "embeddings")] initialization code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f10367ecd0
commit
bfa91474a6
6 changed files with 70 additions and 44 deletions
|
|
@ -9,6 +9,11 @@ keywords = ["mcp", "ai", "memory", "fsrs", "neuroscience", "cognitive-science",
|
|||
categories = ["command-line-utilities", "database"]
|
||||
repository = "https://github.com/samvallad33/vestige"
|
||||
|
||||
[features]
|
||||
default = ["embeddings", "vector-search"]
|
||||
embeddings = ["vestige-core/embeddings"]
|
||||
vector-search = ["vestige-core/vector-search"]
|
||||
|
||||
[[bin]]
|
||||
name = "vestige-mcp"
|
||||
path = "src/main.rs"
|
||||
|
|
@ -27,7 +32,7 @@ path = "src/bin/cli.rs"
|
|||
# ============================================================================
|
||||
# Includes: FSRS-6, spreading activation, synaptic tagging, hippocampal indexing,
|
||||
# memory states, context memory, importance signals, dreams, and more
|
||||
vestige-core = { version = "1.0.0", path = "../vestige-core", features = ["full"] }
|
||||
vestige-core = { version = "1.0.0", path = "../vestige-core" }
|
||||
|
||||
# ============================================================================
|
||||
# MCP Server Dependencies
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ impl StdioTransport {
|
|||
}
|
||||
Err(e) => {
|
||||
error!("Failed to serialize error response: {}", e);
|
||||
// Send a minimal error response so client doesn't hang
|
||||
let fallback = r#"{"jsonrpc":"2.0","id":null,"error":{"code":-32603,"message":"Internal error"}}"#;
|
||||
let _ = writeln!(stdout, "{}", fallback);
|
||||
let _ = stdout.flush();
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
|
@ -68,6 +72,10 @@ impl StdioTransport {
|
|||
}
|
||||
Err(e) => {
|
||||
error!("Failed to serialize response: {}", e);
|
||||
// Send a minimal error response so client doesn't hang
|
||||
let fallback = r#"{"jsonrpc":"2.0","id":null,"error":{"code":-32603,"message":"Internal error"}}"#;
|
||||
let _ = writeln!(stdout, "{}", fallback);
|
||||
let _ = stdout.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue