feat: dashboard OAuth management, session pagination & analytics cleanup#9058
Closed
kshitijk4poor wants to merge 1 commit intoNousResearch:mainfrom
Closed
feat: dashboard OAuth management, session pagination & analytics cleanup#9058kshitijk4poor wants to merge 1 commit intoNousResearch:mainfrom
kshitijk4poor wants to merge 1 commit intoNousResearch:mainfrom
Conversation
576cd30 to
29604ed
Compare
1bf1bac to
6292a73
Compare
7db0faf to
bba82bf
Compare
Contributor
Author
|
Superseded by new PR with UX polish included. |
4 tasks
bba82bf to
d9263b0
Compare
d9263b0 to
56c63a8
Compare
Add OAuth provider management to the Hermes dashboard with full
lifecycle support for Anthropic (PKCE), Nous and OpenAI Codex
(device-code) flows.
## Backend (hermes_cli/web_server.py)
- 6 new API endpoints:
GET /api/providers/oauth — list providers with connection status
POST /api/providers/oauth/{id}/start — initiate PKCE or device-code
POST /api/providers/oauth/{id}/submit — exchange PKCE auth code
GET /api/providers/oauth/{id}/poll/{session} — poll device-code
DELETE /api/providers/oauth/{id} — disconnect provider
DELETE /api/providers/oauth/sessions/{id} — cancel pending session
- OAuth constants imported from anthropic_adapter (no duplication)
- Blocking I/O wrapped in run_in_executor for async safety
- In-memory session store with 15-minute TTL and automatic GC
- Auth token required on all mutating endpoints
## Frontend
- OAuthLoginModal — PKCE (paste auth code) and device-code (poll) flows
- OAuthProvidersCard — status, token preview, connect/disconnect actions
- Toast fix: createPortal to document.body for correct z-index
- App.tsx: skip animation key bump on initial mount (prevent double-mount)
- Integrated into the Env/Keys page
56c63a8 to
e80fbb6
Compare
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
Adds OAuth provider management and session pagination to the Hermes dashboard, and cleans up the analytics page by removing unreliable cost/cache UI.
Dashboard — OAuth Provider Management
Backend (
hermes_cli/web_server.py):GET /api/providers/oauth— list all providers with connection statusPOST /api/providers/oauth/{id}/start— initiate PKCE or device-code flowPOST /api/providers/oauth/{id}/submit— exchange PKCE authorization codeGET /api/providers/oauth/{id}/poll/{session}— poll device-code approvalDELETE /api/providers/oauth/{id}— disconnect providerDELETE /api/providers/oauth/sessions/{session_id}— cancel pending sessionanthropic_adapter(no duplication)run_in_executorfor async safetyFrontend:
OAuthLoginModal— handles both PKCE (paste auth code) and device-code (poll for approval) flowsOAuthProvidersCard— connection status, token preview, connect/disconnect actionsDashboard — Session Pagination
GET /api/sessionsnow acceptslimitandoffsetquery params (was hardcoded to 20){sessions, total, limit, offset}instead of a bare arrayDashboard — Analytics Cleanup
formatCost(),bestCost(), Cache Hit summary card, Total Cost summary card, Cost/Cache columns in daily and model tablesFrontend Fixes
Toast.tsx— render viacreatePortaltodocument.bodyfor correct z-indexApp.tsx— skip animation key bump on initial mount to prevent double-mount / duplicate API callsmain.tsx— removeStrictModewrapperTest Plan
pytest tests/hermes_cli/test_web_server.py— 47 passednpm run build)