instrument(conversation): enrich empty-response WARN with response-shape diagnostics (#67 partial)#68
Merged
Conversation
…ape diagnostics (hermes-agent#67 partial)
This was referenced May 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial close of #67 — diagnostic visibility, not the root-cause fix.
Summary
_diagnose_empty_response(...)near the top ofagent/conversation_loop.pythat extracts response-shape context from any provider's assistant_message object.provider,finish_reason,tool_calls_count,response_len,prior_was_tool,response_id.Why
The user reports
Empty response from model — retrying (1/3)from polynomial-explorer worker across THREE providers (claude-cli, openai, silo-mistral). That universality rules out provider-specific bugs and points at something common in the request/response pipeline. The existing WARN line only says(model=%s)— not enough to distinguish:content="" + tool_calls=[…](tool-call response that the empty detector mis-flags)finish_reason="length"(response truncated; bigger context needed)prior_was_tool(model returning empty after tool result — different recovery path)response_idmatches a known bad batch)After this lands, the operator's next failing worker turn produces a log line carrying all of that, so we can root-cause without speculative patches.
Test plan
tests/agent/test_empty_response_diagnostic.pycover the helper in isolation:"?""?"(distinguished from absent → 0)providerattr → sentinel"?"prior_was_toolpropagationtool_calls=[…] + content=""(the Bug: devagentic-local provider returns empty content; raw API works #67 hypothesis)Not in this PR
Root cause of the empty-content failure itself — still pending the operator's devbox-side checklist results (see comment on #67). This PR makes that root-causing data-driven instead of speculative.
Notes
"?"sentinel so the log line always formats cleanly. The distinction between"?"(couldn't determine) and0(definitely absent) is preserved — useful when diagnosing whether a weird provider object is involved.