Skip to content

fix(photon): unify dashboard/Spectrum project ids and simplify provisioning - #46859

Closed
underthestars-zhy wants to merge 1 commit into
NousResearch:mainfrom
photon-hq:ryan/photon-fix
Closed

fix(photon): unify dashboard/Spectrum project ids and simplify provisioning#46859
underthestars-zhy wants to merge 1 commit into
NousResearch:mainfrom
photon-hq:ryan/photon-fix

Conversation

@underthestars-zhy

Copy link
Copy Markdown
Contributor

What does this PR do?

The Photon dashboard used to expose two identifiers per project: the Dashboard id (used in management API paths) and a separate spectrumProjectId (what the spectrum-ts SDK authenticates with), populated only after Spectrum was enabled on the project. The setup flow therefore had to enable Spectrum, poll for the freshly-minted spectrumProjectId, and carry both ids around.

The dashboard has since unified the two (dashboard ENG-1582): project.id == spectrumProjectId for every project, pre-existing diverged rows were backfilled, and Spectrum is always provisioned at create-time — so there is no enable/toggle step and no second id anymore.

This PR brings the Photon plugin in line with that change: it drops the enable-Spectrum dance, removes the now-dead spectrumProjectId plumbing, stops sending the retired spectrum: true create flag, and rewrites the docs/comments to describe the single unified id. Behavior for end users is unchanged (PHOTON_PROJECT_ID still holds the right id) — the setup flow is just simpler and no longer depends on API surface the dashboard removed.

Related Issue

Follow-up to the Photon Spectrum work in #42444 / #44486 (both merged). No separate tracking issue.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • 📝 Documentation update
  • ♻️ Refactor (no behavior change)
  • ✅ Tests (adding or improving test coverage)

Changes Made

auth.py

  • Removed ensure_spectrum_enabled() and get_project() — there is no enable/toggle step and no spectrumProjectId to re-fetch.
  • create_project() no longer sends the retired spectrum: true flag in the POST body.
  • load_dashboard_project_id() now prefers the stored spectrum_project_id: for pre-backfill installs the old dashboard_project_id is the diverged id that the unification rewrote (it now 404s), while the Spectrum id always matches the live row. Legacy keys remain as fallbacks.
  • print_credential_summary() / credential_summary() surface a single project_id instead of separate dashboard_project_id + spectrum_project_id.
  • Module docstring rewritten to describe the single unified id.

cli.py

  • setup step 3 no longer enables Spectrum or polls for spectrumProjectId; it reuses the dashboard id as the Spectrum id, rotates the secret, and persists creds. Status text updated (Provisioning Spectrum credentials… / Spectrum ready).

README.md (plugin)

  • Setup steps, env-var docs, the auth.json example, and the "Note on ids" callout updated to reflect that the dashboard id is the Spectrum project id.

Tests (tests/plugins/platforms/photon/test_auth.py)

  • test_create_project_sends_spectrum_truetest_create_project_omits_spectrum_flag (asserts the flag is not sent).
  • load_dashboard_project_id round-trip now asserts it resolves to the Spectrum id.
  • credential_summary test asserts the single project_id field.
  • Removed the two ensure_spectrum_enabled toggle tests (function deleted).

How to Test

hermes photon setup --phone +15551234567   # no separate "enable Spectrum" step
hermes photon status                        # shows a single project id
hermes gateway start --platform photon
  1. Run setup on a fresh project → the secret is provisioned and PHOTON_PROJECT_ID is persisted; no enable/toggle round-trip.
  2. hermes photon status prints one project id line.
  3. Send a DM → the sidecar authenticates spectrum-ts with the unified id and the agent replies.

Automated:

pytest tests/plugins/platforms/photon/test_auth.py -q
# 32 passed

Checklist

Code

  • My commit messages follow Conventional Commits (fix(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix (rebased on main; a single commit, no already-merged work)
  • I've run the Photon auth test scope and all tests pass (32 passed)
  • I've updated tests for my changes
  • I've tested on my platform: macOS (Darwin)

Documentation & Housekeeping

  • I've updated relevant documentation — plugin README + module docstrings
  • I've updated plugin.yaml if I added/changed config keys — N/A (no config keys changed)
  • I've considered cross-platform impact — management-plane only; no platform-specific code paths touched
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

$ pytest tests/plugins/platforms/photon/test_auth.py -q
................................                                         [100%]
32 passed in 11.15s

@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/plugins Plugin system and bundled plugins platform/email Email (IMAP/SMTP) adapter P3 Low — cosmetic, nice to have labels Jun 15, 2026
…pectrum provisioning

Co-Authored-By: Marvin <marvin@photon.codes>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@doronkatz

Copy link
Copy Markdown

Is there an update on this?

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #46907 — your commit was cherry-picked onto current main with your authorship preserved in git log (5b3fa26). Photon plugin tests 88/88 green. Thanks!

@teknium1 teknium1 closed this Jun 16, 2026
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 platform/email Email (IMAP/SMTP) adapter type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants