Skip to content

Windows: opening the dashboard spawns a visible console for the Codex CLI status check #22

Description

@halr9000

Watching process creation while opening the dashboard, codex-x86_64-pc-windows-msvc.exe spawns as a direct child of Token Meter's server process about a second after the page loads, with its own new conhost.exe. That causes a momentary flash as the console window opens and closes quickly.

Cause: page.html:5117 calls loadAgentAccess() unconditionally at the bottom of the page script, so it runs on every dashboard load, not just when the Settings > Agent connection panel is visible. That fires fetch('/agent-access/status') (page.html:2305), which hits agent_access_client_status("codex", ...) server-side (token_meter/app.py:5000): runner([cli_path, "mcp", "get", AGENT_ACCESS_SERVER, "--json"], ...), plain subprocess.run with no window-hiding options. Same gap as #19, different call site. If Codex CLI is installed, every dashboard load spawns it in a visible console.

Fix: route this subprocess.run call through WindowsPlatformServices.process_options() (token_meter/platforms/windows.py:62) for CREATE_NO_WINDOW on Windows, same as #19. Worth also considering calling loadAgentAccess() only when the settings panel is opened, since /agent-access/status currently runs unconditionally on every load.

Environment

  • Windows 11 Pro, build 10.0.26200
  • Token Meter revision 0361558 (main, 2026-08-14)
  • Codex CLI installed and on PATH (codex-x86_64-pc-windows-msvc.exe)

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