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
.NET: AgentModeProvider keeps a restored mode that is no longer configured #9829
AgentModeProvider validates the default mode and every SetModeAsync / mode_set call against the configured modes.
A mode restored from a persisted session is not validated.
If an app removes or renames a mode, sessions saved before that change keep the old mode.
Observed on main (2684614) after changing the modes from draft/review to draft/publish:
GetModeAsync returns "review".
The instructions tell the model "You are currently operating in the review mode.", but the mode list has no review section, so the model gets no rules for its current mode.
SetModeAsync(session, "review") throws ArgumentException, so the provider reports a mode it would itself reject.
ProviderSessionState.GetOrInitializeState returns the StateBag value without calling the initializer, so the configured-mode check only applies to new sessions.
Match Python: get_agent_mode in python/packages/core/agent_framework/_harness/_mode.py falls back to the default mode when the stored mode is no longer configured.
Related: #9493, which has the same restored-state gap in Mem0Provider.
changed the title [-].NET: AgentModeProvider keeps a restored mode that is no longer configured[/-][+]Python: .NET: AgentModeProvider keeps a restored mode that is no longer configured[/+]on Oct 29, 2026
changed the title [-]Python: .NET: AgentModeProvider keeps a restored mode that is no longer configured[/-][+].NET: AgentModeProvider keeps a restored mode that is no longer configured[/+]on Oct 29, 2026
Activity
[-].NET: AgentModeProvider keeps a restored mode that is no longer configured[/-][+]Python: .NET: AgentModeProvider keeps a restored mode that is no longer configured[/+][-]Python: .NET: AgentModeProvider keeps a restored mode that is no longer configured[/-][+].NET: AgentModeProvider keeps a restored mode that is no longer configured[/+].NET: fall back when a restored agent mode is no longer configured (m…