StateManager.setAgentState() is explicitly called by the agent.
StateManager.saveStateIfModified() will be a no-op for AgentState persistence.StateManager.loadThreadContext(), and if modified by the agent,
StateManager.saveStateIfModified() will attempt to automatically persist these changes
by comparing the current state with a snapshot taken at load time.
StateManager.setAgentState() will still work for explicit saves.
Defines the strategy for saving AgentState.