fix(quickjs): correct eval await description (#4371)

Closes #4370

`render_eval_tool_description` said top-level `await` would not resolve,
contradicting the REPL behavior and system prompt. This updates the
public `eval` tool description to state that top-level `await` is
supported and that final-expression Promises resolve before returning.

Added a prompt-rendering regression assertion for all persistence modes.

Made by [Open
SWE](https://openswe.vercel.app/agents/d035df94-2193-26d9-cc9c-942e81cc54e9)

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This commit is contained in:
Hunter Lovell
2026-06-29 12:52:46 -07:00
committed by GitHub
parent 5e01fec72d
commit 4ab860f007
2 changed files with 4 additions and 1 deletions
@@ -364,7 +364,8 @@ def render_eval_tool_description(*, mode: Literal["thread", "turn", "call"]) ->
return (
"Execute JavaScript in a sandboxed REPL. "
f"{state_line} No filesystem, network, or real clock. "
"Synchronous only — top-level `await` will not resolve."
"Top-level `await` is supported; a final-expression Promise resolves "
"before the call returns."
)
@@ -89,4 +89,6 @@ def test_render_eval_tool_description_mode_specific(
) -> None:
description = render_eval_tool_description(mode=mode)
assert expected_fragment in description
assert "Top-level `await` is supported" in description
assert "will not resolve" not in description
assert description.startswith("Execute JavaScript in a sandboxed REPL.")