mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
- Wrap isatty() in _is_interactive_session() with try/except ValueError so MCP stdio transport shutdown no longer produces noisy tracebacks - Check both search_vector_chunks AND search_vector_embeddings exist before running JOIN queries in get_embedding_status(), fixing OperationalError when only the chunks table is present - Add test for closed-stream scenario Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -24,7 +24,13 @@ def _promos_disabled_by_env() -> bool:
|
||||
|
||||
def _is_interactive_session() -> bool:
|
||||
"""Return whether stdin/stdout are interactive terminals."""
|
||||
return sys.stdin.isatty() and sys.stdout.isatty()
|
||||
try:
|
||||
return sys.stdin.isatty() and sys.stdout.isatty()
|
||||
except ValueError:
|
||||
# Trigger: stdin/stdout already closed (e.g., MCP stdio transport shutdown)
|
||||
# Why: isatty() raises ValueError on closed file descriptors
|
||||
# Outcome: treat as non-interactive, suppressing promo output
|
||||
return False
|
||||
|
||||
|
||||
def _build_cloud_promo_message() -> str:
|
||||
|
||||
Reference in New Issue
Block a user