Skip to content

fix(desktop): recover sessions after provider removal - #78520

Closed
eiritsu wants to merge 1 commit into
NousResearch:mainfrom
eiritsu:fix/desktop-stale-provider-session
Closed

eiritsu wants to merge 1 commit into
NousResearch:mainfrom
eiritsu:fix/desktop-stale-provider-session

Conversation

@eiritsu

@eiritsu eiritsu commented Aug 4, 2026

Copy link
Copy Markdown

Summary

When a persisted session references a provider that has since been removed from configuration, Desktop/TUI resume could restore the stale provider identity and endpoint metadata before the model picker became usable.

This change makes stored runtime restoration validate the provider identity against the current provider registry. If the provider is no longer routable, the restored session keeps its model and session-local reasoning/service-tier settings but drops the stale provider, base URL, and API mode. The session can then initialize with the current default provider and be switched through the existing session-scoped model picker.

Scope

  • Desktop/TUI stored-session runtime restoration only.
  • No changes to custom endpoint CRUD or provider configuration storage.
  • No credentials or API keys are persisted or restored.

Tests

  • python -m pytest tests/test_tui_gateway_server.py -q — 518 passed
  • python -m py_compile tui_gateway/server.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) area/sessions Session lifecycle, resume, persistence, history sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 4, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Resolved via PR #97008, which salvaged the heal-or-fallback fix for stale-provider session resume onto current main (based on #96111, with #78947 as the earliest submission of the fallback half — both credited). The Desktop can now recover sessions after provider removal: renamed providers heal to the new identity, deleted ones fall back to the configured default. Thanks for your work on this bug class.

@teknium1 teknium1 closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants