From 402286fcff119419fa159ee9f1d51b446eba40bd Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:51:54 -0700 Subject: [PATCH] fix(photon): tolerate SDK builds without the iMessage effect surface imessage.effect.message crashed the sidecar at import against SDK stubs/ builds lacking the effect surface (caught by the patch-failure health test). Optional-chain with {} fallback; /send-effect rejects cleanly instead. --- plugins/platforms/photon/sidecar/index.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/photon/sidecar/index.mjs b/plugins/platforms/photon/sidecar/index.mjs index 43c2c9b82d01..ee2620c5877f 100644 --- a/plugins/platforms/photon/sidecar/index.mjs +++ b/plugins/platforms/photon/sidecar/index.mjs @@ -278,7 +278,10 @@ const app = await Spectrum({ telemetry, }); -const MESSAGE_EFFECTS = imessage.effect.message; +// Effect-name → native effect id map. Optional chaining: an SDK build +// without the iMessage effect surface (or a test stub) must not crash the +// sidecar at import — /send-effect then rejects with "unsupported effect". +const MESSAGE_EFFECTS = imessage?.effect?.message || {}; // --------------------------------------------------------------------------- // Inbound: forward `app.messages` (gRPC stream) to the Python consumer.