agentscope-ai / agentscope-ai/agentscope-java

[Bug]:LocalFilesystemWithShell can deadlock when shell command writes large stdout/stderr

Aberta
#1,519 2 comentários 0 reações 0 responsáveis Ver no GitHub
area/harness bug
Linguagem predominante
Java
Estrelas
5.6k
Forks
1.3k
Merge médio
4d 12h
PRs com merge (30d)
77

Descrição

**AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.**

**Describe the bug**
When using HarnessAgent with `LocalFilesystemWithShell`, shell commands that produce more output than the OS pipe buffer can hang until timeout. `LocalFilesystemWithShell.execute` currently calls `Process.waitFor(...)` before reading stdout/stderr. If a Python script or other command writes enough data to fill the pipe, the child process blocks waiting for Java to drain the pipe, while Java is waiting for the process to exit.

**To Reproduce**
Steps to reproduce the behavior:

1. Configure a HarnessAgent with the local filesystem shell backend.
2. Execute a command that writes large stdout, for example a Python script printing a large string.
3. The command times out even though the script itself should finish quickly.

**Expected behavior**
The parent Java process should drain stdout and stderr while waiting for the child process, so large command output does not deadlock execution.

**Error messages**
The command returns a timeout message from the harness shell execution path.

**Environment (please complete the following information):**

- AgentScope-Java Version: 1.1.0-SNAPSHOT
- Java Version: 17
- OS: macOS / Linux

**Additional context**
`ShellCommandTool` already avoids this pattern by starting asynchronous stream readers immediately after `ProcessBuilder.start()`.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

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