fix(e2b): add connect json codec support#1844
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 adds application/connect+json codec support for the E2B envd process.Process/Start endpoint, enabling compatibility with envd implementations (e.g., Alibaba Cloud FC envd v0.5.2) that only accept JSON. The change is well-structured: a new E2bCodec enum is threaded through E2bSandboxClientOptions, E2bSandboxState, and E2bFilesystemSpec; the core encoding/decoding logic in E2bEnvdProcessClient branches on the codec with clean helper methods; backward compatibility is preserved (default remains PROTO). Tests cover the key happy-path scenarios. One defensive-programming gap around Base64 decoding and a minor test-coverage gap are noted below.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds application/connect+json codec support for the E2B envd process.Process/Start endpoint, enabling compatibility with envd implementations (e.g., Alibaba Cloud FC envd v0.5.2) that only accept JSON. The change is well-structured: a new E2bCodec enum is threaded through E2bSandboxClientOptions, E2bSandboxState, and E2bFilesystemSpec; the core encoding/decoding logic in E2bEnvdProcessClient branches on the codec with clean helper methods; backward compatibility is preserved (default remains PROTO). Tests cover the key happy-path scenarios. One defensive-programming gap around Base64 decoding and a minor test-coverage gap are noted below.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
All previously raised review comments have been addressed.
Summary
Fix E2B envd command execution for environments that only accept
application/connect+json(for example Alibaba Cloud FC envd v0.5.2).Changes
E2bCodecwith defaultPROTOE2bFilesystemSpec/E2bSandboxClientOptionsconfigurable for codec selectionE2bSandboxClient/E2bSandboxStateE2bEnvdProcessClientto emitconnect+jsonrequests and parse JSON responses when configuredVerification
mvn -DskipTests compilemvn test -Dtest=E2bEnvdProcessClientTest,E2bSnapshotRefsTestCloses #1842