fix(mem0-plugin): graceful degradation without API key, stdin support
- SessionStart shows "Mem0 Inactive" banner with identity info when no API key set, instead of silently exiting with zero output - on_user_prompt.sh fires error/file-path detection even without API key (local pattern matching, no API needed). Search rubric still gated. - parse_export_file.py supports '-' argument for stdin piping
This commit is contained in:
@@ -131,8 +131,11 @@ def main() -> None:
|
||||
|
||||
filepath = sys.argv[1]
|
||||
try:
|
||||
with open(filepath, encoding="utf-8", errors="replace") as f:
|
||||
content = f.read()
|
||||
if filepath == "-":
|
||||
content = sys.stdin.read()
|
||||
else:
|
||||
with open(filepath, encoding="utf-8", errors="replace") as f:
|
||||
content = f.read()
|
||||
except OSError as e:
|
||||
print(f"Error reading file: {e}", file=sys.stderr)
|
||||
print("[]")
|
||||
|
||||
Reference in New Issue
Block a user