Files
Hy-Memory/tests/test_abstractor_dataclass.py
T
1ef0766891 fix(agent): restore the SessionSummaryResult dataclass decorator (#92)
The @dataclass decorator was left at the end of the section-divider comment
line, so SessionSummaryResult was a plain class without __init__. Every
construction raised "takes no arguments" - including the error branch inside
generate_session_summary(), whose TypeError escaped the surrounding except.

Move the decorator onto its own line and add a constructor regression.

Co-authored-by: qiye.sjh <shijiahao_0802@youzan.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-10-21 12:19:42 +08:00

14 lines
437 B
Python

# -*- coding: utf-8 -*-
"""Public Abstractor result types must remain constructible dataclasses."""
from hy_memory.agent.abstractor import SessionSummaryResult
def test_session_summary_result_accepts_fields():
result = SessionSummaryResult(success=True, summary="session summary")
assert result.success is True
assert result.summary == "session summary"
assert result.key_topics == []
assert result.error is None