@@ -62,7 +62,8 @@ class SessionManager extends EventEmitter {
6262 this . statusMinHoldMs = parseInt ( process . env . STATUS_MIN_HOLD_MS || '1500' ) ;
6363 // Extra hysteresis for transitioning to idle (prevents flicker when output pauses briefly).
6464 this . statusIdleHoldMs = parseInt ( process . env . STATUS_IDLE_HOLD_MS || '6000' ) ;
65- this . branchRefreshMs = parseInt ( process . env . BRANCH_REFRESH_MS || '60000' ) ;
65+ // Default to 30s to keep branch labels reasonably fresh without relying on user git commands.
66+ this . branchRefreshMs = parseInt ( process . env . BRANCH_REFRESH_MS || '30000' ) ;
6667 this . conversationSnapshotTtlMs = parseInt ( process . env . CONVERSATION_SNAPSHOT_TTL_MS || '5000' ) ;
6768 this . conversationSnapshotCache = { timestamp : 0 , files : null } ;
6869
@@ -1744,6 +1745,10 @@ class SessionManager extends EventEmitter {
17441745 return ! ! rel && ! rel . startsWith ( '..' ) && ! path . isAbsolute ( rel ) ;
17451746 }
17461747
1748+ pathsOverlap ( a , b ) {
1749+ return this . isSameOrSubpath ( a , b ) || this . isSameOrSubpath ( b , a ) ;
1750+ }
1751+
17471752 async updateGitBranch ( worktreeId , worktreePath , skipCache = false ) {
17481753 logger . info ( '🔄 updateGitBranch called' , {
17491754 worktreeId,
@@ -1786,7 +1791,7 @@ class SessionManager extends EventEmitter {
17861791 for ( const [ sessionId , session ] of this . sessions ) {
17871792 // Check if this session belongs to the same worktree by comparing paths
17881793 if ( session . worktreeId === worktreeId && session . config &&
1789- this . isSameOrSubpath ( session . config . cwd , normalizedWorktreePath ) ) {
1794+ this . pathsOverlap ( session . config . cwd , normalizedWorktreePath ) ) {
17901795 sessionsToUpdate . add ( sessionId ) ;
17911796 }
17921797 }
@@ -1798,7 +1803,7 @@ class SessionManager extends EventEmitter {
17981803 if ( sessionsToUpdate . size === 0 ) {
17991804 for ( const [ sessionId , session ] of this . sessions ) {
18001805 if ( ! session ?. config ?. cwd ) continue ;
1801- if ( ! this . isSameOrSubpath ( session . config . cwd , normalizedWorktreePath ) ) continue ;
1806+ if ( ! this . pathsOverlap ( session . config . cwd , normalizedWorktreePath ) ) continue ;
18021807 if ( session . type !== 'claude' && session . type !== 'codex' && session . type !== 'server' ) continue ;
18031808 sessionsToUpdate . add ( sessionId ) ;
18041809 }
0 commit comments