hermes-agent/tests/plugins/platforms/photon
Teknium dcace573da fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics
Maintainer rework of #45580 (issue #54036) on top of the contributor's
cherry-pick, which targeted spectrum-ts 3.1.0 while main pins 8.0.0:

Sidecar (primary detection, new):
- stream-staleness.mjs: pure decision rules, executable under node.
  * classifyProbeRejection: only a not-found-shaped rejection of the
    synthetic-id read counts as a completed round-trip (ALIVE); any other
    rejection is INCONCLUSIVE — never alive. The original /probe treated
    ANY rejection as alive, which was too loose.
  * shouldProbe: probe only after 10+ min of stream silence (configurable
    via PHOTON_STREAM_SILENCE_PROBE_MS; <=0 disables) with a cooldown.
  * isZombieSuspect: zombie only on silence past threshold AND a
    probe-proven live channel. Silence alone NEVER degrades (shared lines
    can be quiet for hours); inconclusive probes NEVER degrade (network
    may be down — the iterator will throw and the re-subscribe loop
    recovers on its own).
- index.mjs: track last inbound-iterator yield (noteInboundYield), run a
  30s watchdog tick, and on a confirmed zombie feed markStreamDegraded ->
  the existing exit-75 restart path. /healthz gains a stream.staleness
  block (silentForMs, threshold, lastProbeOutcome, zombieSuspected).
  /probe reworked to strict semantics: 200 only on a proven round-trip,
  503 with outcome hung|inconclusive otherwise.

Adapter (second layer, reworked):
- _probe_once returns tri-state alive|hung|inconclusive; only a hung
  sidecar HTTP call counts toward the respawn counter — inconclusive
  resets nothing and triggers nothing.
- default probe_interval_seconds 60 -> 600 (conservative; avoid restart
  storms on quiet lines).
- _monitor_sidecar_health surfaces zombieSuspected from /healthz as a
  warning; the fatal UPSTREAM_STREAM_DEGRADED path is unchanged and fires
  when the sidecar escalates.

Tests: test_zombie_stream_watchdog.py executes the real node decision
module and drives the adapter against mocked /healthz responses;
test_presence_watchdog.py updated for the tri-state probe.

Also adds contributor mappings for nickkarhan (#53283) and vaibhavjnf
(#45580).
2026-07-28 22:22:42 -07:00
..
test_auth.py test(photon): allow auth.lock sentinel in temp-file leak assertions 2026-07-28 18:20:06 -07:00
test_check_requirements_risks.py fix(photon): unify sidecar-deps check, harden log unlink and truncation 2026-07-28 18:20:06 -07:00
test_fatal_notify_self_cancel.py fix(photon): dispatch fatal-error notification from a detached task 2026-07-28 21:45:52 -07:00
test_inbound.py fix(photon): ignore iMessage media placeholders 2026-07-28 18:17:52 -07:00
test_markdown.py feat(photon): upgrade to spectrum-ts 3.0.0 (pinned) with markdown + reactions 2026-06-12 01:07:38 -07:00
test_mention_gating.py feat(photon): gRPC-native iMessage channel (no webhook) 2026-06-08 21:03:58 -07:00
test_npm_error_log_regression.py fix(photon): unify sidecar-deps check, harden log unlink and truncation 2026-07-28 18:20:06 -07:00
test_outbound_media.py feat(photon): add native message effects 2026-07-28 22:10:57 -07:00
test_overflow_recovery.py test(photon): fix PlatformConfig kwargs in target_not_allowed standalone test 2026-07-28 21:45:52 -07:00
test_poll_clarify.py feat(photon): render multiple-choice clarify as a native iMessage poll 2026-07-28 22:10:57 -07:00
test_presence_watchdog.py fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics 2026-07-28 22:22:42 -07:00
test_reactions.py fix(photon): correlate tapbacks to bot message context 2026-06-27 00:51:34 -07:00
test_rich_links.py feat(photon): support rich link previews 2026-07-28 22:10:57 -07:00
test_runtime_record.py fix(photon): un-shadow the U+FFFC deferred-wait handler; fix stale sidecar-deps fixture 2026-07-28 21:28:25 -07:00
test_setup_access.py test(photon): stub token validation in setup tests to avoid network 2026-07-28 18:20:06 -07:00
test_sidecar_deps_stale.py fix(photon): auto-reinstall stale sidecar deps before start 2026-07-05 17:38:32 -07:00
test_sidecar_lifecycle.py fix(photon): run the Spectrum patch spawn off the gateway event loop 2026-07-28 21:45:52 -07:00
test_spectrum_patch.py feat(photon): support rich link previews 2026-07-28 22:10:57 -07:00
test_streaming.py fix(photon): mark adapter as not supporting message editing to suppress streaming cursor 2026-07-28 18:17:52 -07:00
test_url_send_path.py test(photon): replace source-grep URL-routing tests with behavior tests 2026-07-28 22:22:42 -07:00
test_zombie_stream_watchdog.py fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics 2026-07-28 22:22:42 -07:00