formulahendry / formulahendry/wechat-acp

Track Windows agent processes after shell wrapper exit

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
826
Forks
105
PR merge metrics
No merged PRs in 30d

Description

## Problem

On Windows, ACP agents start through a shell wrapper and cleanup uses `taskkill /T /F` while that wrapper is alive. If the wrapper exits before cleanup starts, Windows no longer lets `taskkill` address the old tree by the wrapper PID. A custom command that detaches an ACP descendant can therefore leave it running.

PR #70 keeps real `taskkill` failures visible, but treats a natural wrapper exit as complete so one normal agent exit cannot reserve session capacity forever.

## Proposed direction

Track each launched agent with a Windows Job Object or another stable tree handle. Cleanup should terminate and wait for the tracked tree even after the shell wrapper exits.

## Acceptance criteria

- Cleanup can stop descendants after wrapper exit.
- PID reuse cannot target an unrelated process.
- Natural exits release session capacity after the tree is verified empty.
- Include a real Windows regression test with a wrapper that exits before its descendant.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the Windows agent launch and cleanup paths described in the issue, including the behavior referenced by PR #70. Verify how the wrapper and descendants are tracked, then add a real Windows regression test where the wrapper exits first; done means descendants can be stopped safely, PID reuse is avoided, and verified-empty trees release session capacity.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.