The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(telemetry): count messaging-gateway slash commands in shared metrics
teknium1b8d3e49733a5
diff --git a/gateway/run_inbound.py b/gateway/run_inbound.pyindex 4fb6c2176d2..01fdfd59989 100644--- a/gateway/run_inbound.py+++ b/gateway/run_inbound.py@@ -1314,6 +1314,17 @@ class GatewayInboundMixin:logger.debug("FIFO orphan rescue pre-claim failed for %s", _quick_key, exc_info=True)return event, source, is_internal+ @staticmethod+ def _hm_count_slash_command(event: "MessageEvent") -> None:+ """Count a user-typed slash command once: a queued busy-path event re-enters+ ``_handle_message`` when drained, so the event carries the mark."""+ command = event.get_command()+ if not command or getattr(event, "_slash_command_counted", False):+ return+ event._slash_command_counted = True+ from hermes_cli.observability.shared_metrics_events import record_slash_command+ record_slash_command(command=command, surface="gateway")+async def _handle_message(self, event: MessageEvent) -> Optional[str]:"""Handle an incoming message from any platform: auth → command check → running-agentinterrupt → get/create session → build context → run agent → return response."""@@ -1322,6 +1333,8 @@ class GatewayInboundMixin:if _admitted is None:return Noneevent, source, is_internal = _admitted+ if not is_internal:+ self._hm_count_slash_command(event)# TERMINAL-DECLINE LATCH TEARDOWN. Deliberately placed AFTER admission,# not on the adapter's raw inbound: profile routing, the ignored-channel# guard, plugin hooks and user authorization all reject events above,