fix(tools,gateway): format watch_overflow events instead of dropping them
format_process_notification had no case for watch_overflow_tripped / watch_overflow_released, so a watch-pattern notification flood surfaced as '[IMPORTANT: Background process exited (exit code ?)]' — a phantom exit notification for a process that never existed — while the actual 'watch flood, N notifications suppressed' summary in the event's message field was silently dropped. The gateway delivery path was worse: _drain_gateway_watch_events retained only watch_match and watch_disabled, discarding overflow events entirely before formatting. Route both event types through the message field in the shared formatter and the gateway formatter, and retain them in the gateway drain.
This commit is contained in:
@@ -2812,6 +2812,12 @@ def format_process_notification(evt: dict) -> "str | None":
|
||||
if evt_type == "watch_disabled":
|
||||
return f"[IMPORTANT: {evt.get('message', '')}]"
|
||||
|
||||
# Overflow events carry their human-readable summary in `message` —
|
||||
# without this case they fall through to the completion formatter and
|
||||
# surface as a phantom "process exited (exit code ?)" notification.
|
||||
if evt_type in ("watch_overflow_tripped", "watch_overflow_released"):
|
||||
return f"[IMPORTANT: {evt.get('message', '')}]"
|
||||
|
||||
if evt_type == "watch_match":
|
||||
_pat = evt.get("pattern", "?")
|
||||
_out = evt.get("output", "")
|
||||
|
||||
Reference in New Issue
Block a user