Skip to content

fix(front): keep custom agent when starting new conversation from convo - #32283

Merged
theogz merged 1 commit into
mainfrom
cursor/fix-custom-agent-new-convo-link-c5c7
Sep 10, 2026
Merged

fix(front): keep custom agent when starting new conversation from convo#32283
theogz merged 1 commit into
mainfrom
cursor/fix-custom-agent-new-convo-link-c5c7

Conversation

@gabhubert

@gabhubert gabhubert commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

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 @dust and 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 race useAgentFromSearchParam
  • useAgentFromSearchParam: when entering /conversation/new from 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 of onClose() + push (double navigation race)

Before click: analyst details in conversation
After: new conversation with analyst selected
custom-agent-new-convo-fix.mp4

Tests

  • Updated unit tests in useAgentFromSearchParam.test.ts, including:
    • re-push matching URL agent when entering a new conversation
    • do not mirror a default overwrite while the URL agent is still pending
  • Manual: from an existing conversation, opened analyst details → New conversation → landed on /conversation/new?agent=analyst with @analyst selected (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

Open in Web Open in Cursor 

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>

@Fraggle Fraggle 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.

Lgtm !

@theogz
theogz marked this pull request as ready for review September 10, 2026 22:46
@theogz
theogz merged commit bed1540 into main Sep 10, 2026
56 checks passed
@theogz
theogz deleted the cursor/fix-custom-agent-new-convo-link-c5c7 branch September 10, 2026 22:47
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.

4 participants