bug: OAuth provider mismatch on sign-in creates new workspace and orphans existing one — no recovery path
Summary
When a user signs in with a different OAuth provider than they originally used (e.g. GitHub instead of Google), OpenHuman creates a brand new local workspace under a different users/<id> path, silently abandoning the existing workspace. The old workspace — containing all synced memory, vault content, and configuration — is left orphaned on disk with no UI to recover or switch back to it.
Problem
OpenHuman ties workspace identity to the OAuth provider account. If the user picks a different provider on a subsequent sign-in (easy to do if they cannot remember which they originally used), the result is:
Old workspace: C:\Users\<user>\.openhuman\users\6a07285ec4a2001c6245e641 ← orphaned, all data here
New workspace: C:\Users\<user>\.openhuman\users\6a4c727d3e6105bc02f27512 ← empty, newly active
After the OAuth flow, OpenHuman restarts and presents as freshly initialized:
0 memory graph
no connected sources
vault setup warnings
The old workspace still exists on disk — data is not deleted — but there is no UI to:
- See that a previous workspace exists
- Select or restore it
- Understand that a provider mismatch caused the switch
This is effectively a silent data loss event from the user's perspective.
Steps to reproduce
- Install OpenHuman and sign in with Provider A (e.g. Google). Set up sources, sync memory.
- Sign out or reinstall.
- Sign in again — choose Provider B (e.g. GitHub) instead of Provider A.
- Observe: OpenHuman restarts as if newly initialized. All prior memory, sources, and config appear gone.
- Check
%USERPROFILE%\.openhuman\users\— two<id>folders exist; the old one still has content.
Expected behaviour
- If a sign-in resolves to a different identity than the current workspace, warn the user before switching: "This account doesn't match your current workspace. Switch accounts? Your existing data will remain accessible."
- Provide a workspace selector so users can see and switch between local workspaces tied to different accounts.
- At minimum: detect orphaned workspaces on startup and surface a recovery option.
Acceptance criteria
- [ ] Provider mismatch warning — Signing in with a different OAuth provider that resolves to a new identity shows a confirmation dialog before creating a new workspace.
- [ ] Workspace selector — UI (Settings or onboarding) allows switching between local
users/<id>workspaces. - [ ] Orphaned workspace detection — On startup, if unused
users/<id>folders exist, surface a non-blocking prompt offering recovery or cleanup. - [ ] No silent state loss — A user cannot lose access to their existing workspace without an explicit confirmation step.
- [ ] Diff coverage ≥ 80%.
Environment
- OS: Windows
- Version: v0.58.7
- Workspace path:
%USERPROFILE%\.openhuman\users\<id>
Related
- Managed embeddings auth: #4359
- Prior OAuth security review: #2020 (closed)
Thanks for the detailed writeup. Flagging that the workspace-per-identity separation here is intentional, not a regression:
- OpenHuman scopes all local data (memory graph, vault, config, and the CEF/webview profile) to the backend user id at
~/.openhuman/users/<id>. Each OAuth identity resolves to a distinct backend user, so signing in with a different provider (Google vs GitHub) is genuinely a different user and gets its own isolated workspace. That isolation is deliberate — it stops one account's third-party cookies, vault, and persisted state from bleeding into another's on a shared device (see #900). - No data is deleted. On an identity switch the app repoints the active user but preserves each user's namespaced data on disk —
users/<old_id>/stays fully intact and is not purged. Re-signing in with the original provider returns to that exact workspace.
So we intend to keep the identity-scoped workspace model as-is; treating each provider identity as its own user is by design.
The one part worth separating out is discoverability: today there's no in-app affordance to see or switch back to the prior workspace, which is what makes a provider mix-up feel like data loss even though nothing is gone. If we want to address that, it'd be a standalone UX enhancement (workspace switcher / "previous workspace found" prompt) rather than a change to the identity model.
Product triage note (2026-08-23)
Disposition: re-scope from data-loss bug to identity/workspace discoverability. Evidence: The workspace-per-identity behavior is intentional and there is no evidence here that the old workspace was deleted. A recovery selector or explicit identity/workspace warning would be a useful UX follow-up; the original data-loss framing should be closed as by design after that follow-up is tracked.
Triage: valid — Current review confirms this is a concrete, in-scope engineering issue or request: “bug: OAuth provider mismatch on sign-in creates new workspace and orphans existing one — no recovery path”. No complete resolution is evident in current main.
Thanks for the clear reproduction. Confirmed on current main: each sign-in identity gets its own local workspace (~/.openhuman/users/<id>) by design, and nothing is deleted. But when you sign in with a different provider, the app clears the old session and restarts without saying that another local workspace exists. So the data-loss feeling is real, even though the data is still on disk.
The fix would be a UX change: for example, warn on sign-in when a different identity's workspace is present, or offer a way to see and switch back to it. That needs a maintainer's call on the design. Until then, signing out and back in with the original provider brings the old workspace back.