Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/count_lines.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from typing import Collection, Optional


def count_lines(root: str, extensions=None) -> int:
def count_lines(root: str, extensions: Optional[Collection[str]] = None) -> int:
"""
Count total number of lines in files under `root` whose extension is in `extensions`.

Expand Down Expand Up @@ -36,7 +37,7 @@ def count_lines(root: str, extensions=None) -> int:
return total_lines


def main():
def main() -> None:
root = "."
total = count_lines(root)
print(f"Total lines of code under '{os.path.abspath(root)}': {total}")
Expand Down
14 changes: 14 additions & 0 deletions tests/test_mem0_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,20 @@ def test_update_no_input_is_noop(self):

client.add.assert_not_called()

def test_update_header_only_input_is_noop(self):
"""Input containing only a pipeline header is cleaned to empty and skipped."""
memory, client = _make_mem0_memory(agent_id="a1")

payload = MemoryWritePayload(
agent_role="writer",
inputs_text="=== INPUT FROM TASK (user) ===",
input_snapshot=None,
output_snapshot=None,
)
memory.update(payload)

client.add.assert_not_called()

def test_update_api_error_does_not_raise(self):
"""API errors are logged but do not propagate."""
memory, client = _make_mem0_memory(agent_id="a1")
Expand Down