fix: stop leaking '(No response generated)' placeholder to users and cron targets

When the LLM returns an empty completion, gateway/run.py replaced
final_response with the literal string '(No response generated)'.
This defeated cron/scheduler.py's empty-response skip guard, causing
the placeholder to be delivered to home channels.

Changes:
- gateway/run.py: return empty string instead of placeholder when
  there is no error and no response content
- cron/scheduler.py: defensively strip the placeholder text in case
  any upstream path still produces it

Fixes NousResearch/hermes-agent#9270
This commit is contained in:
Mil Wang (from Dev Box)
2026-04-14 09:17:52 +08:00
committed by Teknium
parent 85752791ed
commit f9714161f0
2 changed files with 4 additions and 1 deletions

View File

@@ -8886,7 +8886,7 @@ class GatewayRunner:
_resolved_model = getattr(_agent, "model", None) if _agent else None
if not final_response:
error_msg = f"⚠️ {result['error']}" if result.get("error") else "(No response generated)"
error_msg = f"⚠️ {result['error']}" if result.get("error") else ""
return {
"final_response": error_msg,
"messages": result.get("messages", []),