Skip to content

Remove duplicate turn_state.load() from AgentApplication._initialize_state() - #455

Merged
Rodrigo Brandão (rodrigobr-msft) merged 2 commits into
mainfrom
users/kylerohn/duplicate-state-loading
Jul 9, 2026
Merged

Remove duplicate turn_state.load() from AgentApplication._initialize_state()#455
Rodrigo Brandão (rodrigobr-msft) merged 2 commits into
mainfrom
users/kylerohn/duplicate-state-loading

Conversation

@kylerohn-msft

Copy link
Copy Markdown
Contributor

Closes #454
This pull request makes a small change to the agent_application.py file by removing an unnecessary call to asynchronously load the turn state when using the default turn state factory. This helps simplify the initialization process.

Copilot AI review requested due to automatic review settings July 9, 2026 20:46
@kylerohn-msft
Kyle Rohn (kylerohn-msft) requested a review from a team as a code owner July 9, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves issue #454 by removing a redundant asynchronous turn_state.load(...) call during AgentApplication._initialize_state() when the default TurnState factory is used, simplifying state initialization while preserving the single required load.

Changes:

  • Removed the extra await turn_state.load(context, self._options.storage) from the default-factory branch in _initialize_state().
  • Kept the single, shared “Loading turn state from storage” load so both custom and default turn state factories follow the same load path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) merged commit 130b10e into main Jul 9, 2026
12 checks passed
@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) deleted the users/kylerohn/duplicate-state-loading branch July 9, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate state load in AgentApplication._initialize_state()

3 participants