From ceaa7880ee1a46f17218c1bafe770e81386e4ea4 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 28 Jul 2026 18:32:11 -0700 Subject: [PATCH] fix(photon): un-shadow the U+FFFC deferred-wait handler; fix stale sidecar-deps fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two independent cross-PR collisions red on main (slice 8/8): 1. fd4f756492 (salvaged from stale #54514) added an early 'drop U+FFFC placeholder' return at the top of _dispatch_inbound — written before the deferred-wait handler (6b91b50c6e/afab7ed46e) existed further down the same function. The early return shadowed it: _pending_fffc never populated, no attachment-timeout tracking, 4 tests red. Remove the duplicate block; the deferred handler already drops the placeholder AND tracks/cancels/warns. 2. 9cf2046081 tightened sidecar_deps_installed() to require node_modules/spectrum-ts, but test_runtime_record's _patch_spawn fixture still created only bare node_modules/ — 2 tests red. Mirror a real completed install. tests/plugins/platforms/photon: 164/164 after; 158/164 before. --- plugins/platforms/photon/adapter.py | 13 ------------- .../plugins/platforms/photon/test_runtime_record.py | 4 +++- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/plugins/platforms/photon/adapter.py b/plugins/platforms/photon/adapter.py index 60d74de41e2a..b73bff8d5fc7 100644 --- a/plugins/platforms/photon/adapter.py +++ b/plugins/platforms/photon/adapter.py @@ -875,19 +875,6 @@ class PhotonAdapter(BasePlatformAdapter): ) ctype = content.get("type") - if ctype == "text": - raw_text = content.get("text") or "" - # iMessage emits U+FFFC OBJECT REPLACEMENT CHARACTER as a transient - # placeholder for some media bubbles (notably voice notes). Photon - # can then deliver the real attachment/voice event immediately - # afterwards with a different message id. If we dispatch the - # placeholder as a standalone text turn, the subsequent media event - # arrives while that turn is active and the gateway sends a bogus - # "Interrupting current task" busy ack. Drop placeholder-only text - # at the platform boundary; the real media event carries the bytes. - if raw_text.strip() == "\ufffc": - logger.debug("[photon] ignoring iMessage object-placeholder text event") - return if ctype == "reaction": # Route only tapbacks on messages WE sent — those are implicitly # addressed to the bot (feishu precedent: synthetic text event). diff --git a/tests/plugins/platforms/photon/test_runtime_record.py b/tests/plugins/platforms/photon/test_runtime_record.py index 1b1e650cfc5e..931066e6eed4 100644 --- a/tests/plugins/platforms/photon/test_runtime_record.py +++ b/tests/plugins/platforms/photon/test_runtime_record.py @@ -120,7 +120,9 @@ def _patch_spawn( ) -> None: """Stub everything _start_sidecar touches before the healthz loop.""" sidecar_dir = tmp_path / "sidecar" - (sidecar_dir / "node_modules").mkdir(parents=True) + # sidecar_deps_installed() checks the dependency's own directory, not just + # node_modules/ (9cf2046081) — mirror a real completed install. + (sidecar_dir / "node_modules" / "spectrum-ts").mkdir(parents=True) monkeypatch.setattr(photon_adapter, "_SIDECAR_DIR", sidecar_dir) monkeypatch.setattr(photon_adapter, "_sidecar_deps_stale", lambda: False)