From 7232755d11ed48fa10ff6dd29bdde6f242070441 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Tue, 24 Mar 2026 16:18:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20decision=20record=20body=20cap=202K=20?= =?UTF-8?q?=E2=86=92=208K=20=E2=80=94=20proposals=20were=20truncating=20mi?= =?UTF-8?q?d-text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User asked for full DP-00002 text, bot served it but cut off at 2000 chars with "That's where my copy cuts off." Full proposals are 6K+. Increased index, sanitize, and prompt caps to 8K for decision records. Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70> --- telegram/kb_retrieval.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/telegram/kb_retrieval.py b/telegram/kb_retrieval.py index 87106e2..218b84c 100644 --- a/telegram/kb_retrieval.py +++ b/telegram/kb_retrieval.py @@ -175,11 +175,11 @@ class KBIndex: # Extract wiki-linked claim references from body related_claims = re.findall(r"\[\[([^\]]+)\]\]", body) - # Body excerpt — decisions get full body (typically 1-2K), entities get 500 chars + # Body excerpt — decisions get full body, entities get 500 chars ft = fm.get("type") if ft == "decision": - # Include full body for decision records — these are what users ask about - overview = body[:2000] if body else (summary or "") + # Full body for decision records — proposals can be 6K+ + overview = body[:8000] if body else (summary or "") elif summary: overview = f"{summary} " body_lines = [l for l in body.split("\n") if l.strip() and not l.startswith("#")] @@ -353,7 +353,7 @@ def retrieve_context(query: str, repo_dir: str, index: KBIndex | None = None, path=ent["path"], entity_type=ent["type"], domain=ent["domain"], - overview=_sanitize_for_prompt(ent["overview"], max_len=2000), + overview=_sanitize_for_prompt(ent["overview"], max_len=8000), tags=ent["tags"], related_claims=ent["related_claims"], )) @@ -583,7 +583,7 @@ def format_context_for_prompt(ctx: KBContext) -> str: sections.append(f"**{ent.name}** ({ent.entity_type}, {ent.domain})") # Top 3 entities get full content, rest get truncated if i < 3: - sections.append(ent.overview[:2000]) + sections.append(ent.overview[:8000]) else: sections.append(ent.overview[:500]) if ent.related_claims: