mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: /stop command crash + UnboundLocalError in streaming media delivery
Two fixes: 1. CLI /stop command crashed with 'cannot import name get_registry' — the code imported a non-existent function. Fixed to use the actual process_registry singleton and list_sessions() method. (Reported in #2458 by haiyuzhong1980) 2. Streaming media delivery used undefined 'adapter' variable — our PR #2382 called _deliver_media_from_response(adapter=adapter) but 'adapter' wasn't guaranteed to be defined in that scope. Fixed to resolve via self.adapters.get(source.platform). (Reported in #2424 by 42-evey)
This commit is contained in:
parent
f84230527c
commit
f69c47d9ae
2 changed files with 8 additions and 7 deletions
7
cli.py
7
cli.py
|
|
@ -2328,10 +2328,9 @@ class HermesCLI:
|
|||
Inspired by OpenAI Codex's separation of interrupt (stop current turn)
|
||||
from /stop (clean up background processes). See openai/codex#14602.
|
||||
"""
|
||||
from tools.process_registry import get_registry
|
||||
from tools.process_registry import process_registry
|
||||
|
||||
registry = get_registry()
|
||||
processes = registry.list_processes()
|
||||
processes = process_registry.list_sessions()
|
||||
running = [p for p in processes if p.get("status") == "running"]
|
||||
|
||||
if not running:
|
||||
|
|
@ -2339,7 +2338,7 @@ class HermesCLI:
|
|||
return
|
||||
|
||||
print(f" Stopping {len(running)} background process(es)...")
|
||||
killed = registry.kill_all()
|
||||
killed = process_registry.kill_all()
|
||||
print(f" ✅ Stopped {killed} process(es).")
|
||||
|
||||
def _handle_paste_command(self):
|
||||
|
|
|
|||
|
|
@ -2317,9 +2317,11 @@ class GatewayRunner:
|
|||
# delivered without this.
|
||||
if agent_result.get("already_sent"):
|
||||
if response:
|
||||
await self._deliver_media_from_response(
|
||||
response, event, adapter,
|
||||
)
|
||||
_media_adapter = self.adapters.get(source.platform)
|
||||
if _media_adapter:
|
||||
await self._deliver_media_from_response(
|
||||
response, event, _media_adapter,
|
||||
)
|
||||
return None
|
||||
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue