[Windows][Computer Use] Activating a background maximized window restores it to normal size
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.901.6511.0 (installed Codex Desktop AppX package)
What subscription do you have?
Not disclosed for privacy; reporting a window-management issue.
What platform is your computer?
Windows 11 x64, multi-monitor setup. Reproduced with Microsoft Paint and File Explorer.
What issue are you seeing?
Please investigate a reproducible window-state change during Windows Computer Use. When an approved target application is maximized but behind another application, bringing it to the foreground through the bundled @oai/sky API restores it to its saved normal window size.
This was observed with both Microsoft Paint and File Explorer. Read-only Win32 measurements showed IsZoomed changing from true to false and GetWindowPlacement.showCmd changing from 3 (maximized) to 1 (normal). The resulting window bounds matched the saved normal bounds. This is an actual window-state change, not merely a scaled screenshot.
Read-only window discovery/capture preserved maximization. Ordinary input to the already foreground maximized target also preserved it in the tested cases. Background activation and automatic activation before input triggered the problem.
This can invalidate screenshot-based coordinates and cause subsequent input to target the wrong location or fail.
What steps can reproduce the bug?
- Open Microsoft Paint or File Explorer and maximize its window using the normal Windows UI.
- Bring a different application to the foreground, leaving the target maximized in the background.
- Select the target using sky.list_windows() and sky.get_window() with the returned window identity.
- Call sky.get_window_state({ window: target }). Read-only observation leaves the target maximized.
- Call sky.activate_window({ window: target }).
- Observe that the target comes to the foreground in its saved normal size instead of remaining maximized.
The implicit activation path also reproduced this: sending sky.press_key({ window: target, key: "Alt_L+space" }) to a background maximized target opened the system menu after restoring the target to normal size. No document content changes are needed for this test.
Control: repeat a normal input while the target is already foreground and maximized; maximization was retained in the tested cases.
What is the expected behavior?
Bringing a non-minimized target to the foreground should preserve its maximized or normal state and window bounds. Explicit activation and automatic activation before input should behave consistently. Screenshot-based input should not proceed using geometry invalidated by an unexpected window-state change.
Additional information
Bundled @oai/sky: 0.6.26. Computer Use plugin: 26.901.51231.
A local workflow mitigation avoids unnecessary explicit activation and, when background activation restores the window, selects the observed Windows system-menu Maximize action before taking a fresh observation. This restores maximization before document input, but does not prevent the transient shrink. No native executable patch was applied. Local skill guidance was adjusted only for this mitigation.
The exact internal cause is unconfirmed. These observations are from one PC; Windows/display compatibility or third-party window-management interference has not been ruled out. Single-monitor and second-PC controls have not been performed. Please confirm whether this is a native activation issue or whether additional environment diagnostics are needed.
Existing public issues were searched; no exact duplicate was identified. This differs from Codex itself losing maximization after an update/relaunch.
No account details, local usernames or file paths, window handles, session identifiers, screenshots, conversation transcripts, or raw logs are included in this report.
This report was organized and written with GPT-6 Astra.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with Paint or File Explorer using sky.list_windows(), sky.get_window(), sky.get_window_state(), sky.activate_window(), and sky.press_key(). Compare maximized state and bounds before and after background activation, including the automatic activation path. Done means explicit and automatic activation preserve the target's maximized or normal state and do not invalidate screenshot geometry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100