Skip to content

[Agent Builder] Migrate existing routes to new UX#258241

Merged
chrisbmar merged 7 commits intoelastic:ab-agent-centric-ux-feature-branchfrom
chrisbmar:ab-13361-migrate-existing-routes
Mar 18, 2026
Merged

[Agent Builder] Migrate existing routes to new UX#258241
chrisbmar merged 7 commits intoelastic:ab-agent-centric-ux-feature-branchfrom
chrisbmar:ab-13361-migrate-existing-routes

Conversation

@chrisbmar
Copy link
Copy Markdown
Contributor

@chrisbmar chrisbmar commented Mar 17, 2026

closes https://github.com/elastic/search-team/issues/13361

  • Migrates the existing /tools, /skills routes etc. to be within the /manage/tools, /manage/skills routes etc.
  • Fixes multiple small things related to react-query caching and agentId being a query parameter before - now it's in the path
  • Adds the agent-scoped conversations to the conversation sidebar

See video below for an example of what's been migrated (note: there are still many routes that do not have a UI yet, this is deliberate and they will be handled in future PRs)

Screen.Recording.2026-03-17.at.21.02.05.mov

@chrisbmar chrisbmar self-assigned this Mar 17, 2026
@chrisbmar chrisbmar added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 17, 2026
Comment on lines +47 to +53
{isEmbeddedContext && (
<EuiFlexItem grow={false}>
<EuiTourStep {...getStepProps(TourStep.AgentSelector)}>
<AgentSelector agentId={agentId} />
</EuiTourStep>
</EuiFlexItem>
)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just hides the old AgentSelector from the conversation input when in full-screen mode. In a future ticket we will remove this entirely when it moves to the header of the sidebar.


import React, { useCallback } from 'react';
import { Link } from 'react-router-dom-v5-compat';
import { useLocation } from 'react-router-dom';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file just has updates because I had to add the conversations to the sidebar to make sure navigation worked. Actually fixing the UI for the sidebar will be done in a separate PR so I wouldn't pay too much attention to this one.

currentConversationId,
}) => {
const { euiTheme } = useEuiTheme();
const { conversations = [], isLoading } = useConversationList({ agentId });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only gets and lists the conversations for the agent in context.

Comment on lines +46 to +76
legacy: {
conversation: ({ conversationId }: { conversationId: string }) =>
`/conversations/${conversationId}`,
},

// Backward compatibility aliases pointing to new routes
// TODO: Migrate consumers to use appPaths.agent.* or appPaths.manage.* directly and remove these aliases
chat: {
new: '/agents/elastic-default',
newWithAgent: ({ agentId }: { agentId: string }) => `/agents/${agentId}`,
},
agents: {
list: '/manage/agents',
new: '/manage/agents/new',
edit: ({ agentId }: { agentId: string }) => `/manage/agents/${agentId}`,
},
tools: {
list: '/manage/tools',
new: '/manage/tools/new',
details: ({ toolId }: { toolId: string }) => `/manage/tools/${toolId}`,
bulkImportMcp: '/manage/tools/bulk_import_mcp',
},
skills: {
list: '/manage/skills',
new: '/manage/skills/new',
details: ({ skillId }: { skillId: string }) => `/manage/skills/${skillId}`,
},
plugins: {
list: '/manage/plugins',
details: ({ pluginId }: { pluginId: string }) => `/manage/plugins/${pluginId}`,
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So right now, we either add these BWC legacy paths or update 43 files throughout our code to use the new paths directly - I chose the easiest for now 😄 lets see if this new UI ever lands before we consider this change.

Comment on lines +189 to +192
export const getConversationIdFromPath = (pathname: string): string | undefined => {
const match = pathname.match(/^\/agents\/[^/]+\/conversations\/([^/]+)/);
return match ? match[1] : undefined;
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Used only in the sidebar, as it's rendered outside the context of the conversation related hooks we cannot use useConversationId there. Sidebar is rendered at the very top as it's persisted on every route, even non-conversation ones.

@chrisbmar chrisbmar marked this pull request as ready for review March 18, 2026 07:40
@chrisbmar chrisbmar requested a review from a team as a code owner March 18, 2026 07:40
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 18, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #38 / Agent Builder converse Conversation Flow "after all" hook for "sends a message with tool call and receives response with thinking"
  • [job] [logs] FTR Configs #38 / Agent Builder converse Conversation Flow "after all" hook for "sends a message with tool call and receives response with thinking"
  • [job] [logs] FTR Configs #38 / Agent Builder converse Conversation Flow navigates to new conversation page and shows initial state
  • [job] [logs] FTR Configs #38 / Agent Builder converse Conversation Flow navigates to new conversation page and shows initial state
  • [job] [logs] FTR Configs #50 / lens app - group 5 lens formula should duplicate a moving average formula and be a valid table with conditional coloring
  • [job] [logs] Jest Tests #1 / route_config getSidebarViewForRoute agent routes returns "agentSettings" for tools route
  • [job] [logs] Jest Tests #1 / route_config getSidebarViewForRoute agent routes returns "agentSettings" for tools route

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [8b2cb0a]

History

cc @chrisbmar

@SiddharthMantri SiddharthMantri self-requested a review March 18, 2026 09:29
// Backward compatibility aliases pointing to new routes
// TODO: Migrate consumers to use appPaths.agent.* or appPaths.manage.* directly and remove these aliases
chat: {
new: '/agents/elastic-default',
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.

question: should this be elastic-ai-agent and not elastic-default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

these should be removed in favour of just navigating to the root now, I've removed them here.

Copy link
Copy Markdown
Contributor

@SiddharthMantri SiddharthMantri left a comment

Choose a reason for hiding this comment

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

LGTM overall. Left a couple of questions but nothing major.

} else {
navigateToAgentBuilderUrl(appPaths.chat.conversation({ conversationId: conversation.id }));
// Use legacy path - LegacyConversationRedirect fetches conversation and redirects to correct agent-scoped URL
navigateToAgentBuilderUrl(
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.

Question: could this be replced by:

navigateToAgentBuilderUrl(
          appPaths.agent.conversations.byId({
            agentId: conversation.agent_id,
            conversationId: conversation.id,
          })
        );

Since we have agent_id in the conversation response already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes that's exactly what we will do when we remove/recreate this component in the header of the sidebar, good spot!

@chrisbmar chrisbmar merged commit 85cf346 into elastic:ab-agent-centric-ux-feature-branch Mar 18, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants