`devproxy --detach` blocks callers that capture its output

Đang mở
#2,080 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@waldekmastykarz đang làm issue này rồi.

Từ ngày 5/11/2026.

  • #2094 của @waldekmastykarz — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

work in progress

Problem

On Windows, the agent ran:

devproxy --detach --no-first-run -c ..\devproxy\devproxyrc.json 2>&1 | Out-String

The command never returned: no output after 45 s, and the shell had to be killed. Dev Proxy itself was running. The agent abandoned --detach and wrote its own background-spawn logic.

The daemon is started with RedirectStandardOutput/Error = true (Program.cs). Likely cause: the detached child inherits the caller's pipe handles, so anything that reads the parent's output to EOF waits for the daemon to exit. This affects | Out-String, $(devproxy --detach) in bash, and subprocess or execSync with pipes. Not yet confirmed on macOS or Linux.

Proposal

  • Start the daemon with stdio fully detached (null, or the log file) and without inheriting the caller's handles.
  • Make sure the parent prints its startup info (PID, URLs, log file) and exits immediately.
  • Add an integration test that runs devproxy --detach through a captured pipe with a timeout. The existing ProcessSmokeTests cover --detach, but not with captured output.

Found while evaluating how coding agents use Dev Proxy: VS Code + GitHub Copilot Chat with Claude Sonnet 5.5, Dev Proxy 4.0.0 on Windows, 5 runs of the task "add a CI script that starts Dev Proxy in the background, starts and stops recording through the API around npm start, and shuts Dev Proxy down through the API".

Ngôn ngữ chính
C#
Star
841
Fork
90
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
63

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/dev-proxy

Tất cả issue của dotnet/dev-proxy

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.