mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Resume Windows sandbox registration refresh after service restarts (#45559)
## Why Registering the service-bearing package can restart the provisioning service once for each managed sandbox account. A restart can interrupt the response after runtime readiness has been revoked, preventing the refresh from completing. ## What changed - Retry registered sandbox refresh requests after response pipe disconnections, allowing up to two service restarts within the original deadline. Require a different service process ID and authenticate it against the running service before resending. - Allow refresh to resume without `ready_package` when account ownership is complete, teardown is not underway, and the existing owner, package family, live account SIDs, and settings checks pass. Runtime execution still requires readiness for the current package. - Keep authentication failures, failed writes, explicit replies, and protocol errors outside the retry path. ## Testing Add regression tests for disconnect classification, the two-restart budget, deadline expiry, and authentication failure before writing. Extend ownership tests to distinguish resumable registration from runtime readiness and reject incomplete accounts or retirement state. GitOrigin-RevId: d932f179b31752fe918297b7b12e5077c17b19e5
This commit is contained in:
1 parent
653e5fbb9d
commit
4e6450bbfd
6 files changed
+271
-15
No files matched your search
@@ -43,17 +43,15 @@ pub(super) fn run(
|
||||
let previous = crate::installation_record::load_runtime()?
|
||||
.context("registration refresh requires completed setup")?;
|
||||
let runtime = previous.runtime()?;
|
||||
let ready = runtime
|
||||
.ready_package
|
||||
.as_deref()
|
||||
.context("registration refresh requires a ready runtime")?;
|
||||
// Windows may restart this service during registration, after readiness was
|
||||
// revoked. Resume only the same provisioned accounts; never repair setup.
|
||||
ensure!(
|
||||
previous.user_sid == identity.user_sid
|
||||
&& previous.codex_home == identity.codex_home
|
||||
&& crate::installation_record::is_current_package_family(&previous)?
|
||||
&& runtime.ready_for_package(ready)
|
||||
&& runtime.can_resume_registration()
|
||||
&& setup_complete,
|
||||
"registration refresh requires unchanged, ready sandbox ownership and settings"
|
||||
"registration refresh requires unchanged sandbox ownership and settings"
|
||||
);
|
||||
for entry in &runtime.accounts {
|
||||
let account = entry.account.username();
|
||||
|
||||
Reference in new issue
Block a user