Windows popup suppression, Night Shift improvements#4
Merged
AlanKharebov merged 7 commits intomainfrom Mar 25, 2026
Merged
Conversation
- Create subprocess_utils.py with no_window_flags() helper - Apply CREATE_NO_WINDOW to all subprocess.run/Popen calls across 17 files - Monkey-patch anyio.open_process in Claude SDK adapter for headless ops - Fix claude_agent_sdk.py default model: use CLAUDE_MODEL env var instead of hardcoded claude-opus-4-6
…ess buffer to 5000 - Return 400 if no heads are active when triggering Night Shift - Increase progress deque from 100 to 5000 to prevent event loss on large runs
…harvest - Add on_progress callback to harvest_all() - Emit per-project events with project name, index, total, and file count
…on stages - Add on_chunk_progress callback to base extractor map_generate() - All 4 extractors pass chunk progress callback through - stages_early emits file_start/file_done for each extraction + passes on_progress to harvester
There was a problem hiding this comment.
Pull request overview
Restores several operational fixes that were lost during a reset, primarily focused on Windows subprocess popup suppression and richer Night Shift progress/guard behavior.
Changes:
- Introduces
multihead.subprocess_utils.no_window_flags()and applies it broadly to subprocess invocations to suppress Windows console popups. - Adds Night Shift “active head required” guard and increases progress history retention.
- Adds progress event emission for session harvesting and extraction stages (via
on_progress/on_chunk_progressplumbing).
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/0-nano/test_subprocess_utils.py | Adds unit tests for no_window_flags() behavior. |
| src/multihead/subprocess_utils.py | Introduces no_window_flags() helper. |
| src/multihead/shell/core.py | Applies no_window_flags() to subprocess usage. |
| src/multihead/shell/context.py | Applies no_window_flags() to subprocess usage while gathering repo context. |
| src/multihead/session_harvester/harvester.py | Adds on_progress callback + emits project_start/project_done. |
| src/multihead/resource_monitor.py | Applies no_window_flags() to nvidia-smi probe subprocess. |
| src/multihead/resilience.py | Applies no_window_flags() to subprocess resource checks. |
| src/multihead/night_shift/stages_late.py | Applies no_window_flags() to git subprocess call. |
| src/multihead/night_shift/stages_early.py | Wires harvesting progress + emits extraction stage progress events and chunk progress callbacks. |
| src/multihead/narrative/source_extractors/git_extractor.py | Applies no_window_flags() to git subprocess calls. |
| src/multihead/mcp_server/_tools_decompose.py | Applies no_window_flags() to subprocess-based decomposition path. |
| src/multihead/init_wizard/hardware.py | Applies no_window_flags() to hardware detection subprocess calls. |
| src/multihead/github_integration.py | Applies no_window_flags() to git/gh subprocess calls. |
| src/multihead/extractors/topic_assigner.py | Passes through on_chunk_progress to base generator map. |
| src/multihead/extractors/test_results_extractor.py | Applies no_window_flags() to long-running test subprocess. |
| src/multihead/extractors/event_extractor.py | Passes through on_chunk_progress to base generator map. |
| src/multihead/extractors/entity_extractor.py | Passes through on_chunk_progress to base generator map. |
| src/multihead/extractors/claim_extractor.py | Passes through on_chunk_progress to base generator map. |
| src/multihead/extractors/ci_extractor.py | Applies no_window_flags() to gh CLI subprocess calls. |
| src/multihead/extractors/base.py | Adds on_chunk_progress parameter and triggers it (currently only in sequential path). |
| src/multihead/diagnostics.py | Applies no_window_flags() to diagnostics subprocess usage. |
| src/multihead/claim_corroboration.py | Applies no_window_flags() to git subprocess calls. |
| src/multihead/autonomous_executor/strategies.py | Applies no_window_flags() to subprocess execution. |
| src/multihead/api/routes_system.py | Uses no_window_flags() in restart subprocess flags. |
| src/multihead/api/routes_nightshift.py | Adds active-head guard, returns 400 on no active heads, increases progress deque length. |
| src/multihead/adapters/claude_agent_sdk.py | Aligns default model and monkey-patches anyio.open_process on Windows to suppress popups. |
| scripts/claude_worker.py | Applies no_window_flags() to worker subprocess calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CREATE_NO_WINDOW only exists on Windows — mock the attribute when running on Linux CI.
…tations, progress callback fix
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3
Summary
Suppress console popup windows on Windows and improve Night Shift reliability and progress reporting.
Popup suppression
subprocess_utils.pywith cross-platformno_window_flags()helperCREATE_NO_WINDOWto all 24 subprocess calls across 17 filesanyio.open_processpatch in Claude SDK adapter for subprocess window suppressionNight Shift improvements
project_start/project_doneevents during session harvestfile_start/file_done/chunk_progressevents during extraction stagesOther
claude-sonnet-4-6no_window_flags()Tests