fix: deduplicate idle sessions and refresh session data on transitions
Multiple claude processes in the same CWD share one sessionFile via findActiveJsonl, causing duplicate idle entries. Now deduplicates by project+sessionFile key. Also refreshes session data on busy→idle transitions so the parser fix takes effect immediately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -812,14 +812,14 @@ async function main() {
|
||||
} else {
|
||||
const sessions = await detectActiveSessions()
|
||||
const changed = updateProjectSessions(projects, sessions)
|
||||
// Eagerly load session data for active projects (needed for idle panel)
|
||||
const transitioned = checkTransitions(projects, prevBusySnapshot)
|
||||
// Eagerly load/refresh session data for active projects (needed for idle panel)
|
||||
for (const p of projects) {
|
||||
if (p.activeSessions > 0 && !p.sessions) {
|
||||
if (p.activeSessions > 0 && (!p.sessions || transitioned.length > 0)) {
|
||||
p.sessions = await loadSessions(p.path)
|
||||
p.sessionCount = p.sessions.length
|
||||
}
|
||||
}
|
||||
const transitioned = checkTransitions(projects, prevBusySnapshot)
|
||||
prevBusySnapshot = snapshotBusy(projects)
|
||||
if (transitioned.length > 0) {
|
||||
playDoneSound()
|
||||
|
||||
Reference in New Issue
Block a user