From 6705613aa49fb5a0fa217dc5ff31bbd6ea7375e8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Apr 2026 10:10:25 +0800 Subject: [PATCH] fix(reader): include all keep candidates in digest brief --- src/summary_mcp/models/openclaw_delivery.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/summary_mcp/models/openclaw_delivery.py b/src/summary_mcp/models/openclaw_delivery.py index 0e12eb2..2f71ca5 100644 --- a/src/summary_mcp/models/openclaw_delivery.py +++ b/src/summary_mcp/models/openclaw_delivery.py @@ -11,7 +11,7 @@ from pydantic import BaseModel, Field from .article_candidate import OpenClawCandidateInput -DIGEST_BRIEF_LIMIT = 5 +DIGEST_BRIEF_LIMIT: int | None = None DIGEST_BRIEF_HIGHLIGHT_LIMIT = 3 @@ -81,11 +81,12 @@ def build_openclaw_delivery_payload( def build_openclaw_digest_brief( payload: OpenClawDeliveryPayload, *, - limit: int = DIGEST_BRIEF_LIMIT, + limit: int | None = DIGEST_BRIEF_LIMIT, highlight_limit: int = DIGEST_BRIEF_HIGHLIGHT_LIMIT, ) -> OpenClawDigestBrief: keep_candidates = [candidate for candidate in payload.candidates if candidate.selection_decision == "keep"] sorted_candidates = sorted(keep_candidates, key=lambda candidate: candidate.digest_rank, reverse=True) + selected_candidates = sorted_candidates if limit is None else sorted_candidates[:limit] top_candidates = [ DigestBriefCandidate( title=candidate.title, @@ -97,7 +98,7 @@ def build_openclaw_digest_brief( selection_decision=candidate.selection_decision, url=str(candidate.url), ) - for candidate in sorted_candidates[:limit] + for candidate in selected_candidates ] return OpenClawDigestBrief( schema_version="digest-brief.v1",