There was an error while loading. Please reload this page.
1 parent f1d50c2 commit 24ca5f6Copy full SHA for 24ca5f6
2 files changed
src/basic_memory/mcp/prompts/recent_activity.py
@@ -42,11 +42,11 @@ async def recent_activity_prompt(
42
Returns:
43
Formatted summary of recent activity
44
"""
45
+ timeframe = timeframe or "7d"
46
logger.info(f"Getting recent activity, timeframe: {timeframe}, project: {project}")
47
48
# Call the tool function - it returns a well-formatted string
- # Pass type as string values (not enum) to match the tool's expected input
49
- activity_summary = await recent_activity.fn(project=project, timeframe=timeframe, type="entity")
+ activity_summary = await recent_activity.fn(project=project, timeframe=timeframe)
50
51
# Build the prompt response
52
# The tool already returns formatted markdown, so we use it directly
tests/mcp/test_recent_activity_prompt_modes.py
@@ -88,4 +88,21 @@ async def fake_fn(**kwargs):
88
89
assert captured_kwargs["timeframe"] == "2d"
90
assert captured_kwargs["project"] == "test-proj"
91
- assert captured_kwargs["type"] == "entity"
+ assert "type" not in captured_kwargs
92
+
93
94
+@pytest.mark.asyncio
95
+async def test_recent_activity_prompt_defaults_timeframe(monkeypatch):
96
+ """Prompt should fall back to 7d when timeframe omitted or falsy."""
97
+ captured_kwargs = {}
98
99
+ async def fake_fn(**kwargs):
100
+ captured_kwargs.update(kwargs)
101
+ return "## Recent Activity"
102
103
+ monkeypatch.setattr("basic_memory.mcp.prompts.recent_activity.recent_activity.fn", fake_fn)
104
105
+ await recent_activity_prompt.fn(timeframe=None, project=None) # pyright: ignore[reportGeneralTypeIssues]
106
107
+ assert captured_kwargs["timeframe"] == "7d"
108
+ assert captured_kwargs["project"] is None
0 commit comments