Skip to content

recover stale Windows sandbox credentials#27944

Merged
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-refresh-stale-creds
Jun 15, 2026
Merged

recover stale Windows sandbox credentials#27944
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-refresh-stale-creds

Conversation

@iceweasel-oai

Copy link
Copy Markdown
Collaborator

Why

The elevated Windows sandbox persists dedicated sandbox account credentials so later commands can launch without reprovisioning. If those persisted credentials drift from the actual Windows account password, CreateProcessWithLogonW fails with ERROR_LOGON_FAILURE and Codex currently surfaces that as a hard runner launch failure.

This change makes that failure self-healing. When Windows specifically rejects the sandbox login, Codex now treats the persisted sandbox credentials as stale, regenerates them through the existing setup path, and retries the runner launch once.

What Changed

  • Preserve CreateProcessWithLogonW failures as a typed runner logon error so callers can distinguish ERROR_LOGON_FAILURE from unrelated launch failures.
  • Add a sandbox credential refresh helper that deletes the persisted sandbox_users.json record and reuses require_logon_sandbox_creds() to reprovision credentials through the established setup flow.
  • Retry elevated runner startup after stale-credential failures in both the legacy elevated capture path and unified exec elevated backend.
  • Add focused tests for stale logon failure detection and persisted sandbox user file removal.

Validation

  • git diff --check
  • cargo test -p codex-windows-sandbox

@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-refresh-stale-creds branch from f4e4c56 to 35ebd05 Compare June 12, 2026 22:59
@iceweasel-oai iceweasel-oai marked this pull request as ready for review June 12, 2026 23:00
@iceweasel-oai iceweasel-oai changed the title [codex] recover stale Windows sandbox credentials recover stale Windows sandbox credentials Jun 12, 2026
@iceweasel-oai iceweasel-oai merged commit c0b36d2 into main Jun 15, 2026
31 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/windows-sandbox-refresh-stale-creds branch June 15, 2026 20:54
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants