open-swe/agent
Johannes du Plessis 903c327e4c
fix: enforce client-side deadline on sandbox execute (#1451)
* fix: enforce client-side deadline on sandbox execute

The langsmith SDK's default execute path is now a WebSocket stream with
no client-side read deadline. On a live socket where the dataplane never
emits an exit/error frame, CommandHandle.result blocks forever in an
uncancellable thread, wedging the run (introduced by the langsmith
0.8.3 -> 0.8.8 bump in #1385). The command `timeout` is only enforced
server-side, so it doesn't fire.

TimeoutLangSmithSandbox drives a non-blocking CommandHandle and kills the
command if it overruns its timeout by a grace window
(SANDBOX_EXECUTE_CLIENT_GRACE_SECONDS, default 30), returning a timed-out
tool result instead of hanging. WS connect failures fall back to the base
wait=True path, whose HTTP fallback carries its own request deadline.

* fix: fall back to HTTP when WS execute connect fails

run(wait=False) eagerly opens the WebSocket and reads the "started" frame,
so connect/setup failures (and connect timeouts) raise from the run() call
itself, not from handle.result. The previous structure left run() outside
the try, so those failures bypassed the HTTP fallback and would fail every
sandbox command in any environment where the WS path is unavailable.

Move handle creation inside the fallback handler in both execute and
aexecute, and run it via to_thread in the async path since it now blocks on
connect. Add tests for connect-failure and connect-timeout fallback.

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-08 11:16:08 -07:00
..
dashboard fix: update sidebar thread activity indicators (#1441) 2026-06-08 10:38:31 -07:00
integrations fix: enforce client-side deadline on sandbox execute (#1451) 2026-06-08 11:16:08 -07:00
middleware feat: support dashboard chat images (#1435) 2026-06-06 11:50:24 -07:00
skills feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
tools feat: surface dashboard UI link on PR reviews [INF-0000] (#1440) 2026-06-07 05:17:09 +00:00
utils feat: surface dashboard UI link on PR reviews [INF-0000] (#1440) 2026-06-07 05:17:09 +00:00
analyzer.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
encryption.py feat: support TOKEN_ENCRYPTION_KEY rotation via MultiFernet [closes AB-2323] (#1275) 2026-05-08 14:29:23 -07:00
prompt.py fix: make default repository configurable (#1429) 2026-06-05 13:48:47 -07:00
review_style_collector.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
review_style_guidance.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewer.py feat: inject org-wide guidelines into reviewer prompt (#1431) 2026-06-05 13:49:30 -07:00
reviewer_diff.py feat: Inject PR title and body into reviewer context (#1368) 2026-06-01 21:06:19 +00:00
reviewer_findings.py feat: surface out-of-diff findings in a collapsed dropdown (#1427) 2026-06-05 10:41:48 -07:00
reviewer_publish.py fix: reword reviewer feedback prompt (#1449) 2026-06-08 10:02:02 -07:00
reviewer_reconcile.py feat: let reviewer set comment titles (#1356) 2026-05-28 16:04:38 -07:00
scheduler.py feat: add scheduled web agents (#1422) 2026-06-05 02:20:24 +00:00
server.py fix: make default repository configurable (#1429) 2026-06-05 13:48:47 -07:00
webapp.py feat: surface dashboard UI link on PR reviews [INF-0000] (#1440) 2026-06-07 05:17:09 +00:00