Files
myclaude/codeagent-wrapper
makoMako 40e2d00d35 修复 Windows 后端退出:taskkill 结束进程树 + turn.completed 支持 (#108)
* fix(executor): handle turn.completed and terminate process tree on Windows

* fix: 修复代码审查发现的安全和资源泄漏问题

修复内容:
1. Windows 测试 taskkill 副作用:fake process 在 Windows 上返回 Pid()==0,避免真实执行 taskkill
2. taskkill PATH 劫持风险:使用 SystemRoot 环境变量构建绝对路径
3. stdinPipe 资源泄漏:在 StdoutPipe() 和 Start() 失败路径关闭 stdinPipe
4. stderr drain 并发语义:移除 500ms 超时,确保 drain 完成后再访问共享缓冲

测试验证:
- go test ./... -race 通过
- TestRunCodexTask_ForcesStopAfterTurnCompleted 通过
- TestExecutorSignalAndTermination 通过

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>

---------

Co-authored-by: cexll <evanxian9@gmail.com>
Co-authored-by: SWE-Agent.ai <noreply@swe-agent.ai>
2026-01-08 10:33:09 +08:00
..