Distinguish Windows sandbox provisioning timeouts and pipe closures (#62192)

## Why

When a registered Core provisioning request timed out or its pipe closed
before a reply, setup reported only that the service was unavailable. That
made the two failures indistinguishable in setup metrics.

## What changed

Preserve the underlying I/O error and attach distinct setup error codes for
timeouts and pipe closures. Registered Core still reports the service as
unavailable and refuses helper fallback. `codex doctor` advises checking
that the sandbox service is running and letting pending setup finish before
retrying.

## Testing

Add a unit test that checks error classification for timeouts, unexpected
EOF, and broken pipes. It also checks that a non-registered request still
returns an unavailable response on timeout and that permission errors
receive neither new code.

GitOrigin-RevId: fa6653fe5f9cafd10fc1562eb0763857a1bd628f
This commit is contained in:
zm-oai
2026-11-18 04:52:38 +00:00
committed by copyberry
parent 8e1fc8e059
commit b78fa4af86
4 changed files with 83 additions and 18 deletions
+4
View File
@@ -305,6 +305,10 @@ pub(super) fn sandbox_check(config: &Config, arg0_paths: &Arg0DispatchPaths) ->
| SetupErrorCode::HelperFirewallRuleVerifyFailed => {
"ask IT to allow Codex sandbox rules in managed Windows Firewall policy"
}
SetupErrorCode::RegisteredServiceTimedOut
| SetupErrorCode::RegisteredServicePipeClosed => {
"check that the Codex sandbox service is running and let pending setup finish before retrying"
}
SetupErrorCode::OrchestratorPayloadSerializeFailed
| SetupErrorCode::HelperRequestArgsFailed
| SetupErrorCode::HelperUnknownError => {