Conversation
…-shim/jobs spawns Several hot-path Command::new spawns lacked the Windows CREATE_NO_WINDOW creation flag. Since the spawning processes (the agentflare daemon, gateway-registry backend connections) are themselves console-less, Windows auto-allocates a fresh console window for every console-subsystem child spawned without this flag -- visible as a brief flash. Fixed spawn sites: - gateway-registry::ensure_connected -- downstream MCP backend respawns on circuit-breaker/timeout - flare-git-shim::scope_check_deny_reason -- runs on every git command through the shim - ipc::process.rs -- is_alive/terminate_gracefully/force_kill/ list_pids_raw (tasklist/taskkill), backing daemon lifecycle - agentflare-jobs::Supervisor::spawn/kill_graceful -- dispatched by the daemon's own background discovery tick every 12s, independent of any active session, so this is the one most likely to explain flashes with no Claude Code session open at all
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughWindows subprocess launches and process-management commands now use ChangesWindows process visibility and repository resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…dundant spawns flare-git-core::shell::run_in/diff -- the shared git-execution primitive nearly everything in this crate goes through -- lacked CREATE_NO_WINDOW. Live-caught: the daemon was spawning 'git rev-parse --show-toplevel' via this path on essentially every project/item MCP call. AgentflareMcp::repo_root() now memoizes its result per-cwd instead of re-spawning git on every single call, cutting the actual spawn count (not just hiding the window). Keyed by cwd rather than a single cached value because cli::work::execute_work calls set_current_dir to switch into an item's worktree for in-process work-item execution -- a single-value cache would freeze on whatever cwd resolved first and silently break resolution for every worktree after that.
…y exec (#477) run_real is the shared PATH-shim passthrough every installed shim (agentflare-shim's generic cat/python/which/etc dispatch and flare-git-shim's final passthrough) funnels through on every invocation. PR #407 added CREATE_NO_WINDOW to 5 other spawn sites but missed this one, which dominates actual shim usage. Mirrors the no_console_window helper already used in flare-git-core::shell.rs. creation_flags only suppresses the auto-allocated console; .status()'s default stdio inheritance is untouched, so interactive passthrough is unaffected. Agentflare-Agent: claude-code Agentflare-Branch: task/464-windows-console-flash-agentflare-shim-s Agentflare-Item: 464
Summary
Command::newspawns on Windows never setCREATE_NO_WINDOW. Since the spawning processes (the agentflare daemon, gateway-registry backend connections) are themselves console-less, Windows auto-allocates a fresh console window for every console-subsystem child spawned without it -- visible as a brief flash.gateway-registry::ensure_connected-- downstream MCP backend respawns on circuit-breaker/timeoutflare-git-shim::scope_check_deny_reason-- runs on every git command through the shimipc::process.rs--is_alive/terminate_gracefully/force_kill/list_pids_raw(tasklist/taskkill), backing daemon lifecycleagentflare-jobs::Supervisor::spawn/kill_graceful-- dispatched by the daemon's own background discovery tick every 12s (spawn_supervisor_discovery), independent of any active session -- the one most likely to explain flashes with no Claude Code session open at allTest plan
cargo build(full workspace) -- succeedscargo clippy -p agentflare-gateway-registry -p flare-git-shim --all-features -- -D warnings -A unsafe_code -A clippy::pedantic-- cleancargo build -p agentflare-jobs-- clean (only pre-existing unrelated dead_code warning)cargo test -p agentflare --bin agentflare ipc::process-- 4/4 passedcargo test -p flare-git-shim-- 16/16 passedagentflare dev-install, restarted the daemon onto the new binary, confirmed binary mtime/size changed (not just trusting dev-install's own "ok installed" claim, which has a known false-positive bug)Summary by CodeRabbit
Bug Fixes
Performance