hermes-agent/tests/plugins/platforms/photon/test_streaming.py
liuhao1024 21264c4343 fix(photon): mark adapter as not supporting message editing to suppress streaming cursor
Photon (iMessage) has no real edit API for already-sent messages. When
streaming completes, the gateway attempts to edit the message to remove
the streaming cursor (▉). Without edit support, this cursor gets stuck
in the final message, corrupting Unicode characters.

This change sets SUPPORTS_MESSAGE_EDITING=False on PhotonAdapter, which
causes the gateway to suppress the streaming cursor entirely for this
platform (via _effective_cursor in gateway/run.py). This prevents the
stale tofu square (▉) from appearing in streamed iMessage responses.

Fixes #49253
2026-07-28 18:17:52 -07:00

12 lines
543 B
Python

"""Regression tests for Photon adapter streaming behavior."""
from plugins.platforms.photon.adapter import PhotonAdapter
def test_photon_adapter_does_not_support_message_editing() -> None:
"""PhotonAdapter.SUPPORTS_MESSAGE_EDITING must be False.
Photon (iMessage) has no real edit API for already-sent messages.
This attribute signals the gateway to suppress the streaming cursor
instead of leaving a stale tofu square (▉) behind when edit attempts fail.
"""
assert PhotonAdapter.SUPPORTS_MESSAGE_EDITING is False