fix(harness): bound LocalFilesystemWithShell output capture - #2853
Open
guslegend0510 wants to merge 2 commits into
Open
fix(harness): bound LocalFilesystemWithShell output capture#2853guslegend0510 wants to merge 2 commits into
guslegend0510 wants to merge 2 commits into
Conversation
Drain stdout/stderr on daemon threads concurrently with Process.waitFor. Previously a child writing more than the OS pipe buffer (~4 KB on Windows, 64 KB on Linux) blocked in write() while the parent blocked in waitFor(), deadlocking until the command was forcibly killed and misreported as a timeout (exit 124). Mirrors the fix already applied to ShellCommandTool in agentscope-core. Adds a regression test that prints ~70 KB from the shell and asserts the command completes with exit 0 and full output. Fixes agentscope-ai#2838
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up on #2839 and address the output-capture lifecycle issues tracked in #2850.
Future-based completion.124for command timeouts and restore the caller's interrupt flag.Dependency
This PR depends on #2839.
Because #2839 has not merged yet, this branch currently contains its prerequisite pipe-deadlock commit. After #2839 is merged, the branch will be rebased and the duplicate prerequisite commit will be dropped.
Validation
LocalFilesystemWithShellTest: 13 tests passedagentscope-core: 2294 passed, 9 skippedagentscope-harness: 851 passed, 3 skippedgit diff --checkpassedDraft follow-ups
Before marking this PR ready for review:
IOExceptions instead of treating partial capture as successful.ProcessHandle.descendants()cannot guarantee cleanup after the parent has exited or descendants have been reparented.Refs #2850
Depends on #2839