Files
hermes-agent/tools
Teknium b653bb32b9 fix(bot-dm): report a missing Bot Chat owner as a definite, resendable refusal
_admit_live_dm raised a bare ValueError when find_canonical_live_owner
returned None (or discovery raised "profile authority is not ready"), and both
callers (_start_delivery and the --run-delivery runner) turned every exception
into status "ambiguous" + "Do not resend". That lookup runs BEFORE the
.live.json intent is pinned and before any authority call, so nothing can have
been admitted: it is a definite no-send, and telling the sender not to resend
loses the DM.

Owner discovery failures now raise LiveTargetUnavailableError, which both
callers report as {"reason": "runtime_unavailable", "delivery_id", "error":
"... NOT sent; safe to resend ..."} (the same typed refusal the runner already
uses when no authority home resolves). _start_delivery drops the DM file since
no intent references it. Failures after the intent is pinned keep the
ambiguous do-not-resend contract.

The existing test_unavailable_authority_is_reported_never_worked_around pinned
the ambiguous wording for this exact pre-intent case; it now asserts the
definite refusal (and no intent file) for both the not-ready and no-owner
lookups, keeping its "no CLI / no runner started" guards.

Red/green: that test fails on r6-base tools/bot_mode_dm.py for both params and
passes here. Probe (fake HOME, profile without state.db): send returned
{"status": "ambiguous", ... "Do not resend."} -> {"reason":
"runtime_unavailable", ... "NOT sent; it is safe to resend ..."}, no intent.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:31 -07:00
..