feat(journal): journal_closeout._filter_messages excludes daily_prep
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Tests for journal closeout extraction helpers."""
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
|
||||
def _msg(role: str, content: str, kind: str | None = None):
|
||||
"""Build a Message-like stand-in for the filter helpers."""
|
||||
metadata = {"kind": kind} if kind else None
|
||||
return SimpleNamespace(role=role, content=content, msg_metadata=metadata)
|
||||
|
||||
|
||||
def test_filter_excludes_daily_prep_messages():
|
||||
from fabledassistant.services.journal_closeout import _filter_messages
|
||||
|
||||
msgs = [
|
||||
_msg("assistant", "Good morning — here is today's plan…", kind="daily_prep"),
|
||||
_msg("user", "I want to focus on the auth refactor today."),
|
||||
_msg("assistant", "Got it. I'll keep tool calls quiet."),
|
||||
]
|
||||
kept = _filter_messages(msgs)
|
||||
contents = [m.content for m in kept]
|
||||
assert "Good morning — here is today's plan…" not in contents
|
||||
assert "I want to focus on the auth refactor today." in contents
|
||||
assert "Got it. I'll keep tool calls quiet." in contents
|
||||
Reference in New Issue
Block a user