Bug Description
After successful tool calls, Hermes sometimes emits no assistant response at all in CLI chats. The terminal logs show retries with Model returned empty after tool calls, followed by an internal exception:
cannot access local variable 'assistant_msg' where it is not associated with a value
From the user perspective, the agent appears to go silent mid-task even though the tools actually ran.
Steps to Reproduce
- Use Hermes in CLI chat mode with an OpenAI-compatible provider/model (observed on
gpt-5.4 via custom provider).
- Run a multi-step task that includes several tool calls and then needs a natural-language wrap-up.
- Observe that tools succeed, but Hermes occasionally returns an empty final response.
- Hermes retries automatically, then still returns no content.
Expected Behavior
After tool calls complete, Hermes should always produce either:
- a normal assistant message, or
- a clear structured error message
It should not silently drop the reply or reference an uninitialized assistant_msg variable.
Actual Behavior
Observed log/output:
Model returned empty after tool calls — nudging to continue
Error during OpenAI-compatible API call #1: cannot access local variable 'assistant_msg' where it is not associated with a value
Empty response from model — retrying (1/3)
Empty response from model — retrying (2/3)
Empty response from model — retrying (3/3)
Model returned no content after all retries. No fallback providers configured.
Why this seems like a Hermes bug
- Tool calls did execute successfully.
- Failure happens when Hermes is trying to assemble/send the assistant reply after tool execution.
- The error strongly suggests a response-construction code path where
assistant_msg is referenced before assignment.
Environment
- Platform: Hermes CLI
- Model:
gpt-5.4
- Provider: custom OpenAI-compatible provider
- Session type: normal chat with developer tools/tool calls
- Date observed: 2026-04-29
Notes
A related symptom is that the agent may appear to "freeze" or "stop talking" mid-task, but the actual root issue seems to be empty-response handling after tool calls rather than tool execution itself.
Bug Description
After successful tool calls, Hermes sometimes emits no assistant response at all in CLI chats. The terminal logs show retries with
Model returned empty after tool calls, followed by an internal exception:cannot access local variable 'assistant_msg' where it is not associated with a valueFrom the user perspective, the agent appears to go silent mid-task even though the tools actually ran.
Steps to Reproduce
gpt-5.4via custom provider).Expected Behavior
After tool calls complete, Hermes should always produce either:
It should not silently drop the reply or reference an uninitialized
assistant_msgvariable.Actual Behavior
Observed log/output:
Why this seems like a Hermes bug
assistant_msgis referenced before assignment.Environment
gpt-5.4Notes
A related symptom is that the agent may appear to "freeze" or "stop talking" mid-task, but the actual root issue seems to be empty-response handling after tool calls rather than tool execution itself.