mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
fix: tighten quiet-mode salvage follow-ups
Follow-up for the helix4u easy-fix salvage batch: - route remaining context-engine quiet-mode output through _should_emit_quiet_tool_messages() so non-CLI/library callers stay silent consistently - drop the extra senderAliases computation from WhatsApp allowlist-drop logging and remove the now-unused import This keeps the batch scoped to the intended fixes while avoiding leaked quiet-mode output and unnecessary duplicate work in the bridge.
This commit is contained in:
parent
cd59af17cc
commit
175cf7e6bb
2 changed files with 5 additions and 13 deletions
15
run_agent.py
15
run_agent.py
|
|
@ -8325,7 +8325,7 @@ class AIAgent:
|
||||||
elif self._context_engine_tool_names and function_name in self._context_engine_tool_names:
|
elif self._context_engine_tool_names and function_name in self._context_engine_tool_names:
|
||||||
# Context engine tools (lcm_grep, lcm_describe, lcm_expand, etc.)
|
# Context engine tools (lcm_grep, lcm_describe, lcm_expand, etc.)
|
||||||
spinner = None
|
spinner = None
|
||||||
if self.quiet_mode and not self.tool_progress_callback:
|
if self._should_emit_quiet_tool_messages():
|
||||||
face = random.choice(KawaiiSpinner.get_waiting_faces())
|
face = random.choice(KawaiiSpinner.get_waiting_faces())
|
||||||
emoji = _get_tool_emoji(function_name)
|
emoji = _get_tool_emoji(function_name)
|
||||||
preview = _build_tool_preview(function_name, function_args) or function_name
|
preview = _build_tool_preview(function_name, function_args) or function_name
|
||||||
|
|
@ -8343,7 +8343,7 @@ class AIAgent:
|
||||||
cute_msg = _get_cute_tool_message_impl(function_name, function_args, tool_duration, result=_ce_result)
|
cute_msg = _get_cute_tool_message_impl(function_name, function_args, tool_duration, result=_ce_result)
|
||||||
if spinner:
|
if spinner:
|
||||||
spinner.stop(cute_msg)
|
spinner.stop(cute_msg)
|
||||||
elif self.quiet_mode:
|
elif self._should_emit_quiet_tool_messages():
|
||||||
self._vprint(f" {cute_msg}")
|
self._vprint(f" {cute_msg}")
|
||||||
elif self._memory_manager and self._memory_manager.has_tool(function_name):
|
elif self._memory_manager and self._memory_manager.has_tool(function_name):
|
||||||
# Memory provider tools (hindsight_retain, honcho_search, etc.)
|
# Memory provider tools (hindsight_retain, honcho_search, etc.)
|
||||||
|
|
@ -11187,17 +11187,10 @@ class AIAgent:
|
||||||
self._last_content_tools_all_housekeeping = _all_housekeeping
|
self._last_content_tools_all_housekeeping = _all_housekeeping
|
||||||
if _all_housekeeping and self._has_stream_consumers():
|
if _all_housekeeping and self._has_stream_consumers():
|
||||||
self._mute_post_response = True
|
self._mute_post_response = True
|
||||||
elif self.quiet_mode and getattr(self, "platform", "") == "cli":
|
elif self._should_emit_quiet_tool_messages():
|
||||||
clean = self._strip_think_blocks(turn_content).strip()
|
clean = self._strip_think_blocks(turn_content).strip()
|
||||||
if clean:
|
if clean:
|
||||||
relayed = False
|
self._vprint(f" ┊ 💬 {clean}")
|
||||||
if (
|
|
||||||
self.tool_progress_callback
|
|
||||||
and getattr(self, "platform", "") == "tui"
|
|
||||||
):
|
|
||||||
relayed = True
|
|
||||||
if not relayed:
|
|
||||||
self._vprint(f" ┊ 💬 {clean}")
|
|
||||||
|
|
||||||
# Pop thinking-only prefill message(s) before appending
|
# Pop thinking-only prefill message(s) before appending
|
||||||
# (tool-call path — same rationale as the final-response path).
|
# (tool-call path — same rationale as the final-response path).
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import path from 'path';
|
||||||
import { mkdirSync, readFileSync, writeFileSync, existsSync, readdirSync } from 'fs';
|
import { mkdirSync, readFileSync, writeFileSync, existsSync, readdirSync } from 'fs';
|
||||||
import { randomBytes } from 'crypto';
|
import { randomBytes } from 'crypto';
|
||||||
import qrcode from 'qrcode-terminal';
|
import qrcode from 'qrcode-terminal';
|
||||||
import { expandWhatsAppIdentifiers, matchesAllowedUser, parseAllowedUsers } from './allowlist.js';
|
import { matchesAllowedUser, parseAllowedUsers } from './allowlist.js';
|
||||||
|
|
||||||
// Parse CLI args
|
// Parse CLI args
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
|
|
@ -235,7 +235,6 @@ async function startSocket() {
|
||||||
reason: 'allowlist_mismatch',
|
reason: 'allowlist_mismatch',
|
||||||
chatId,
|
chatId,
|
||||||
senderId,
|
senderId,
|
||||||
senderAliases: Array.from(expandWhatsAppIdentifiers(senderId, SESSION_DIR)),
|
|
||||||
}));
|
}));
|
||||||
} catch {}
|
} catch {}
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue