Skip to content

Windows: runner heartbeat spawns node.exe with a visible flashing console window every ~20-30s #172

Description

@saltbo

Summary

On Windows, the machine runner (ama-runner.exe) spawns a short-lived node.exe child process roughly every 20–30 seconds (runtime heartbeat / availability probe). Each spawn allocates a new console window (conhost.exe), so the user sees a cmd/console window flash on screen every ~20–30 seconds for as long as the runner daemon is running. Functionality is unaffected; it is a constant visual disturbance.

Command

ak start

(daemon running normally afterwards; the flashing starts as soon as the runner is online)

Expected

Background child processes spawned by the runner are invisible — no console window appears. This is what ak itself already does for the daemon process (the CLI passes windowsHide: true when spawning the runner in packages/cli/src/commands/start.ts).

Actual

Every ~20–30s a console window flashes and disappears. Process monitoring shows:

node.exe   (parent = ama-runner.exe, the runner daemon PID)
└─ conhost.exe   ← the visible flashing console window

Captured twice within a 45-second observation window; the node.exe child lives for well under a second (its command line could not even be sampled via WMI before exit). Timing matches the runner's runtime heartbeat, which probes the installed runtime CLIs (claude-code, codex, copilot) — these are Node.js programs on Windows, so each probe launches node.exe.

For comparison, Docker Desktop performs similar periodic child-process probes (docker stats) on the same machine with no visible window, because it creates its children with a hidden console.

Likely cause / suggested fix

ama-runner (Go) appears to spawn child processes without suppressing console allocation on Windows. Setting syscall.SysProcAttr{HideWindow: true, CreationFlags: windows.CREATE_NO_WINDOW} on the exec.Cmd used for runtime probes (and any other periodic child spawns) should fix it. macOS/Linux are unaffected, which is probably why this went unnoticed.

Context

  • ak version: 1.15.0
  • ama-runner: 0.7.0 (3f1b968, built 2026-07-18T04:35:57Z)
  • OS: Windows 11 Home 10.0.26200
  • Runtime: claude (installed via npm, claude.cmd shim → node)
  • Auth type: machine
  • Providers reported by runner: codex, claude-code, copilot

Reproduction

  1. On Windows 11, install agent-kanban globally via npm (Node runtimes such as Claude Code installed via npm as well).
  2. ak start and complete AMA device login; runner goes online.
  3. Watch the screen (or monitor process creation): a node.exe + conhost.exe pair is created by ama-runner.exe every ~20–30s, flashing a console window each time.

Activity

saltbo commented on Sep 6, 2026

@saltbo
CollaboratorAuthor

@LionLai please watch this issue

realmroot commented on Sep 13, 2026

@realmroot
Contributor

Maintainer triage against main 56caba41: the missing Windows background-process attributes remain in runtime/bridge.go (resolveNodeExecutable direct probe) and sys/processtree/process_windows.go (Start replaces SysProcAttr with only CREATE_NEW_PROCESS_GROUP). This is source-confirmed; no live Windows GUI reproduction was performed here. Current scheduling differs from the original report: the 20s heartbeat reads cached inventory and usage collection runs every 5 minutes. Created AK Task #108 (osm7gxwciwdg), assigned Ravi, to repair the background paths while preserving process-group/Job Object cancellation and verify with Windows tests. No duplicate fix PR was open.


🤖 Created by Jarvis via Realmroot

realmroot commented on Sep 13, 2026

@realmroot
Contributor

维护者验收完成:PR #175(67979d7d)仅隐藏 Node 探测及 inventory/usage 后台进程,正常会话保留原取消路径。补充了真实 Windows 父子进程就绪、句柄与退出断言;最新提交的 Windows/macOS 测试、覆盖率、打包及 CI Required 全部通过。AK #108 已完成,PR 尚未合并或发布。Windows 桌面视觉闪窗观察未在本机执行,PR 已提供明确的手动验收步骤。


🤖 Created by Jarvis via Realmroot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions