{"record":{"id":"95d21859324c3ed9","repo":"stablyai/orca","slug":"that-claude-account-belongs-to-a-different-runtime","errorCode":null,"errorMessage":"That Claude account belongs to a different runtime.","messagePattern":"That Claude account belongs to a different runtime\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/main/claude-accounts/service.ts","lineNumber":475,"sourceCode":"    }\n  }\n\n  private async doSelectAccount(\n    accountId: string | null,\n    target?: ClaudeAccountSelectionTarget\n  ): Promise<ClaudeRateLimitAccountsState> {\n    let effectiveTarget = target\n    if (accountId !== null) {\n      const account = this.requireAccount(accountId)\n      const accountTarget = getClaudeSelectionTargetForAccount(account)\n      const requestedTarget = normalizeClaudeAccountSelectionTarget(target ?? accountTarget)\n      const normalizedAccountTarget = normalizeClaudeAccountSelectionTarget(accountTarget)\n      if (\n        requestedTarget.runtime !== normalizedAccountTarget.runtime ||\n        (requestedTarget.wslDistro !== null &&\n          requestedTarget.wslDistro !== normalizedAccountTarget.wslDistro)\n      ) {\n        throw new Error('That Claude account belongs to a different runtime.')\n      }\n      effectiveTarget = accountTarget\n    }\n    const previousSettings = this.store.getSettings()\n    const selection = normalizeClaudeRuntimeSelection(previousSettings)\n    const outgoingAccountId = getSelectedClaudeAccountIdForTarget(previousSettings, effectiveTarget)\n    const nextSelection = setSelectedClaudeAccountIdForTarget(selection, accountId, effectiveTarget)\n    this.store.updateSettings({\n      activeClaudeManagedAccountId:\n        effectiveTarget?.runtime === 'wsl' ? nextSelection.host : accountId,\n      activeClaudeManagedAccountIdsByRuntime: nextSelection\n    })\n    try {\n      await this.syncRuntimeAuthWithLivePtyGate(effectiveTarget)\n      await this.rateLimits.refreshForClaudeAccountChange(outgoingAccountId, effectiveTarget)\n      return this.getSnapshot()\n    } catch (error) {\n      this.restoreClaudeSettings(previousSettings)","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/claude-accounts/service.ts#L457-L493","documentation":"Thrown by doSelectAccount() when the requested selection target (runtime/wslDistro) does not match the account's own target. An account created on the host runtime cannot be selected for a WSL target and vice versa; even if wslDistro is provided in the request, it must equal the account's recorded distro. This prevents cross-runtime credential misuse.","triggerScenarios":"Calling selectAccount with a target whose runtime differs from getClaudeSelectionTargetForAccount(account), or supplying a wslDistro that differs from the account's recorded distro.","commonSituations":"UI passes a stale target from the previous selection. An account was created on host but the UI offers it under a WSL filter. Multiple WSL distros and the wrong one is targeted.","solutions":["Do not pass an explicit target; let the account's own target be used (effectiveTarget = accountTarget).","Ensure the requested target.runtime and target.wslDistro match the account's stored runtime/distro.","Filter the account picker so only accounts matching the desired target are selectable.","If you need the account under a different runtime, re-add it in that runtime."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const accountTarget = getClaudeSelectionTargetForAccount(account)\nif (target && (target.runtime !== accountTarget.runtime || (target.wslDistro && target.wslDistro !== accountTarget.wslDistro))) {\n  throw new Error('Account/runtime mismatch')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit the explicit target and let the account's own target be used.","Filter the account picker by target so mismatches are unselectable.","Re-add the account under the desired runtime instead of cross-selecting.","Keep the UI's target state in sync with the selected account."],"tags":["claude-accounts","selection","runtime","wsl","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}