fix(front): keep custom agent when starting new conversation from convo - #32283
Merged
Conversation
Navigating to /conversation/new?agent=<custom> remounted the homepage input bar, which defaulted to @dust and then mirrored that into the URL (regression from #31961). Skip the default while ?agent= is pending, re-apply the URL agent after entering new, and avoid racing the details sheet close navigation. Co-authored-by: Gabriel Hubert <gabriel.hubert@gmail.com>
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.
Description
Fixes a regression from #31961: starting a new conversation with a custom agent from inside an existing conversation (mention dropdown / agent details / Cmd+K) navigated to
/conversation/new?agent=<custom>, but the remounted homepage input bar defaulted to@dustand that selection was then mirrored back into the URL.useHandleMentions: skip draft/sticky/@dust defaults on the new-conversation page while?agent=is present, so we don't raceuseAgentFromSearchParamuseAgentFromSearchParam: when entering/conversation/newfrom an existing conversation, clear the applied marker and re-push the URL agent; only treat the URL agent as applied once the composer selection actually matches (avoids mirroring a stale default into the URL)AgentDetailsButtonBar: navigate to the new conversation directly instead ofonClose()+push(double navigation race)Before click: analyst details in conversation
After: new conversation with analyst selected
custom-agent-new-convo-fix.mp4
Tests
useAgentFromSearchParam.test.ts, including:/conversation/new?agent=analystwith@analystselected (not@dust)Risk
Low. Scoped to new-conversation agent selection / URL sync. Rollback is a straight revert.
Deploy Plan
Standard deploy.
To show artifacts inline, enable in settings.
Slack Thread