devpulse watchdog: banner off stdout -> stderr, kills the spurious arm-time wake (VERA feedback 315c005e, #693 follow-on). The 'invoke via Monitor tool' reminder printed via console.print to STDOUT at arm time; the Monitor tool treats every stdout line as a wake event -> every armed watchdog double-fired (spurious wake at ~0s, real wake at completion). Hit EVERYONE: my night-shift telegram logs show me repeatedly dismissing 'the known invoke-via-Monitor noise banners' instead of fixing them; VERA, cold, got woken with no completion attached. Fix: route via err_console (Monitor ignores stderr; stdout = completion/stall events only per the #634 contract; error() stays wrong -> #661 exit-code fail-flag). Verified live: watchdog agent @spawn -> stdout carries ONLY the completion result, banner+debug on stderr. 142 watchdog tests pass, ruff clean.

This commit is contained in:
AIOSAI
2026-07-11 21:04:03 -07:00
parent 90048069d0
commit b206832209
+7 -4
View File
@@ -28,7 +28,7 @@ import importlib
from typing import List
from aipass.prax.apps.modules.logger import system_logger as logger
from aipass.cli.apps.modules import console, error, warning
from aipass.cli.apps.modules import console, err_console, error, warning
from aipass.devpulse.apps.handlers.json import json_handler
_VALID_SUBCOMMANDS = ["agent", "timer", "schedule", "status", "cancel", "list"]
@@ -333,9 +333,12 @@ def _handle_agent(sub_args: List[str]) -> bool:
# Reminder, not an error: this call blocks until the agent exits, so it must
# run via the Monitor tool (not run_in_background) for the wake to fire on
# completion. Route through console — error() would print ❌ and trip the
# exit-code fail-flag on an otherwise-successful watch (#661 output_routing).
console.print("[dim]watchdog agent: invoke via Monitor tool, not run_in_background[/dim]")
# completion. MUST go to stderr: the Monitor tool treats every STDOUT line
# as a wake event, so a stdout banner fires a spurious wake at arm time —
# stdout carries completion/stall events only (#634 contract; VERA feedback
# 315c005e). error() is also wrong — ❌ trips the exit-code fail-flag on an
# otherwise-successful watch (#661 output_routing).
err_console.print("[dim]watchdog agent: invoke via Monitor tool, not run_in_background[/dim]")
timeout = _DEFAULT_AGENT_TIMEOUT
positional: List[str] = []