MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cache_log_tail

Function cache_log_tail

scripts/test_mcp_interactive.py:71–83  ·  view source on GitHub ↗
(name: str, limit: int = 16384)

Source from the content-addressed store, hash-verified

69
70
71def cache_log_tail(name: str, limit: int = 16384) -> str:
72 cache_dir = os.environ.get("CBM_CACHE_DIR")
73 if not cache_dir:
74 return ""
75 path = os.path.join(cache_dir, "logs", name)
76 try:
77 with open(path, "rb") as stream:
78 stream.seek(0, os.SEEK_END)
79 size = stream.tell()
80 stream.seek(max(0, size - limit), os.SEEK_SET)
81 return stream.read(limit).decode("utf-8", errors="replace")
82 except OSError:
83 return ""
84
85
86def send(process: subprocess.Popen[bytes], message: dict[str, Any]) -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected