hermes-agent/gateway
kshitij 48c233d503 fix(gateway): offload remaining atomic_json_write calls in async paths
Completes the bug class from #83906 — the same blocking fsync-on-event-loop
pattern existed in two more async gateway paths:

- slash_commands.py _handle_restart_command: two atomic_json_write calls
  for .restart_notify.json and .restart_last_processed.json were blocking
  on fsync inside an async function. Now offloaded via asyncio.to_thread.

- run.py _clear_restart_failure_count: called from
  _handle_message_with_agent (async, per-turn path) after a successful
  agent turn. Made the method async and offloaded the atomic_json_write
  call via asyncio.to_thread. Caller updated to await.

Shutdown-path calls in _stop_impl_body (_increment_restart_failure_counts,
planned restart notification marker) are intentionally left synchronous —
the event loop is draining/stopping and offloading adds complexity for no
benefit.
2026-08-11 20:37:06 +05:30
..
assets
…
builtin_hooks
…
platforms feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
relay fix(gateway,relay): stop frozen-preview finals and dropped idle-session delegation callbacks (#82592) 2026-08-11 09:56:13 +10:00
__init__.py
…
agent_cache_pressure.py
…
authz_mixin.py
…
cgroup_cleanup.py
…
channel_directory.py fix(gateway): run channel-directory write off the event loop 2026-08-11 20:37:06 +05:30
code_skew.py
…
config.py feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
cwd_placeholder.py
…
dead_targets.py
…
delivery.py
…
delivery_ledger.py
…
display_config.py
…
drain_control.py
…
hooks.py
…
kanban_watchers.py fix: complete kanban review lifecycle 2026-08-10 12:43:46 -07:00
lifecycle_ledger.py
…
memory_monitor.py
…
message_timestamps.py
…
mirror.py
…
pairing.py
…
platform_registry.py
…
profile_routing.py feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
readiness.py
…
response_filters.py
…
restart.py
…
restart_loop_guard.py fix(gateway): make the restart-loop breaker see slow crash cycles (#81642) 2026-08-09 21:40:23 +05:30
rich_sent_store.py
…
run.py fix(gateway): offload remaining atomic_json_write calls in async paths 2026-08-11 20:37:06 +05:30
runtime_footer.py
…
scale_to_zero.py
…
session.py feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
session_context.py fix(gateway,relay): stop frozen-preview finals and dropped idle-session delegation callbacks (#82592) 2026-08-11 09:56:13 +10:00
session_stall.py
…
session_state.py
…
shutdown_flush.py fix(gateway): spool cap-dropped pending transcript messages instead of discarding 2026-08-09 14:08:51 -07:00
shutdown_forensics.py
…
shutdown_watchdog.py
…
slash_access.py
…
slash_commands.py fix(gateway): offload remaining atomic_json_write calls in async paths 2026-08-11 20:37:06 +05:30
status.py
…
status_phrases.py
…
sticker_cache.py
…
stream_consumer.py fix(gateway,relay): stop frozen-preview finals and dropped idle-session delegation callbacks (#82592) 2026-08-11 09:56:13 +10:00
stream_dispatch.py
…
stream_events.py
…
streaming_tts_consumer.py
…
systemd_notify.py
…
turn_context.py
…
turn_lease.py
…
wake.py
…
whatsapp_identity.py
…