Add Windows sandbox readiness RPC#20708
Merged
iceweasel-oai merged 4 commits intomainfrom May 5, 2026
Merged
Conversation
Collaborator
Author
|
@codex review |
473dd4a to
fb9dc7f
Compare
dylan-hurd-oai
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
windowsSandbox/readinessWindowsSandboxReadinessWindowsSandboxReadinessResponsecore/src/windows_sandbox.rs:readynotConfiguredupdateRequiredcodex_message_processorReadiness 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:
sandbox_setup_is_complete()for elevated modeThat means:
disabledmaps tonotConfiguredrestricted tokenmaps toreadyelevatedmaps toreadyorupdateRequireddepending onsandbox_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
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.rscore/src/windows_sandbox_tests.rscargo run -p codex-app-server-protocol --bin write_schema_fixtures -- --schema-root app-server-protocol/schema