fix(photon): recover degraded upstream stream - #51105
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
helix4u
marked this pull request as ready for review
June 22, 2026 23:55
Contributor
Author
|
this exists because the other was left as a draft. if the other PR is now ready for review and resolves the same things, this can be closed in favor of that. |
Contributor
|
it looks good to merge! thanks for helping us fix the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Recover Photon iMessage when the local sidecar is still alive but the upstream Spectrum inbound stream has degraded. The sidecar now tracks upstream stream health from Spectrum stream errors, exposes that state through
/healthz, and exits after sustained degradation so Hermes can restart the adapter instead of leaving inbound delivery silent.The gateway also queues retryable runtime adapter failures for immediate reconnect rather than waiting for the idle reconnect watcher sleep.
Related Issue
No GitHub issue for the support report. Related Discord support thread: https://discord.com/channels/1053877538025386074/1518762066289361018
Related open draft PR reviewed while scoping this: #50974
Type of Change
Changes Made
plugins/platforms/photon/sidecar/index.mjs: track upstream stream state, expose it from/healthz, and exit after sustained degraded stream state so the adapter can be restarted.plugins/platforms/photon/adapter.py: poll sidecar stream health and promote degraded upstream stream state into a retryable fatal adapter error.gateway/run.py: reconnect retryable runtime adapter failures immediately instead of waiting for the startup retry delay / idle watcher sleep./healthzstream state, and immediate runtime reconnect scheduling.How to Test
node --check plugins/platforms/photon/sidecar/index.mjsvenv/bin/python -m py_compile plugins/platforms/photon/adapter.py gateway/run.pyvenv/bin/python -m pytest tests/plugins/platforms/photon/test_overflow_recovery.py tests/plugins/platforms/photon/test_spectrum_patch.py tests/gateway/test_platform_reconnect.py -qgit diff --check -- gateway/run.py plugins/platforms/photon/adapter.py plugins/platforms/photon/sidecar/index.mjs tests/plugins/platforms/photon/test_overflow_recovery.py tests/plugins/platforms/photon/test_spectrum_patch.py tests/gateway/test_platform_reconnect.pyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Focused validation:
node --check plugins/platforms/photon/sidecar/index.mjsvenv/bin/python -m py_compile plugins/platforms/photon/adapter.py gateway/run.pyvenv/bin/python -m pytest tests/plugins/platforms/photon/test_overflow_recovery.py tests/plugins/platforms/photon/test_spectrum_patch.py tests/gateway/test_platform_reconnect.py -q46 passed, 2 warningsgit diff --check -- gateway/run.py plugins/platforms/photon/adapter.py plugins/platforms/photon/sidecar/index.mjs tests/plugins/platforms/photon/test_overflow_recovery.py tests/plugins/platforms/photon/test_spectrum_patch.py tests/gateway/test_platform_reconnect.py