Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions scripts/doctor/checks/restart-recovery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ function New-RestartRecoveryFixture {
$sessionId = [guid]::NewGuid().ToString()
$sessionPath = Join-Path $sessionsRoot "$sessionId.jsonl"
Set-Content -LiteralPath $sessionPath -Value $Lines -Encoding UTF8
$bootUtc = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime.ToUniversalTime()
(Get-Item -LiteralPath $sessionPath).LastWriteTimeUtc = $bootUtc.AddMinutes(-5)
(Get-Item -LiteralPath $sessionPath).LastWriteTimeUtc = $restartRecoveryBootUtc.AddMinutes(-5)

return [pscustomobject]@{
CodexHome = $codexHome
Expand All @@ -69,8 +68,7 @@ function New-RestartRecoverySessionFile {
$sessionId = [guid]::NewGuid().ToString()
$sessionPath = Join-Path $sessionsRoot "$sessionId.jsonl"
Set-Content -LiteralPath $sessionPath -Value $Lines -Encoding UTF8
$bootUtc = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime.ToUniversalTime()
(Get-Item -LiteralPath $sessionPath).LastWriteTimeUtc = $bootUtc.AddSeconds(-1 * $SecondsBeforeBoot)
(Get-Item -LiteralPath $sessionPath).LastWriteTimeUtc = $restartRecoveryBootUtc.AddSeconds(-1 * $SecondsBeforeBoot)

return [pscustomobject]@{
SessionId = $sessionId
Expand Down Expand Up @@ -105,6 +103,7 @@ else {
$oldCodexHome = [Environment]::GetEnvironmentVariable("CODEX_HOME", "Process")

try {
$restartRecoveryBootUtc = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime.ToUniversalTime()
New-Item -ItemType Directory -Force -Path $restartRecoveryTemp | Out-Null
$fakeBin = Join-Path $restartRecoveryTemp "bin"
New-Item -ItemType Directory -Force -Path $fakeBin | Out-Null
Expand Down