Windows background task flashes console windows for some subprocess probes
Summary
On Windows, a ductor instance installed with uv tool install ductor and run as a background Scheduled Task can still flash a short-lived console/Windows Terminal window during startup or common bot actions.
This appears to happen because ductor correctly starts the background bot with pythonw.exe -m ductor_bot, but several non-interactive subprocess calls still launch console-subsystem executables without CREATE_NO_WINDOW.
Environment
- OS: Windows 11
- ductor: 0.18.0
- Python: 3.12.11
- Install mode:
uv tool install ductor - Background startup: Windows Task Scheduler
The scheduled task action is effectively:
%APPDATA%\uv\tools\ductor\Scripts\pythonw.exe -m ductor_bot
Actual behavior
While ductor is running in the background, a terminal/console window briefly flashes. I have noticed this around startup and common status/auth/model-check flows.
Expected behavior
When ductor is running as a background Windows task via pythonw.exe, non-interactive subprocesses should not create visible console windows.
Investigation notes
Some subprocess sites already pass the shared Windows creation flag:
creationflags=_CREATION_FLAGS
For example, the shared CLI executor and some provider subprocesses already do this.
However, several other non-interactive subprocess calls appear to omit it. Examples in 0.18.0:
ductor_bot/cli/auth.py_claude_cli_logged_in()runsclaude auth status_antigravity_cli_logged_in()runsagy models
ductor_bot/cli/gemini_utils.pynpm root -gnode --input-type=module ...
ductor_bot/infra/pidlock.py_is_process_alive_windows()runstasklist
ductor_bot/infra/process_tree.py_run_taskkill()runstaskkill_kill_ductor_exe_windows()runstasklist_kill_venv_python_windows()runspowershell
ductor_bot/infra/updater.py_run_upgrade_command()may runuv tool upgradeget_installed_version()runs a child Python process
These are the kinds of console-subsystem child processes that can become visible when the parent is pythonw.exe and there is no inherited console.
Why this looks source-side rather than uv-side
The uv.exe and generated console-script launchers are console-subsystem executables on Windows, so they can trigger a console if launched from a GUI/no-console parent. But the scheduled task itself is already configured to use pythonw.exe, which is correct. The remaining visible flashes seem to come from ductor's own child process creation paths that do not consistently apply the Windows hidden-window flag.
Possible fix
Centralize subprocess creation for non-interactive commands and apply CREATE_NO_WINDOW on Windows by default, e.g. via a helper wrapping:
subprocess.runsubprocess.check_outputsubprocess.Popenasyncio.create_subprocess_exec
Interactive subprocesses could explicitly opt out.
This would make the existing pythonw.exe Scheduled Task behavior consistently windowless.
Fixed in v0.18.1. All the non-interactive subprocess probes you listed (claude/agy auth checks, gemini npm/node discovery, pidlock tasklist, process_tree taskkill/tasklist/powershell, and the updater) now pass CREATE_NO_WINDOW via the shared infra/platform.py::CREATION_FLAGS, so a background bot started as pythonw.exe no longer flashes a console window. Your investigation notes made this a quick, targeted fix — thank you.
Release: https://github.com/PleasePrompto/ductor/releases/tag/v0.18.1