Repository navigation
fix(desktop): mint oauth ticket before cold-start unsigned hard-fail - #101547
FalconOrtiz wants to merge 1 commit into
Conversation
Remote roster dial skipped ws-ticket mint when the persist cookie jar still looked empty, then the 10s enumeration deadline raced a successful Test path. Mint first, budget oauth sources longer, and refresh an incomplete fleet roster. Co-authored-by: Cursor <cursoragent@cursor.com>
Overall: Cold-start OAuth roster misses fixed at the root: the ws-ticket mint (the same authoritative check Settings → Test uses) now runs before unsigned classification, and OAuth remotes get a 30 s enumeration budget (#101339). Correctness:
Non-blocking nit:
Verdict: LGTM. |
|
Requesting squash-merge per engineer agreement (2026-09-04): AI-review merge-ready pack; nits non-blocking; no rewrites. This PR is in the agreed pack with #101523 #101528 #101529 #101530 #101531 #101537 #101544 #101547 #101548 #101549 #101551. Out of pack (do not block this merge): #101564, #101796/#101091, #101318. |
|
Superseded by #108183. The consolidated fix preserves contributor credit and covers the remaining remote-gateway recovery paths on current main. |
Why
Registered remote OAuth gateways vanished from the Desktop fleet rail after restart until Settings → Connections → Test. Cookie-jar preflight on
buildRemoteConnectionhard-failed as unsigned while thepersist:jar was still hydrating, so roster dial never minted a ws-ticket. Test mints first and succeeds. The 10s roster deadline also raced oauth mint + readiness.Scope
apps/desktop/electron/main.ts: mint-first oauth dial; unsigned only viashouldTreatOauthMintFailureAsUnsigned; oauth roster sources userosterSourceEnumerationTimeoutMs(30s).apps/desktop/electron/native-auth-decisions.ts(+ tests): pure helpers for mint-failure classification and roster budgets.apps/desktop/src/store/fleet-roster.ts(+ tests): incomplete snapshots (unreachable remotes) do not fill the 60s stale window.apps/desktop/src/app/settings/connections-registry.tsx: successful Test forcesrefreshFleetRoster({ force: true }).backend-dial-claim.test.ts.Out of scope: gateway/backend auth, interactive re-login UX, SSH inventory.
Tradeoffs
Mint-first can issue one extra network round-trip for a truly signed-out user before the unsigned overlay. That matches Test and avoids dropping a live session on cold start.
Blast Radius
Desktop oauth remote/cloud connect and fleet roster refresh. Local/token/SSH paths keep the 10s roster budget. Safe when cookies are live: mint already ran on the previous path.
Verification
Worktree
C:\Users\falco\projects\hermes-agent-wt-u22:No live HERMES_HOME / packaged Electron run in this unit.
Fixes #101339