mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Validate that essential session files exist
This commit is contained in:
parent
b3a7e3a110
commit
aa60d9ef7d
1 changed files with 16 additions and 0 deletions
|
|
@ -169,6 +169,22 @@ func loadSession(controlPath, id string) (*Session, error) {
|
||||||
info: info,
|
info: info,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate that essential session files exist
|
||||||
|
streamPath := filepath.Join(sessionPath, "stream-out")
|
||||||
|
if _, err := os.Stat(streamPath); os.IsNotExist(err) {
|
||||||
|
// Stream file doesn't exist - this might be an orphaned session
|
||||||
|
if os.Getenv("VIBETUNNEL_DEBUG") != "" {
|
||||||
|
log.Printf("[DEBUG] Session %s missing stream-out file, marking as exited", id[:8])
|
||||||
|
}
|
||||||
|
// Mark session as exited if it claims to be running but has no stream file
|
||||||
|
if info.Status == string(StatusRunning) {
|
||||||
|
info.Status = string(StatusExited)
|
||||||
|
exitCode := 1
|
||||||
|
info.ExitCode = &exitCode
|
||||||
|
info.Save(sessionPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If session is running, we need to reconnect to the PTY for operations like resize
|
// If session is running, we need to reconnect to the PTY for operations like resize
|
||||||
// For now, we'll handle this by checking if we need PTY access in individual methods
|
// For now, we'll handle this by checking if we need PTY access in individual methods
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue