Skip to content

fix(e2b): reject incomplete process streams without exit code - #2828

Merged
zouyx merged 7 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2824-e2b-missing-exit
Aug 25, 2026
Merged

fix(e2b): reject incomplete process streams without exit code#2828
zouyx merged 7 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2824-e2b-missing-exit

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

PR 描述

AgentScope-Java Version

2.0.3-SNAPSHOT

Description

Fixes #2824.

E2bEnvdProcessClient.drainStartStream() previously returned Integer.MIN_VALUE when the envd response stream ended before a process exit event was received.

The sentinel was then interpreted as a real non-zero process exit code, causing an incomplete transport response to be misreported as a command failure.

This change:

  • Removes the Integer.MIN_VALUE fallback.
  • Throws an explicit IOException when the stream ends without a process exit code.
  • Preserves valid zero and non-zero exit codes.
  • Adds regression coverage for EOF, truncated frame length, and truncated frame payload scenarios.

The missing exit code is treated as an incomplete transport response rather than being assumed to mean success.

Tests

Targeted tests:

mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b \
  -am \
  -Dtest=E2bEnvdProcessClientTest \
  -Dsurefire.failIfNoSpecifiedTests=false \
  test

Result: 10 tests passed.

Full module tests:

mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b \
  -am test

Results:

  • agentscope-core: 2294 tests, 0 failures
  • agentscope-harness: 834 tests, 0 failures
  • agentscope-extensions-sandbox-e2b: 14 tests, 0 failures

Checklist

  • Code is formatted with Spotless
  • Targeted and module tests pass
  • No public API changes
  • Ready for review

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zouyx zouyx self-assigned this Aug 25, 2026
@zouyx zouyx added the bug Something isn't working label Aug 25, 2026
@zouyx
zouyx merged commit 4ba433a into agentscope-ai:main Aug 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: E2bEnvdProcessClient returns Integer.MIN_VALUE as fallback exit code

3 participants