fix(honcho): read the sessionStart pin defensively in the first-turn formatter

tests and callers can build the provider without initialize(); the
formatter now treats a missing pin as unpinned instead of raising.
This commit is contained in:
Erosika
2026-09-04 16:17:41 -04:00
committed by kshitij
parent c3a5649aac
commit cc3bfc2120
+2 -1
View File
@@ -405,7 +405,8 @@ class HonchoMemoryProvider(DialecticMixin, MemoryProvider):
"""Render the prefetch context, keeping only the ``injection.sessionStart`` components when pinned.
The summary passes usable_honcho_summary here, so a contaminated one never reaches _base_context_cache."""
ctx = {**ctx, "summary": usable_honcho_summary(ctx.get("summary")) or ""}
allowed = self._session_start_components
# getattr: tests build the provider without initialize().
allowed = getattr(self, "_session_start_components", None)
parts, suppressed = [], []
for name, key, header in _CONTEXT_SECTIONS:
value = ctx.get(key, "")