Skip to content

fix(sandbox-e2b): preserve zero exit codes in envd streams - #2804

Open
mikemikimike wants to merge 4 commits into
agentscope-ai:mainfrom
mikemikimike:fix/e2b-exit-code-zero-2793
Open

fix(sandbox-e2b): preserve zero exit codes in envd streams#2804
mikemikimike wants to merge 4 commits into
agentscope-ai:mainfrom
mikemikimike:fix/e2b-exit-code-zero-2793

Conversation

@mikemikimike

Copy link
Copy Markdown

Summary

Fixes #2793.

E2bEnvdProcessClient incorrectly relies on protobuf field presence for the proto3 scalar exit_code. That causes JSON exitCode: 0 end events to be dropped, and causes both JSON and binary streams to retain Integer.MIN_VALUE instead of the successful exit code.

This change:

  • preserves an end event when JSON explicitly contains exitCode, including 0;
  • reads the proto3 scalar default unconditionally from parsed end events;
  • adds a regression test through the JSON stream-draining path.

Validation

  • mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b -am -Dspotless.check.skip=true -Dtest=E2bEnvdProcessClientTest -Dsurefire.failIfNoSpecifiedTests=false test — 8 passed
  • mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b spotless:check — passed
  • git diff --check — passed

The Maven commands were run with JDK 21 because the repository's Spotless plugin requires Java 17+; the shell's default JAVA_HOME points to JDK 8.

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/extensions/sandbox/e2b/E2bEnvdProcessClient.java 33.33% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sandbox-e2b): E2bEnvdProcessClient drops the end event when exit_code is 0 - every successful command is reported as a failure

1 participant