fix(dashboard-auth): exclude non-interactive providers from interactive login surfaces - #53239
Merged
Merged
Conversation
Collaborator
@rob-maron Tagging you on this credits-notice item as the soft maintainer (follow-up to #43669). |
IAvecilla
marked this pull request as ready for review
June 26, 2026 20:34
pefontana
approved these changes
Jun 26, 2026
pai-scaffolde
pushed a commit
to pai-scaffolde/hermes-agent
that referenced
this pull request
Jun 28, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…ve login surfaces (NousResearch#53239) * Return None instead of erroring on drain login failure * Fix login on drain * Remove login for drained endpoints flow and clean the code * chore: drop unrelated credits changes from this PR * Remove extra comments that were not really necessary
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.
What does this PR do?
Internal Server Error.The safe-shutdown work (#52937) added
DrainSecretProvider, a machine-to-machine service credential that NAS uses (bearer token) to trigger drains into the shared dashboard auth provider registry. But the interactive login surfaces (the login page, the/auth/logindispatch, and the gate's cookieverify_session/refresh_sessionloops) iterated every registered provider with no notion of "interactive human login vs. non-interactive service credential." So the drain credential got mis-treated as a sign-in option:start_loginon click →NotImplementedError→ 500;refresh_sessionraised → 500 on every refresh once the access token expired (wedging the dashboard).It was never meant to be an interactive login method.
Fix: Add a capability flag
supports_sessiontoDashboardAuthProvider(mirroring the existingsupports_token) plus alist_session_providers()registry helper. The interactive surfaces now consult only providers that actually do interactive login.DrainSecretProvidersetssupports_session = False, so it's excluded from the login page, from/auth/login(which now returns 404 for it instead of 500), and from the verify/refresh loops.Type of Change
Changes Made
hermes_cli/dashboard_auth/base.py: addsupports_session: bool = Truecapability flag toDashboardAuthProvider.hermes_cli/dashboard_auth/registry.py: addlist_session_providers()(subset withsupports_session=True); mirror oflist_token_providers().hermes_cli/dashboard_auth/__init__.py: exportlist_session_providers.hermes_cli/dashboard_auth/middleware.py: the gate'sverify_sessionandrefresh_sessionloops iteratelist_session_providers()instead oflist_providers().hermes_cli/dashboard_auth/login_page.py: render login buttons only forlist_session_providers().hermes_cli/dashboard_auth/routes.py:/api/auth/providersbootstrap lists onlylist_session_providers();/auth/loginreturns 404 for a provider that isn't interactive (supports_sessionfalse) instead of 500-ing onstart_login.plugins/dashboard_auth/drain/__init__.py:DrainSecretProvidersetssupports_session = False.test_dashboard_token_auth.py(list_session_providersfiltering),test_dashboard_auth_middleware.py(/auth/login?provider=drain-secret→ 404 + excluded from bootstrap),test_drain_provider.py(drain declaressupports_session=False).How to Test
…/auth/login?provider=drain-secretdirectly → returns 404 (not Internal Server Error).hermes_session_atcookie → the dashboard refreshes transparently and stays up (before: 500 / "reconnecting")./api/gateway/drainwith the per-agent bearer secret (verify_tokenpath unchanged).Checklist
Code
Documentation & Housekeeping
docs/, docstrings) — N/A (no public surface change; inline comments added)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A