From c28c43470616a689a61243e889eb004d73aedc52 Mon Sep 17 00:00:00 2001 From: Erosika Date: Mon, 10 Aug 2026 19:12:52 -0400 Subject: [PATCH] fix(honcho): surface honcho_reasoning backend failures instead of 'No result' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dialectic_query collapsed every backend failure to an empty string, so the explicit honcho_reasoning tool rendered timeouts, server errors, and genuinely-empty answers identically as 'No result from Honcho.' (#36098 issue 4). Operators debugging 'search works but reasoning does not' were sent down representation/observation rabbit holes when the real cause was a 30s timeout on a medium-reasoning dialectic call. Add raise_errors to dialectic_query (default false — automatic injection keeps its fail-quiet behavior and cadence backoff) and pass it from the explicit tool call, returning a tool error that names the failure and points at the timeout knob. Auth errors keep their dedicated handler. --- plugins/memory/honcho/__init__.py | 32 ++++++++++++++++++++++++------- plugins/memory/honcho/session.py | 8 ++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/plugins/memory/honcho/__init__.py b/plugins/memory/honcho/__init__.py index 8bf9676e57..331950e696 100644 --- a/plugins/memory/honcho/__init__.py +++ b/plugins/memory/honcho/__init__.py @@ -1527,13 +1527,31 @@ class HonchoMemoryProvider(MemoryProvider): return tool_error("Missing required parameter: query") peer = args.get("peer", "user") reasoning_level = args.get("reasoning_level") - result = self._manager.dialectic_query( - self._session_key, query, - reasoning_level=reasoning_level, - peer=peer, - # Explicit reasoning bypasses the automatic-injection cap. - apply_injection_cap=False, - ) + try: + result = self._manager.dialectic_query( + self._session_key, query, + reasoning_level=reasoning_level, + peer=peer, + # Explicit reasoning bypasses the automatic-injection cap. + apply_injection_cap=False, + # Explicit tool call: surface timeouts/server errors as + # errors instead of collapsing them into "no result", + # which is indistinguishable from an empty answer. + raise_errors=True, + ) + except HonchoAuthError: + # Let the outer dispatch's auth-specific handler render this. + raise + except Exception as e: + logger.warning("honcho_reasoning failed: %s", e) + return tool_error( + f"Honcho reasoning query failed ({e}). This is a backend " + "error, not an empty result — the peer may still have " + "relevant context. Slow dialectic calls at higher " + "reasoning levels can exceed the configured timeout; " + "consider a lower reasoning_level or raising the " + "'timeout' value in honcho.json." + ) # Update cadence tracker so auto-injection respects the gap after an explicit call self._last_dialectic_turn = self._turn_count return json.dumps({"result": result or "No result from Honcho."}) diff --git a/plugins/memory/honcho/session.py b/plugins/memory/honcho/session.py index efaa986333..3944c960cc 100644 --- a/plugins/memory/honcho/session.py +++ b/plugins/memory/honcho/session.py @@ -844,6 +844,7 @@ class HonchoSessionManager: reasoning_level: str | None = None, peer: str = "user", apply_injection_cap: bool = True, + raise_errors: bool = False, ) -> str: """ Query Honcho's dialectic endpoint about a peer. @@ -862,6 +863,11 @@ class HonchoSessionManager: apply_injection_cap: Clip automatic injections to ``dialecticMaxChars``. Explicit ``honcho_reasoning`` calls pass False because Honcho already bounds their output. + raise_errors: Re-raise backend failures instead of returning "". + Explicit tool calls pass True so a timeout or server error + surfaces as an error, not as "no result" (#36098 issue 4: + collapsing failures to "" made auth errors, timeouts, and + genuinely-empty answers indistinguishable). Returns: Honcho's synthesized answer, or empty string on failure. @@ -917,6 +923,8 @@ class HonchoSessionManager: raise except Exception as e: logger.warning("Honcho dialectic query failed: %s", e) + if raise_errors: + raise return "" def prefetch_context(self, session_key: str, user_message: str | None = None) -> None: