Skip to content

[Feature]: Separate Agent into an independent module from Assistants #13329

@SiinXu

Description

@SiinXu

Background

Currently Agent and Assistant are mixed in the same list (UnifiedList). Users report difficulty finding the Agent entry. The two have significant differences in functionality, data models, and interaction patterns:

Dimension Assistant Agent
Interaction Conversational, Topic-driven Autonomous execution, Session-driven
Data Model Assistant + Topic[], Redux store AgentEntity + AgentSessionEntity, API Server + SQLite
Tool Capabilities Manual MCP configuration Built-in MCP + Skill + allowed_tools
Message/Input Components Messages + Inputbar AgentSessionMessages + AgentSessionInputbar

Issues caused by mixing:

  1. Users cannot intuitively find the Agent entry, low discoverability
  2. Two fundamentally different models forced to share list and tab switching logic
  3. Selecting an Agent requires setting a fake assistant (id: 'fake') to work around null issues

Goal

Complete separation of Agent and Assistant:

  • Assistant page (/): Only shows assistant list + Topics + assistant chat
  • Agent page (/agents): Only shows Agent list + Sessions + Agent chat
  • Both sides are independent with their own data and UI
  • Agent has a fixed tab in the top navigation bar next to "首页" for quick access

Design

1. Add: Sidebar Agent entry + Route + Page

Add agents entry to sidebar using MousePointerClick icon (lucide-react), navigates to /agents.

Sidebar:
┌──────┐
│ 💬   │ ← assistants (assistants only)
│ 🖱️   │ ← agents (agents only)
│ 🏪   │ ← store
│ ...  │
└──────┘

Agent page structure is identical to the current experience when selecting an Agent in HomePage:

  • Left panel: Agent list + Session list (reuse existing display logic)
  • Right panel: <Chat /> (internally activeTopicOrSession === 'session' auto-renders AgentSessionMessages + AgentSessionInputbar)
  • Add button: directly creates a new Agent
File Change
src/renderer/src/types/index.ts Add 'agents' to SidebarIcon union type
src/renderer/src/config/sidebar.ts Add 'agents' to DEFAULT_SIDEBAR_ICONS
src/renderer/src/components/app/Sidebar.tsx Add entry to iconMap + pathMap
src/renderer/src/i18n/label.ts Add agents mapping to sidebarIconKeyMap
src/renderer/src/i18n/locales/*.json Add translations
src/renderer/src/Router.tsx Add /agents route
src/renderer/src/pages/agents/AgentPage.tsx New file, compose existing components

2. Add: Fixed Agent tab in top navigation bar (tab-style)

In the top content area header (NavbarCenter), add a tab-style navigation bar with "首页" (Home) and "Agent" as fixed tabs, along with a "+" button.

┌────────────────────────────────────────────────────────────────┐
│  ☰  📋    [ 首页 ] [ 🖱️ Agent ] [ + ]          🔍   ↔   📋  │
│  NavbarLeft          NavbarCenter               NavbarRight   │
└────────────────────────────────────────────────────────────────┘
  • 首页 tab: Represents the current Assistant/Home page (/), highlighted when on home page
  • Agent tab: Fixed tab, clicking navigates to /agents, highlighted when on Agent page
  • + button: Context-aware — on home page creates new assistant, on Agent page creates new Agent
  • Tab style: Matches existing tab styling patterns in the app (active underline indicator, font weight change)
  • Both tabs are always visible regardless of current route
File Change
src/renderer/src/pages/home/Navbar.tsx Add tab-style navigation in NavbarCenter with "首页" + "Agent" tabs + "+" button
src/renderer/src/components/app/Navbar.tsx Ensure NavbarCenter supports flex layout for tab items

3. Cleanup: Remove Agent from Assistant page

Assistant list no longer shows Agents. HomePage no longer handles Agent logic.

File Change
src/renderer/src/pages/home/Tabs/hooks/useUnifiedItems.ts Remove agents data source, return assistants only
src/renderer/src/pages/home/Tabs/components/UnifiedList.tsx Remove AgentItem rendering branch
src/renderer/src/pages/home/Tabs/components/UnifiedAddButton.tsx Remove AddAssistantOrAgentPopup, directly create new assistant
src/renderer/src/pages/home/Tabs/AssistantsTab.tsx Remove agent logic (handleAgentPress, fake assistant hack)
src/renderer/src/pages/home/HomePage.tsx Remove useAgentSessionInitializer, agent-related dispatch
src/renderer/src/pages/home/Chat.tsx Remove activeTopicOrSession === 'session' branch (Agent chat moved to Agent page)
src/renderer/src/pages/home/Tabs/index.tsx Remove SessionsTab logic (Sessions belong to Agent only)
src/renderer/src/store/assistants.ts Clean up type: 'agent' entries from unifiedListOrder

4. Unchanged files

File Reason
AgentSessionMessages.tsx / AgentSessionInputbar.tsx Reused by Agent page via Chat.tsx
Sessions.tsx / SessionItem.tsx Directly reused by Agent page
AgentItem.tsx Reused in Agent page
runtime.ts Existing activeAgentId + activeSessionIdMap driven by Agent page
hooks/agents/* All reused as-is

Change Summary

Type Count
New files 1 (AgentPage.tsx)
Modified files ~15
Add entry side (sidebar/router/i18n/navbar) ~8 files
Cleanup assistant side (remove Agent logic) ~7 files

Future Work (not in this PR)

  • Clean up deprecated Agent state management in runtime.ts (v2 refactor)

Metadata

Metadata

Assignees

Labels

AgentCherry Studio AgentAssistantCategorizes an issue or PR as relevant to SIG AssistantUI/UXfeatureCategorizes issue or PR as related to a feature enhancement

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions