openai / openai/codex-plugin-cc

Windows: broker child processes leak and stale broker.json poisons setup tests on persistent machines

Open
#487 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Two related Windows process-hygiene gaps found while running the suite repeatedly on a persistent (non-CI) Windows 11 box. Both are pre-existing (independent of any local change) and reproducible.

1. Stale broker.json poisons setup-family tests

%TEMP%\codex-companion\<repo-hash>\broker.json persists across runs and can point at a dead broker PID / stale named pipe. The setup-family tests key shared state on the real repo path (the test fixture's buildEnv() inherits process.env unmodified rather than using an ephemeral fixture dir), so a stale pointer makes every subsequent run report false "not ready" results. Symptom: ~6 spurious failures that vanish permanently after deleting that one directory. On ephemeral CI this is masked because the temp dir is always fresh.

Suggested fix: have the setup tests use an isolated $TEMP/HOME per run, or validate/ignore a broker.json whose PID is dead before treating it as authoritative.

2. Broker child processes leak on Windows

Repeated test runs accumulate orphaned app-server-broker.mjs node children (observed ~200 after a day of runs), each holding its temp workspace open. Same family as the known taskkill /T /F flake ("operation attempted is not supported" on a nested child). Correctness impact is low (each is isolated to a random temp workspace), but it blocks git worktree remove on any worktree a broker still holds open, and exhausts the process table over time.

Environment: Windows 11, codex-cli 0.144.1, plugin at current main. Happy to provide fuller repro details.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the setup-family tests and their buildEnv() path, then inspect how they consume %TEMP%\codex-companion<repo-hash>\broker.json. Trace cleanup for app-server-broker.mjs, including the existing taskkill /T /F handling. Done means repeated Windows runs neither trust dead broker state nor leave broker child processes holding workspaces open.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
operating-systems, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.