fix: return "deny" on approval callback timeout instead of None

_approval_callback() had no return statement after the timeout break,
causing it to return None. Callers expect a string ("once", "session",
"always", or "deny"), so None could lead to undefined behavior when
approving dangerous commands.
This commit is contained in:
0xbyt4 2026-03-07 19:30:00 +03:00
parent 41877183bc
commit 70cffa4d3b

2
cli.py
View file

@ -2245,6 +2245,8 @@ class HermesCLI:
self._approval_state = None self._approval_state = None
self._approval_deadline = 0 self._approval_deadline = 0
self._invalidate() self._invalidate()
return "deny"
def chat(self, message, images: list = None) -> Optional[str]: def chat(self, message, images: list = None) -> Optional[str]:
""" """
Send a message to the agent and get a response. Send a message to the agent and get a response.