fix(web): prevent subagent sessions from leaking into chat sidebar
- Skip updateIndex for session IDs containing :subagent: so they don't appear as top-level "New Chat" entries in the sidebar - Filter subagent IDs in the sidebar component as a safety net - Clean up existing leaked entries from index.json Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
36553cf0c0
commit
20ace16d4c
@ -220,8 +220,13 @@ export function ChatSessionsSidebar({
|
||||
return map;
|
||||
}, [subagents]);
|
||||
|
||||
const filteredSessions = useMemo(
|
||||
() => sessions.filter((s) => !s.id.includes(":subagent:")),
|
||||
[sessions],
|
||||
);
|
||||
|
||||
// Group sessions: today, yesterday, this week, this month, older
|
||||
const grouped = groupSessions(sessions);
|
||||
const grouped = groupSessions(filteredSessions);
|
||||
|
||||
const width = mobile ? "280px" : (widthProp ?? 260);
|
||||
const headerHeight = 40; // px — match padding so list content clears the overlay
|
||||
|
||||
@ -1557,12 +1557,17 @@ function upsertMessage(
|
||||
|
||||
if (!found) {
|
||||
updated.push(JSON.stringify(message));
|
||||
updateIndex(sessionId, { incrementCount: 1 });
|
||||
} else {
|
||||
updateIndex(sessionId, {});
|
||||
}
|
||||
|
||||
writeFileSync(fp, updated.join("\n") + "\n");
|
||||
|
||||
if (!sessionId.includes(":subagent:")) {
|
||||
if (!found) {
|
||||
updateIndex(sessionId, { incrementCount: 1 });
|
||||
} else {
|
||||
updateIndex(sessionId, {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cleanupRun(sessionId: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user