Files
hermes-agent/tests
alt-glitch 96aa40a49f fix(gateway): launchd gateway stdout lines are timestamped
Under launchd the plist shell appends the gateway's stdout to gateway.log
(hermes_cli/gateway_launchd.py:237,367), the same file the gateway logging
handler writes (hermes_logging.py:371). print() output such as the WhatsApp
"Bridge started on port" line therefore landed there with no timestamp, and
`hermes logs gateway --since` kept those lines because it cannot date them.

stderr_timestamp already sits between launchd and the gateway and stamps
stderr into gateway.error.log. It now also pipes the child's stdout and writes
each line, stamped in the same asctime shape, to its own stdout. The file
targets, the plist and the detached fallback (gateway_launchd.py:296-299) are
unchanged, so installed plists pick this up without a reinstall. Lines that
already start with a stamp pass through unchanged.

The stdout reader is a daemon thread. After the child exits the wrapper waits
at most 5 s for it, so a grandchild that inherited stdout cannot keep the
launchd job alive past the gateway's exit; the exit-code mapping is unchanged.
The wrapper stays stdlib-only.
2026-09-28 18:43:12 +05:30
..
…