fix(sandbox): preserve zero exit code in E2B JSON stream - #2609
fix(sandbox): preserve zero exit code in E2B JSON stream#2609ump45nose wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes a proto3 default-value bug where an exitCode of 0 was silently dropped in the E2B JSON codec path. Root cause: DynamicMessage.hasField() returns false for proto3 non-optional scalar fields set to their default value, and getAllFields() omits default-valued fields. The fix is minimal, correct, and directly addresses issue #2603. A focused regression test is included. This also benefits the proto codec path where a binary-encoded EndEvent with exit_code=0 would also be missed.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes a proto3 default-value bug where an exitCode of 0 was silently dropped in the E2B JSON codec path. Root cause: DynamicMessage.hasField() returns false for proto3 non-optional scalar fields set to their default value, and getAllFields() omits default-valued fields. The fix is minimal, correct, and directly addresses issue #2603. A focused regression test is included. This also benefits the proto codec path where a binary-encoded EndEvent with exit_code=0 would also be missed.
AgentScope-Java Version
2.0.1-SNAPSHOT
Description
Fixes #2603.
In
E2bCodec.JSONmode, an explicit{"end":{"exitCode":0}}frame was lost twice because proto3 does not include default scalar values ingetAllFields()and reports no scalar presence throughhasField(). As a result, successful commands kept the missing-exit sentinel and failed.This change:
endevent when an integerexitCodewas explicitly parsed, including zero;Related duplicate reports: #2601, #2602.
Tested with:
Result: 8 tests passed, including
jsonCodecPreservesZeroExitCode.Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:apply