fix(photon): migrate user API to Spectrum backend + send-path & status follow-ups - #42615
Merged
Merged
Conversation
Store operator and assigned iMessage numbers in `auth.json` after setup, and surface them in `hermes photon status`. When numbers are missing, status auto-refreshes from the dashboard without provisioning new lines.
Switch `list_users`, `find_user_by_phone`, `create_user`, `register_user_if_absent`, and `refresh_user_numbers` from the Dashboard API (Bearer token) to the Spectrum API (Basic auth with project credentials). Update response unwrapping to handle the nested `data.users` envelope returned by Spectrum, add `_spectrum_host()` resolver, `_basic()` header helper, and structured error helpers. Update tests, docs, and plugin.yaml accordingly.
Extend the sidecar and Python adapter to handle `voice` content alongside `attachment`. Voice notes are inlined as base64 (same size-cap logic), surfaced as `MessageType.VOICE`, and include an optional `duration` field in fallback markers when bytes are unavailable.
Contributor
🔎 Lint report:
|
HotGirlLo
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Salvage of #42602 (@underthestars-zhy) onto current
main. Moves the Photon plugin's user/management API off the Dashboard API (Bearer) and onto the Spectrum API (Basic auth with project credentials), which is the correct backend for user management, plus four follow-ups on the send path and status command.Changes (plugin-only —
plugins/platforms/photon/)list_users,find_user_by_phone,create_user,register_user_if_absent,refresh_user_numbersnow hit{spectrum_host}/projects/{id}/users/with Basic auth; new_spectrum_host()/_basic()/_raise_for_status()helpers; nesteddata.usersenvelope unwrap;create_usersendstype: shared. NewPHOTON_SPECTRUM_HOSTenv var (defaulthttps://spectrum.photon.codes). —auth.py,cli.py,plugin.yamlstrip_markdown()so iMessage renders plain text;_send_with_retry()adds exponential backoff + plain-text fallback. —adapter.pyoptions: { flattenGroups: true }in the sidecar Spectrum config. —sidecar/index.mjssetuppersists operator phone / assigned iMessage line / user id;hermes photon statussurfaces and auto-refreshes them. —cli.py,auth.pyvoicecontent (base64 inline,MessageType.VOICE, optionaldurationfallback marker). —adapter.py,sidecar/index.mjsspectrum-ts→^1.18.0;setuprunsnpm install spectrum-ts@latest. —sidecar/package.json, lockfilewebsite/docs/user-guide/messaging/photon.md.Validation
tests/plugins/platforms/photon/+ send_message suitesAll 6 commits cherry-picked with @underthestars-zhy's authorship preserved. Closes #42602.
Infographic