You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Cached provider sessions retain old configuration after adapter replacement #31249
apps/server — provider session reuse after registry replacement
Problem
ProviderSessionManager.open returns a cached runtime before looking up the current provider adapter. When settings rebuild that provider, reopening the same session therefore retains the old adapter configuration.
Claude captures its environment when constructing the adapter, so a subsequent child process launched by that cached runtime can retain an outdated credential. Restarting the server discards those cached runtimes.
Deterministic reproduction
Against public main commit 935818e422f9b58c46e14d70f4ef386fa3575105, a local regression test:
Opens a session using a fixture adapter capturing an empty synthetic token.
Replaces the adapter returned by the registry with one capturing saved-test-token.
Opens the same provider-session ID, supplying the previous session and native thread ID.
Checks which adapter was opened.
Expected adapter-open sequence: ["", "saved-test-token"].
Actual on unchanged production code: [""].
The test uses only in-memory fixture adapters and dummy values; no provider account or network request is required. The test and fix will be included in a follow-up PR.
Expected behavior
The next idle session open should use the replacement provider configuration while preserving native conversation continuity. Saving configuration should not interrupt active turns or pending background work.
Activity
juliusmarminge commentedon Nov 15, 2026
This is the same problem as #19025, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.