Install Agent Stage Stuck

Nucleic-Session: CC59896F-5A33-43D8-93E0-AD8C2B16E60E
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-08 02:27:07 -07:00
co-authored by nucleic
parent d625ebfc45
commit 78abc6586c
@@ -294,16 +294,14 @@ extension MacVMEngine {
var nextLaunch = Date()
while Date() < deadline {
if let text = try? String(contentsOf: statusURL, encoding: .utf8), text.contains("CODE=") {
await surface.setKeyboardFocus(name: name, focused: false)
return Self.parseProvisionStatus(text)
}
if !running, fm.fileExists(atPath: startedURL.path) {
running = true // the bootstrap is executing stop typing, hand the keyboard back
await surface.setKeyboardFocus(name: name, focused: false)
running = true // the bootstrap is executing stop typing, just wait for STATUS
}
if !running, Date() >= nextLaunch {
// VZ only forwards keys from a key window, so take key for the duration of the typing.
await surface.setKeyboardFocus(name: name, focused: true)
// Input is delivered straight to the guest's virtual keyboard (background; no focus
// stealing), so we can just type whenever we retry the launch.
await Self.typeBootstrapLaunch(surface: surface, name: name)
nextLaunch = Date().addingTimeInterval(40) // retry login-timing until STARTED appears
}