fix(sandbox-e2b): reliable exec timeout with server-side kill - #2976
fix(sandbox-e2b): reliable exec timeout with server-side kill#2976chcodex wants to merge 1 commit into
Conversation
75090ec to
b64ed41
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
CryoThrust
left a comment
There was a problem hiding this comment.
One small robustness concern: res.body().string() is now unconditional in the non-success response path. OkHttp permits a response with a null body (for example a 204/transport edge or a test double), so this can replace the intended SandboxRuntimeException with an NPE. Keeping the previous null-safe fallback (res.body() != null ? res.body().string() : "") would preserve the error contract while still including the server body when present. A regression test with a non-success response and no body would pin this.
|
@CryoThrust Thanks for flagging this. The null guard was removed deliberately:
|
- agentscope-ai#2196: pass username query param in e2b filesystem REST calls (filesUrl helper plus URL assertions and workspace state setup) - agentscope-ai#2555: drop dead snapshot-timestamp helpers from E2bPlatformHttp, restore coverage tests plus InputStream close fix - agentscope-ai#2976: reliable e2b exec timeout with server-side kill (callTimeout plus readTimeout(0), Connect-Timeout-Ms header, interrupt-bit handling) plus its tests - E2bEnvdProcessClientTest: align three stale drain tests with the merged upstream agentscope-ai#2828 reject-without-exit-code behavior
Fixes #2974.
readTimeout=0) so total-duration semantics is owned solely bycallTimeout; previously a small basereadTimeoutpreemptedcallTimeoutand misreported a short idle stall as a full exec timeout (both surface asInterruptedIOException).Connect-Timeout-Msso envd kills the remote process server-side; previously a client timeout only dropped our HTTP stream and leaked the process.Thread.interrupt()) is rethrown as-is with the interrupt bit restored instead of being wrapped asExecTimeoutException.timeoutSeconds <= 0now fails fast withIllegalArgumentException.E2bEnvdProcessClientTest10/10 pass (4 new: header carried end-to-end, interruption rethrown with bit restored, fail-fast without request; plus existing codec/drain cases). Full reactortestBUILD SUCCESS.