Skip to content

feat(photon): add native poll sending - #43665

Closed
arnoldfrancisca wants to merge 1 commit into
NousResearch:mainfrom
arnoldfrancisca:feat/photon-polls-forkbase
Closed

feat(photon): add native poll sending#43665
arnoldfrancisca wants to merge 1 commit into
NousResearch:mainfrom
arnoldfrancisca:feat/photon-polls-forkbase

Conversation

@arnoldfrancisca

Copy link
Copy Markdown

Summary

  • Adds a Photon sidecar /send-poll endpoint backed by spectrum-ts' native poll(...) builder
  • Adds PhotonAdapter.send_poll(...) with basic option validation
  • Updates Photon README and website docs to mark native polls as supported
  • Adds regression coverage for the poll endpoint body shape and validation

Why

spectrum-ts already supports native iMessage polls, and Hermes' Photon docs identified polls as a natural sidecar-level feature. This exposes the smallest useful slice without adding a new model tool or changing the generic tool schema.

Verification

  • node --check plugins/platforms/photon/sidecar/index.mjs
  • venv/bin/python -m pytest tests/plugins/platforms/photon/test_outbound_media.py -q -o 'addopts=' → 10 passed
  • venv/bin/python -m pytest tests/plugins/platforms/photon -q -o 'addopts=' → 68 passed

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins labels Jun 10, 2026
@arnoldfrancisca

Copy link
Copy Markdown
Author

Local verification from fork branch: uv run --extra dev pytest tests/plugins/platforms/photon -q passed (68 passed). GitHub reports mergeable=true, mergeable_state=blocked, no CI check rollup present.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the Photon-sidecar primitive. The feature premise is still valid: current main documents polls as supported by spectrum-ts but not exposed (plugins/platforms/photon/README.md:156).

Problems

  • plugins/platforms/photon/adapter.py:758 adds send_poll(), but the gateway's current interaction path calls send_clarify() (gateway/run.py:18493). Repository-wide search finds no Photon caller for send_poll; the analogous WhatsApp implementation calls its primitive from send_clarify() (plugins/platforms/whatsapp/adapter.py:1048). As written, users cannot trigger the new route, so the README/docs support claims overstate the delivered behavior.
  • The tests mock _sidecar_call and exercise the private primitive directly; they do not cover a reachable user flow or a returned poll vote. The maintainer cross-reference on #48194 identifies these missing outbound-clarify and inbound-poll_option layers.

Suggested changes

  • Reconcile with #48194: wire suitable multiple-choice send_clarify() calls through the route, translate inbound selected poll_option events into the existing clarify resolution path, and retain the numbered-text fallback.
  • Add end-to-end adapter/gateway-behavior coverage for send, selection, deselection, and fallback.

Automated hermes-sweeper review.

@@ -758,6 +758,29 @@ async def send_animation(
chat_id, animation_url, caption, reply_to, metadata,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This transport primitive has no Photon caller in the current gateway flow: multiple-choice interaction is delivered through send_clarify() (gateway/run.py:18493), and repository search finds only WhatsApp invoking its analogous send_poll() from a send_clarify() override. Please wire a concrete user-facing path (with fallback and inbound vote handling) before documenting native polls as supported.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
teknium1 added a commit that referenced this pull request Jul 28, 2026
… clarify

Follow-up to the #48194 pick: it was written before #43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep #43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop #48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
teknium1 added a commit that referenced this pull request Jul 29, 2026
… clarify

Follow-up to the #48194 pick: it was written before #43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep #43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop #48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
teknium1 added a commit that referenced this pull request Jul 29, 2026
… clarify

Follow-up to the #48194 pick: it was written before #43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep #43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop #48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
teknium1 added a commit that referenced this pull request Jul 29, 2026
… clarify

Follow-up to the #48194 pick: it was written before #43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep #43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop #48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #73614 — cherry-picked with authorship preserved. First in the train as the /send-poll primitive.

@teknium1 teknium1 closed this Jul 29, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
 for poll clarify

Follow-up to the NousResearch#48194 pick: it was written before NousResearch#43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep NousResearch#43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop NousResearch#48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
 for poll clarify

Follow-up to the NousResearch#48194 pick: it was written before NousResearch#43665 landed and
re-added its own /send-poll sidecar route and poll import. Collapse the
duplicates:

- keep NousResearch#43665's /send-poll route (>=2 trimmed string options) as the
  single sidecar implementation; drop NousResearch#48194's variant
- drop the duplicated poll import in the sidecar destructure
- make adapter.send_poll() a thin wrapper over _sidecar_send_poll(), the
  one /send-poll client (shared with the poll-backed clarify path), and
  align its validation to the sidecar's >=2-options contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants