#20050·lobehub

[Request] Option to resume the latest topic when opening an agent

Author: ChawnCreated Sep 27, 2026Updated Sep 27, 2026

Feature Description

Clicking an agent in the sidebar always opens a blank new chat, even when the agent already has conversations. To pick up where I left off I have to open the agent, then find and click the latest topic — every time, on desktop and on mobile web.

I'd like an option so that opening an agent (URL without a topic, e.g. /agent/<id>) resumes its most recent topic instead.

Proposed Solution

A user setting, e.g. "When opening an agent: New chat / Resume latest topic" (default: New chat, so nothing changes for anyone who doesn't opt in).

Where it would hook in, from reading v2.2.18:

  • Sidebar agent links use AGENT_CHAT_URL(agentId) (no topic), and useAgentIdStoreSync calls switchTopic(null) when the agent changes without a topic in the path/query.
  • With the setting on, AgentIdSync could look up the agent's topics once per agent entry and navigate(AGENT_CHAT_TOPIC_URL(agentId, latest.id), { replace: true }), where "latest" is the highest getTopicSortTime(topic, 'updatedAt') — not the first item, since favorites are sorted first.
  • Only once per entry, so the "new topic" button (same agent, topic removed from the URL) still gives a blank chat; skip it if the user already picked a topic or started sending while the lookup was in flight.

I'm running a small patch that does exactly this on a self-hosted 2.2.18 and can open a PR if the approach is welcome.

Additional Information

  • Version: self-hosted lobehub/lobehub:2.2.18 (server DB mode)
  • Related but different: #19516 (agent-callable topic search), #14146 (recent conversation list)