Review round on #148903 (Greptile 4467193888..4467194077): - Bot Mode gate (agent/bot_chain.py, tools/bot_mode_dm_chain.py) runs once per message_agent call before any transport, on #144789's code. Recipients are keyed by the author id their turns carry (bot:default for @hermes, bot:<conn>/<profile> for relay rows, the peer's bot:<host>/<profile> or peer:<name>/<agent>). - Every call inside a bot-authored turn is one more hop; a person's turn sends at 1. - A definite no-send (offline relay target, refused admission) releases its ask and hop; queued/ambiguous keep them. - A reply to the turn's sender reuses #144789's notify-only path (marker + wake="none"); the receiver reads the marker from the text, so it survives the Desktop relay, which rebuilds the author. The parallel expects_reply author field is gone. - Forks (_turn_origin) neither reset nor advance the chain; the chain is bound after compression recovery and follows a session id change (rotation carry and per-agent rebinding). - gateway.bot_loop_guard.enabled: false switches the Bot Mode rules off too. - Gateway: gateway/bot_peer_notices.automatic_notices_allowed is the one policy at every runtime-notice egress (platform notices incl. delegation failure, inactivity warning, hygiene, background failure, approval timeout, command acks, context-ref refusals, STT echo, status/progress lanes). - A bot may end in silence even when it addressed us (reply_expected=True). - reply_to_reply keys on a reply this bot DELIVERED (note_reply), not on admission. - Tests split by owner: tests/agent/test_bot_chain.py, tests/tools/test_bot_mode_dm_chain.py, gateway ingress stays; config keys covered through the real config.yaml loader. Each finding's test fails with its guard removed (mutant run).
22 lines
1.2 KiB
Python
22 lines
1.2 KiB
Python
"""Carry automation at a compression boundary without opening worker storage."""
|
|
|
|
|
|
def carry_compression_automation(agent, old_session_id):
|
|
# In-process state, not a sidecar: the bot-to-bot chain moves on every store (#137027).
|
|
from agent.bot_chain import carry_chain
|
|
carry_chain(old_session_id, agent.session_id)
|
|
from agent.runtime_session_store import RuntimeSessionStore
|
|
if isinstance(agent._session_db, RuntimeSessionStore):
|
|
# The owner moved these exact sidecars atomically with child publication.
|
|
return
|
|
from agent.conversation_compression import _swallow
|
|
with _swallow('Could not migrate goal on compression: %s'):
|
|
from hermes_cli.goals import migrate_goal_to_session
|
|
migrate_goal_to_session(old_session_id, agent.session_id, reason='compression')
|
|
with _swallow('Could not migrate heartbeat on compression: %s'):
|
|
from hermes_cli.heartbeat import migrate_heartbeat_to_session
|
|
migrate_heartbeat_to_session(old_session_id, agent.session_id)
|
|
with _swallow('Could not migrate loop on compression: %s'):
|
|
from hermes_cli.loops import migrate_loop_to_session
|
|
migrate_loop_to_session(old_session_id, agent.session_id, reason='compression')
|