fix(photon): harden iMessage outbound recovery - #51075
mattshapsss wants to merge 3 commits into
Conversation
|
Cherry-picked this locally on top of the current Photon stack ( Local validation passed: Best-practice note from dogfooding: bounded retry is the right shape here, but keeping permanent auth/config failures distinct from transient stream/reconnect failures is important. During today’s incident we saw both |
4462a40 to
9dd306c
Compare
|
Thanks — I pushed an updated version that incorporates this distinction directly. The sidecar now returns sanitized Also rebased onto current |
|
Follow-up dogfood found one more real break: inbound iPhone screenshots arrived as HEIC and the model provider rejected them as invalid image data. I pushed another commit that transcodes Photon inbound HEIC/HEIF attachments to JPEG via macOS Validation now: 7 Photon tests pass; the actual cached HEIC from the failed iMessage converts to JPEG locally; after gateway reload, an inbound Photon text probe reached the model and Hermes replied |
08e72f2 to
3a35ea1
Compare
|
Thanks for the detailed recovery work. The core outbound premise remains present on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
|
Closing — the salvageable pieces (generic-500-as-retryable classification) landed via #73563's structured error classes, and the zombie-stream detection via #73615. The Spectrum 5 dep/patch changes would conflict with main's required Spectrum-8 patch, and sync sips HEIC conversion duplicates agent/image_routing. The DM get-before-create idea is noted for a follow-up. Thanks — parts of this PR shaped the final design. |
Summary
space.get()before falling back to phone-based create, so establishedany;-;+E164iMessage DMs stay sendable after sidecar restartspectrum-ts@5.2.0and makes the mixed-attachment patch script explicitly skip the newer inbound mapper instead of failing startup/installcode,retryable,error) so Hermes retries only classified transient Spectrum reconnect failures and does not spin on permanent auth/project-policy failureshermes sendinvalid imageprovider failuresTests
python -m pytest tests/gateway/test_photon_plugin.py -q -o 'addopts='→ 7 passedpython -m py_compile plugins/platforms/photon/adapter.py tests/gateway/test_photon_plugin.pycd plugins/platforms/photon/sidecar && node --check index.mjs && node --check patch-spectrum-mixed-attachments.mjs && node patch-spectrum-mixed-attachments.mjsgit diff --check origin/main...HEADLive dogfood verification
connectedhermes send --to photon --json ...returned real Spectrum message idsinbound message: platform=photon ... msg='Hermes inbound verification probe 19:55:48'.heicscreenshot, then verified that the same HEIC bytes now cache as JPEG locallyprovider okRisk
Medium: Photon/iMessage sidecar dependency, outbound error semantics, and macOS-only HEIC conversion via
sips. Retry behavior remains bounded; permanent auth/project-policy failures are now surfaced as non-retryable instead of being retried as generic sidecar 500s. If HEIC conversion is unavailable, the attachment falls back to document caching rather than being dropped.