Skip to content

fix(photon): ignore iMessage media placeholders - #54514

Closed
kelsia14 wants to merge 1 commit into
NousResearch:mainfrom
kelsia14:fix/photon-voice-placeholder
Closed

fix(photon): ignore iMessage media placeholders#54514
kelsia14 wants to merge 1 commit into
NousResearch:mainfrom
kelsia14:fix/photon-voice-placeholder

Conversation

@kelsia14

Copy link
Copy Markdown
Contributor

Summary

Fixes a Photon/iMessage voice-note race where iMessage first emits a standalone U+FFFC object placeholder text event and then immediately emits the actual voice/attachment event.

Before this patch, Hermes treated the placeholder as a real text turn. The actual voice event then arrived while that bogus turn was active, triggering the gateway busy handler and sending a misleading:

⚡ Interrupting current task...

This drops placeholder-only Photon text events at the platform boundary so the real voice/attachment event is processed normally.

Test plan

pytest tests/plugins/platforms/photon/ -q

Result:

109 passed

@kelsia14
kelsia14 force-pushed the fix/photon-voice-placeholder branch from 106642c to 42d4e9c Compare June 28, 2026 23:57
@kelsia14
kelsia14 marked this pull request as ready for review June 28, 2026 23:58
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have labels Jun 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Photon regression fix. Current main still routes standalone text, including U+FFFC, through plugins/platforms/photon/adapter.py:749-751 and dispatches it at :821. A follow-up message during that active session reaches the busy-session path in gateway/platforms/base.py:4756-4759, whose non-queue acknowledgement is emitted at gateway/run.py:5605-5609.

The proposed guard is correctly placed before _record_last_inbound() and handle_message(), so it does not create a bogus reaction target or start a text turn. The added test directly asserts the intended no-dispatch contract.

The branch is substantially behind current main, but main's Photon changes are in unrelated sidecar dependency startup code; the target dispatch hunk remains intact. This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 15, 2026
teknium1 pushed a commit that referenced this pull request Jul 28, 2026
Cherry-picked from PR #54514; dropped frozen AUTHOR_MAP hunk in scripts/release.py, contributor mapping added instead.
teknium1 pushed a commit that referenced this pull request Jul 29, 2026
Cherry-picked from PR #54514; dropped frozen AUTHOR_MAP hunk in scripts/release.py, contributor mapping added instead.
teknium1 added a commit that referenced this pull request Jul 29, 2026
…decar-deps fixture

Two independent cross-PR collisions red on main (slice 8/8):

1. fd4f756 (salvaged from stale #54514) added an early 'drop U+FFFC
   placeholder' return at the top of _dispatch_inbound — written before
   the deferred-wait handler (6b91b50/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. 9cf2046 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.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #73560 — cherry-picked with your authorship preserved (the frozen release.py AUTHOR_MAP hunk was swapped for a contributors/emails mapping). Note: the follow-up FFFC deferred-wait work on main later subsumed the early-drop site itself, but your placeholder detection + test shipped and the fix path lives on.

@teknium1 teknium1 closed this Jul 29, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Cherry-picked from PR NousResearch#54514; dropped frozen AUTHOR_MAP hunk in scripts/release.py, contributor mapping added instead.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…decar-deps fixture

Two independent cross-PR collisions red on main (slice 8/8):

1. bc9b8be (salvaged from stale NousResearch#54514) added an early 'drop U+FFFC
   placeholder' return at the top of _dispatch_inbound — written before
   the deferred-wait handler (bfad053/499dd50e4b) 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. af6387e 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.
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
…decar-deps fixture

Two independent cross-PR collisions red on main (slice 8/8):

1. fd4f756 (salvaged from stale NousResearch#54514) added an early 'drop U+FFFC
   placeholder' return at the top of _dispatch_inbound — written before
   the deferred-wait handler (6b91b50/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. 9cf2046 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants