🐛 Bugfix: exit create mode and select newly created agent after saving#2740
Merged
🐛 Bugfix: exit create mode and select newly created agent after saving#2740
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the agent creation flow so that after a successful “Save” in create mode, the UI exits create mode and selects the newly created agent (preventing repeated saves from creating duplicates).
Changes:
- On successful create, constructs a minimal
Agentobject and immediately callssetCurrentAgent()to exit create mode and select the new agent. - Keeps tool config batch update + react-query cache invalidation/refetch behavior for both create and update flows.
- Updates update-mode selection to only set the current agent from refreshed cache when not newly created.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
YehongPan
approved these changes
Mar 28, 2026
WMC001
approved these changes
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2737
Bugfix: exit create mode and select newly created agent after saving
When users clicked "Save" in create mode, the interface remained in create mode instead of exiting and selecting the newly created agent. This allowed users to repeatedly click Save and create duplicate agents with the same name.
Changes:
For newly created agents, immediately call setCurrentAgent() after successful save to exit create mode and select the new agent
This ensures isCreatingMode is set to false and the newly created agent is highlighted in the agent list
Update mode behavior remains unchanged
20260328-164121.mp4