@@ -129,43 +129,17 @@ export function AgentDetailView({
129129 const agentProjects = await remoteHistory . fetchAgentProjects ( agent . apiEndpoint ) ;
130130 console . log ( `📁 Found ${ agentProjects . length } projects for agent ${ agent . name } ` ) ;
131131
132- // Filter projects to only those relevant to this agent
133- const relevantProjects = agentProjects . filter ( project => {
134- // Filter by agent's working directory or related keywords
135- const agentWorkingDir = agent . workingDirectory . toLowerCase ( ) ;
136- const projectPath = project . path . toLowerCase ( ) ;
137-
138- // Extract keywords from agent working directory and description
139- const agentKeywords = [
140- ...agentWorkingDir . split ( / [ / \\ - _ \s] + / ) . filter ( Boolean ) ,
141- ...agent . description . toLowerCase ( ) . split ( / [ \s , . - ] + / ) . filter ( Boolean ) ,
142- agent . id . toLowerCase ( )
143- ] ;
144-
145- // Check if project path contains any agent-specific keywords
146- const isRelevant = agentKeywords . some ( keyword =>
147- keyword . length > 2 && projectPath . includes ( keyword )
148- ) ;
149-
150- console . log ( `📂 Project: ${ project . path } ` ) ;
151- console . log ( `🔍 Agent keywords: ${ agentKeywords . join ( ", " ) } ` ) ;
152- console . log ( `✅ Is relevant: ${ isRelevant } ` ) ;
153-
154- return isRelevant ;
155- } ) ;
156-
157- console . log ( `🎯 Filtered to ${ relevantProjects . length } relevant projects for agent ${ agent . name } ` ) ;
158- console . log ( `📋 Relevant projects: ${ relevantProjects . map ( p => p . path ) . join ( ", " ) } ` ) ;
159-
160- // Collect all conversations from relevant projects only
132+ // Collect all conversations from all projects for this agent
133+ // Backend will filter by agent ID, so no need for fragile keyword matching
161134 const allAgentConversations : ConversationSummary [ ] = [ ] ;
162135
163- for ( const project of relevantProjects ) {
136+ for ( const project of agentProjects ) {
164137 try {
165138 console . log ( `📖 Loading conversations from project: ${ project . path } ` ) ;
166139 const projectHistories = await remoteHistory . fetchAgentHistories (
167140 agent . apiEndpoint ,
168- project . encodedName
141+ project . encodedName ,
142+ agent . id // Pass agent ID for filtering
169143 ) ;
170144 console . log ( `💬 Found ${ projectHistories . length } conversations in project ${ project . path } ` ) ;
171145 allAgentConversations . push ( ...projectHistories ) ;
@@ -197,32 +171,16 @@ export function AgentDetailView({
197171 setHistoryLoading ( true ) ;
198172 setHistoryError ( null ) ;
199173
200- // Try to find the conversation in relevant projects only
174+ // Try to find the conversation in all agent projects
201175 let foundProject = null ;
202176
203177 try {
204178 const agentProjects = await remoteHistory . fetchAgentProjects ( agent . apiEndpoint ) ;
205179
206- // Filter to only relevant projects (same logic as loadAgentHistory)
207- const relevantProjects = agentProjects . filter ( project => {
208- const agentWorkingDir = agent . workingDirectory . toLowerCase ( ) ;
209- const projectPath = project . path . toLowerCase ( ) ;
210-
211- const agentKeywords = [
212- ...agentWorkingDir . split ( / [ / \\ - _ \s] + / ) . filter ( Boolean ) ,
213- ...agent . description . toLowerCase ( ) . split ( / [ \s , . - ] + / ) . filter ( Boolean ) ,
214- agent . id . toLowerCase ( )
215- ] ;
216-
217- return agentKeywords . some ( keyword =>
218- keyword . length > 2 && projectPath . includes ( keyword )
219- ) ;
220- } ) ;
221-
222- console . log ( `🔍 Searching for session ${ sessionId } in ${ relevantProjects . length } relevant projects` ) ;
180+ console . log ( `🔍 Searching for session ${ sessionId } in ${ agentProjects . length } projects` ) ;
223181
224- // Try each relevant project until we find one with this session
225- for ( const project of relevantProjects ) {
182+ // Try each project until we find one with this session
183+ for ( const project of agentProjects ) {
226184 try {
227185 const conversation = await remoteHistory . fetchAgentConversation (
228186 agent . apiEndpoint ,
0 commit comments