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

Aberta
#2,080 0 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@waldekmastykarz já está trabalhando nisso.

Desde 5/11/2026.

  • #2094 de @waldekmastykarz — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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".

Linguagem predominante
C#
Estrelas
841
Forks
90
Merge médio
2d 10h
PRs com merge (30d)
63

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de dotnet/dev-proxy

Todas as issues de dotnet/dev-proxy

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.