| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR addresses a Windows regression introduced in v1.2.6 where the opencode-cli sidecar process spawns a visible console window. The root cause was that the process-wrap library's JobObject wrapper overwrites creation flags set directly on Command. The fix implements a custom CommandWrapper that applies CREATE_NO_WINDOW after JobObject runs its pre_spawn hook, ensuring the flag is preserved.
Changes:
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/desktop/src-tauri/src/cli.rs | Adds custom CommandWrapper implementation and integrates it into wrapper chain after JobObject |
| packages/desktop/src-tauri/Cargo.toml | Adds windows crate dependency for Win32 API constants |
| packages/desktop/src-tauri/Cargo.lock | Updates lock file to reflect new windows dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| #[cfg(windows)] | ||
| impl CommandWrapper for WinCreationFlags { | ||
| fn pre_spawn(&mut self, command: &mut Command, _core: &CommandWrap) -> std::io::Result<()> { | ||
| command.creation_flags((CREATE_NO_WINDOW | CREATE_SUSPENDED).0); |
There was a problem hiding this comment.
The CREATE_SUSPENDED flag causes the process to start in a suspended state and requires an explicit ResumeThread call to begin execution. There is no code in this file that resumes the process after spawning. This will cause the sidecar process to hang indefinitely in a suspended state, making it completely non-functional. Remove CREATE_SUSPENDED from the creation flags and keep only CREATE_NO_WINDOW.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What does this PR do?
Fixes a Windows desktop regression where starting the local opencode-cli sidecar opens a visible console window.
Regression timeline (data-driven)
Root cause
When using process-wrap + JobObject on Windows, creation flags set directly on Command can be overwritten during wrapper pre_spawn handling, so CREATE_NO_WINDOW may be lost.
Fix approach
Apply Windows creation flags with process-wrap-aware ordering/handling so the spawned sidecar keeps CREATE_NO_WINDOW while preserving JobObject lifecycle behavior.
Verification