Skip to content

Add Windows sandbox readiness RPC#20708

Merged
iceweasel-oai merged 4 commits intomainfrom
codex/windows-sandbox-readiness-rpc
May 5, 2026
Merged

Add Windows sandbox readiness RPC#20708
iceweasel-oai merged 4 commits intomainfrom
codex/windows-sandbox-readiness-rpc

Conversation

@iceweasel-oai
Copy link
Copy Markdown
Collaborator

@iceweasel-oai iceweasel-oai commented May 2, 2026

Why

The desktop app on Windows needs a read-only way to tell, before the next tool call, whether the local Windows sandbox setup is in a state that should block the user and ask for setup again.

The main case we want to cover is the elevated sandbox setup version bump. Today, if the app is configured for elevated Windows sandboxing and the installed setup is stale, the next sandboxed shell/exec path can end up triggering the elevated setup flow directly. That means the user can see an unexpected UAC prompt with no UI explanation.

This change adds a small app-server preflight so the desktop app can ask “is Windows sandbox ready, not configured, or update-required?” during startup and show the appropriate blocking UI before the user hits a tool call.

What changed

  • Added a new read-only app-server RPC: windowsSandbox/readiness
  • Added a new protocol enum and response type:
    • WindowsSandboxReadiness
    • WindowsSandboxReadinessResponse
  • Added core readiness logic in core/src/windows_sandbox.rs:
    • ready
    • notConfigured
    • updateRequired
  • Wired the new request through codex_message_processor
  • Regenerated the vendored app-server schema fixtures

Readiness semantics

This is intentionally a coarse startup/version-bump readiness check, not a full predictor of every runtime repair case.

For now, readiness is determined from:

  • the configured Windows sandbox level
  • sandbox_setup_is_complete() for elevated mode

That means:

  • disabled maps to notConfigured
  • restricted token maps to ready
  • elevated maps to ready or updateRequired depending on sandbox_setup_is_complete()

This is deliberate for the first UI integration because the common case we want to catch is “the app updated, the elevated setup version bumped, and the user should see an update-required blocker instead of a surprise UAC prompt”.

It does not attempt to model every case where the deeper runtime path might decide to repair or re-run setup.

Testing

  • Ran cargo fmt --all -- app-server-protocol/src/protocol/common.rs app-server-protocol/src/protocol/v2.rs app-server/src/codex_message_processor.rs core/src/windows_sandbox.rs core/src/windows_sandbox_tests.rs
  • Added unit tests for the pure readiness mapping in core/src/windows_sandbox_tests.rs
  • Regenerated vendored schema fixtures with cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- --schema-root app-server-protocol/schema
  • Did not run the full cargo test suite

@iceweasel-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@iceweasel-oai iceweasel-oai marked this pull request as ready for review May 2, 2026 00:17
@iceweasel-oai iceweasel-oai requested a review from a team as a code owner May 2, 2026 00:17
Comment thread codex-rs/app-server-protocol/src/protocol/v2.rs
Comment thread codex-rs/app-server-protocol/src/protocol/v2.rs
Comment thread codex-rs/app-server-protocol/src/protocol/v2.rs
Comment thread codex-rs/core/src/windows_sandbox.rs Outdated
Comment thread codex-rs/core/src/windows_sandbox.rs Outdated
@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-readiness-rpc branch from 473dd4a to fb9dc7f Compare May 4, 2026 18:07
@iceweasel-oai iceweasel-oai merged commit f35285d into main May 5, 2026
37 of 38 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/windows-sandbox-readiness-rpc branch May 5, 2026 16:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 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