The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(hermes_cli): fold overlay-drain try/except repeats into one local helper
Teknium9662be030c8f
diff --git a/hermes_cli/cli_modal_mixin.py b/hermes_cli/cli_modal_mixin.pyindex 14e34458bdf..c874afb8771 100644--- a/hermes_cli/cli_modal_mixin.py+++ b/hermes_cli/cli_modal_mixin.py@@ -882,26 +882,22 @@ class CLIModalMixin:(approval -> "deny", clarify/sudo/secret -> cancel), nil the state, restore the draft.Each step is wrapped so a dead queue can't prevent clearing the others."""- if self._approval_state:+ def _put(state, value) -> None:try:- self._approval_state["response_queue"].put("deny")+ state["response_queue"].put(value)except Exception:pass++ if self._approval_state:+ _put(self._approval_state, "deny")self._approval_state = Noneif self._clarify_state:- try:- self._clarify_state["response_queue"].put(- "The user cancelled. Use your best judgement to proceed.")- except Exception:- pass+ _put(self._clarify_state, "The user cancelled. Use your best judgement to proceed.")self._clarify_state = Noneself._clarify_freetext = Falseself._clarify_multi_base = Noneif self._sudo_state:- try:- self._sudo_state["response_queue"].put("")- except Exception:- pass+ _put(self._sudo_state, "")self._sudo_state = Noneself._sudo_deadline = 0self._restore_modal_input_snapshot()