Skip to content

Windows popup suppression, Night Shift improvements#4

Merged
AlanKharebov merged 7 commits intomainfrom
cortex/suppress-popups-hardcoded-heads
Mar 25, 2026
Merged

Windows popup suppression, Night Shift improvements#4
AlanKharebov merged 7 commits intomainfrom
cortex/suppress-popups-hardcoded-heads

Conversation

@AlanKharebov
Copy link
Copy Markdown
Collaborator

@AlanKharebov AlanKharebov commented Mar 25, 2026

Closes #3

Summary

Suppress console popup windows on Windows and improve Night Shift reliability and progress reporting.

Popup suppression

  • New subprocess_utils.py with cross-platform no_window_flags() helper
  • Applied CREATE_NO_WINDOW to all 24 subprocess calls across 17 files
  • Lazy anyio.open_process patch in Claude SDK adapter for subprocess window suppression

Night Shift improvements

  • Require at least one active head before triggering (returns 400 otherwise)
  • Emit project_start/project_done events during session harvest
  • Emit file_start/file_done/chunk_progress events during extraction stages
  • Increase progress event buffer from 100 to 5000

Other

  • Align default model fallback to claude-sonnet-4-6
  • Unit test for no_window_flags()

Tests

  • Nano: 1444 passed
  • Micro: 1134 passed, 1 pre-existing failure (staleness_e2e)

- 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
Copilot AI review requested due to automatic review settings March 25, 2026 13:35
@AlanKharebov AlanKharebov changed the title fix: suppress subprocess popups, active head guard, Night Shift progress events Windows popup suppression, Night Shift improvements Mar 25, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_progress plumbing).

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.

Comment thread tests/0-nano/test_subprocess_utils.py Outdated
Comment thread src/multihead/subprocess_utils.py Outdated
Comment thread src/multihead/extractors/base.py
Comment thread src/multihead/night_shift/stages_early.py Outdated
Comment thread src/multihead/night_shift/stages_early.py
Comment thread src/multihead/api/routes_nightshift.py
Comment thread src/multihead/session_harvester/harvester.py Outdated
CREATE_NO_WINDOW only exists on Windows — mock the attribute
when running on Linux CI.
@AlanKharebov AlanKharebov merged commit cf3223b into main Mar 25, 2026
3 checks passed
@AlanKharebov AlanKharebov deleted the cortex/suppress-popups-hardcoded-heads branch March 25, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows popup suppression, Night Shift improvements

2 participants