| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "os" |
| 5 | "path/filepath" |
| 6 | |
| 7 | "reasonix/internal/agent" |
| 8 | ) |
| 9 | |
| 10 | func sessionOrderInfoIsHiddenRecovery(info agent.SessionOrderInfo, parentDir string) bool { |
| 11 | return legacyRecoveryParentPresent(info.Path, parentDir) || |
| 12 | sessionOrderInfoIsUnmodifiedRecoveryCopy(info, parentDir) |
| 13 | } |
| 14 | |
| 15 | func legacyRecoveryParentPresent(path, parentDir string) bool { |
| 16 | parentID, ok := agent.RecoveryFilenameParentID(path) |
| 17 | if !ok { |
| 18 | return false |
| 19 | } |
| 20 | parentPath := filepath.Join(parentDir, parentID+".jsonl") |
| 21 | if sameDesktopPath(path, parentPath) { |
| 22 | return false |
| 23 | } |
| 24 | info, err := os.Stat(parentPath) |
| 25 | return err == nil && !info.IsDir() |
| 26 | } |
| 27 |