mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-01 07:01:41 +00:00
fix: 4 small surgical bugs
Salvages #23302 by @Bartok9. Four independent one-area fixes: 1. kanban boards delete alias now hard-deletes (not archives) — the alias didn't carry --delete, so getattr(args, 'delete', False) returned False. Detect boards_action=='delete' explicitly. 2. Gateway auto-title failures no longer leak as user-visible warnings — debug-log only since they're not actionable. 3. Background process completion notification snaps truncation to the next newline boundary, prepends a marker when content is dropped. 4. _cprint() schedules the run_in_terminal coroutine via asyncio.ensure_future so output isn't silently dropped from background threads (fixes #23185 Bug A). Skips the double-print fallback that would fire for mock paths.
This commit is contained in:
parent
3a7ed7be08
commit
365da2d2df
3 changed files with 47 additions and 14 deletions
|
|
@ -13956,7 +13956,19 @@ class GatewayRunner:
|
|||
from tools.process_registry import process_registry as _pr_check
|
||||
if agent_notify and not _pr_check.is_completion_consumed(session_id):
|
||||
from tools.ansi_strip import strip_ansi
|
||||
_out = strip_ansi(session.output_buffer[-2000:]) if session.output_buffer else ""
|
||||
_raw = strip_ansi(session.output_buffer) if session.output_buffer else ""
|
||||
# Truncate at line boundaries so notifications never start
|
||||
# mid-line (fixes #23284). Keep the last ~2000 chars but
|
||||
# snap to the nearest preceding newline, then prepend a
|
||||
# truncation marker when output was cut.
|
||||
_LIMIT = 2000
|
||||
if len(_raw) > _LIMIT:
|
||||
_tail = _raw[-_LIMIT:]
|
||||
_nl = _tail.find("\n")
|
||||
_tail = _tail[_nl + 1:] if _nl != -1 else _tail
|
||||
_out = f"[… output truncated — showing last {len(_tail)} chars]\n{_tail}"
|
||||
else:
|
||||
_out = _raw
|
||||
synth_text = (
|
||||
f"[IMPORTANT: Background process {session_id} completed "
|
||||
f"(exit code {session.exit_code}).\n"
|
||||
|
|
@ -16156,13 +16168,16 @@ class GatewayRunner:
|
|||
try:
|
||||
from agent.title_generator import maybe_auto_title
|
||||
all_msgs = result_holder[0].get("messages", []) if result_holder[0] else []
|
||||
# Route title-generation failures through the agent's
|
||||
# user-visible warning channel so a depleted auxiliary
|
||||
# provider doesn't silently leave sessions untitled
|
||||
# (issue #15775).
|
||||
_title_failure_cb = getattr(
|
||||
agent, "_emit_auxiliary_failure", None
|
||||
)
|
||||
# In Gateway mode, auto-title failures must NOT be
|
||||
# surfaced as user-visible messages (fixes #23246).
|
||||
# Log them at debug level only — they are not actionable
|
||||
# to the end user. CLI mode keeps the existing behaviour
|
||||
# via the agent's _emit_auxiliary_failure path.
|
||||
def _title_failure_cb(task: str, exc: BaseException) -> None:
|
||||
logger.debug(
|
||||
"Gateway auto-title failure suppressed (not user-visible): %s: %s",
|
||||
task, exc,
|
||||
)
|
||||
maybe_auto_title_kwargs = {
|
||||
"failure_callback": _title_failure_cb,
|
||||
"main_runtime": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue