From d54d00bc98ec795333190fdbaf3ffd8e61bfb0c1 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Fri, 13 Nov 2026 08:59:25 -0800 Subject: [PATCH 1/2] test: the auto-release test's hold outlasts a round trip, and a trigger delay is timed from detection The auto-release test held Alt for 50 ms, so on a loaded runner the hold could end before the drag reached the queue, and the keys went up first. The hold is now 300 ms and the drag 1 s. The trigger-delay test measured the delay from the `delayed` event, which is stamped once the fire starts, a little after the provoking call the delay actually runs from; at 60x that came to 119.98 s. It now measures from `detected`. Co-Authored-By: Claude Opus 5.5 --- packages/agentenv-protocol/tests/test_computer_queue.py | 5 +++-- .../task_step/test_register_env_triggers_local.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/agentenv-protocol/tests/test_computer_queue.py b/packages/agentenv-protocol/tests/test_computer_queue.py index fdf6e1f36..c7f81519c 100644 --- a/packages/agentenv-protocol/tests/test_computer_queue.py +++ b/packages/agentenv-protocol/tests/test_computer_queue.py @@ -407,11 +407,12 @@ async def test_a_screenshot_that_fails_after_the_input_reports_the_input_as_done @pytest.mark.asyncio async def test_the_automatic_release_waits_out_a_busy_queue(): - driver = FakeDriver(settings=ComputerSettings(max_hold_ms=50, queue_wait_s=0.05)) + # A hold longer than a loaded runner's round trip lets the drag take the queue first; the drag outlasts the hold. + driver = FakeDriver(settings=ComputerSettings(max_hold_ms=300, queue_wait_s=0.05)) async with mcp_session(driver) as session: await _shot(session) await session.call_tool("computer_keyboard_down", {"keys": ["Alt"]}) - driver.slow["drag"] = 0.4 + driver.slow["drag"] = 1.0 await session.call_tool("computer_drag", {"path": [[1, 1], [9, 9]]}) with anyio.fail_after(5): while driver.screen.held: diff --git a/tst/integration/task_step/test_register_env_triggers_local.py b/tst/integration/task_step/test_register_env_triggers_local.py index eb32ad96c..69f7ad533 100644 --- a/tst/integration/task_step/test_register_env_triggers_local.py +++ b/tst/integration/task_step/test_register_env_triggers_local.py @@ -163,9 +163,11 @@ async def test_a_reply_waits_its_delay_and_hours_and_its_writes_name_the_fire(it paced = [e for e in state["events"] if e["kind"] in ("delayed", "deferred", "action_ok")] assert [e["kind"] for e in paced] == ["delayed", "deferred", "action_ok"] - delayed, deferred, _ = paced + _, deferred, _ = paced assert deferred["until"] == "2026-10-14T09:00:00Z" - assert (_virtual(deferred) - _virtual(delayed)).total_seconds() >= 120 + detected = next(e for e in state["events"] if e["kind"] == "detected" and e["trigger_id"] == "bob-hears-solver") + # The delay runs from the provoking call, read as it's detected, whose stamp can trail that reading a little at 60x. + assert (_virtual(deferred) - _virtual(detected)).total_seconds() >= 119 calls = [e for e in trajectory if e.get("event_type") == "tool_call"] cause = [{"trigger_id": "bob-hears-solver", "action_index": 0, "fire": 1}] assert ("list_items", "default", None) in [(e["tool_call"]["function_name"], e["role"], e.get("caused_by")) From 6005a244ced78a3c27ee586a70bfef4f5de437fb Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Fri, 13 Nov 2026 08:59:25 -0800 Subject: [PATCH 2/2] fix(agents): an installer's download gets one more go when curl fails curl's --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92), which failed Claude Code installs. --retry-all-errors needs curl 7.71, and an installer runs on hosts with any curl, so a failed fetch is tried once more instead. A second failure still stops the install with curl's own exit code. Co-Authored-By: Claude Opus 5.5 --- src/agent_env/agents/agents/claude-code/install.sh | 3 ++- src/agent_env/agents/agents/codex/install.sh | 3 ++- src/agent_env/agents/agents/gemini/install.sh | 3 ++- src/agent_env/agents/agents/letta-code/install.sh | 3 ++- src/agent_env/agents/agents/opencode/install.sh | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/agent_env/agents/agents/claude-code/install.sh b/src/agent_env/agents/agents/claude-code/install.sh index ec0ea30ce..fe35f29be 100755 --- a/src/agent_env/agents/agents/claude-code/install.sh +++ b/src/agent_env/agents/agents/claude-code/install.sh @@ -75,7 +75,8 @@ if ! on 'for shell in bash zsh; do command -v "$shell" >/dev/null && exit 0; don fi sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } -fetch() { curl -fsSL --retry 3 "$1" -o "$2"; } +# One more go when curl fails: --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92). +fetch() { curl -fsSL --retry 3 "$1" -o "$2" || { sleep 2; curl -fsSL --retry 3 "$1" -o "$2"; }; } checked() { # checked FILE SHA256: FILE is what was published, or the install stops [ "$(sha256 "$1")" = "$2" ] || { echo "$(basename "$1") doesn't match its published checksum" >&2; exit 1; } } diff --git a/src/agent_env/agents/agents/codex/install.sh b/src/agent_env/agents/agents/codex/install.sh index 7e43520ab..247328b84 100755 --- a/src/agent_env/agents/agents/codex/install.sh +++ b/src/agent_env/agents/agents/codex/install.sh @@ -78,7 +78,8 @@ if ! on 'command -v bash >/dev/null'; then fi sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } -fetch() { curl -fsSL --retry 3 "$1" -o "$2"; } +# One more go when curl fails: --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92). +fetch() { curl -fsSL --retry 3 "$1" -o "$2" || { sleep 2; curl -fsSL --retry 3 "$1" -o "$2"; }; } checked() { # checked FILE SHA256: FILE is what was published, or the install stops [ "$(sha256 "$1")" = "$2" ] || { echo "$(basename "$1") doesn't match its published checksum" >&2; exit 1; } } diff --git a/src/agent_env/agents/agents/gemini/install.sh b/src/agent_env/agents/agents/gemini/install.sh index 97c2e5c78..9f7b00d1a 100755 --- a/src/agent_env/agents/agents/gemini/install.sh +++ b/src/agent_env/agents/agents/gemini/install.sh @@ -78,7 +78,8 @@ if ! on 'command -v bash >/dev/null'; then fi sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } -fetch() { curl -fsSL --retry 3 "$1" -o "$2"; } +# One more go when curl fails: --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92). +fetch() { curl -fsSL --retry 3 "$1" -o "$2" || { sleep 2; curl -fsSL --retry 3 "$1" -o "$2"; }; } checked() { # checked FILE SHA256: FILE is what was published, or the install stops [ "$(sha256 "$1")" = "$2" ] || { echo "$(basename "$1") doesn't match its published checksum" >&2; exit 1; } } diff --git a/src/agent_env/agents/agents/letta-code/install.sh b/src/agent_env/agents/agents/letta-code/install.sh index 7197ad116..ee3fd9fd2 100644 --- a/src/agent_env/agents/agents/letta-code/install.sh +++ b/src/agent_env/agents/agents/letta-code/install.sh @@ -87,7 +87,8 @@ if ! on 'command -v git >/dev/null'; then fi sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } -fetch() { curl -fsSL --retry 3 "$1" -o "$2"; } +# One more go when curl fails: --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92). +fetch() { curl -fsSL --retry 3 "$1" -o "$2" || { sleep 2; curl -fsSL --retry 3 "$1" -o "$2"; }; } checked() { # checked FILE SHA256: FILE is what was published, or the install stops [ "$(sha256 "$1")" = "$2" ] || { echo "$(basename "$1") doesn't match its published checksum" >&2; exit 1; } } diff --git a/src/agent_env/agents/agents/opencode/install.sh b/src/agent_env/agents/agents/opencode/install.sh index 47b82ae29..678ff410f 100755 --- a/src/agent_env/agents/agents/opencode/install.sh +++ b/src/agent_env/agents/agents/opencode/install.sh @@ -78,7 +78,8 @@ if ! on 'command -v bash >/dev/null'; then fi sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } -fetch() { curl -fsSL --retry 3 "$1" -o "$2"; } +# One more go when curl fails: --retry passes over some transient failures, such as a reset HTTP/2 stream (exit 92). +fetch() { curl -fsSL --retry 3 "$1" -o "$2" || { sleep 2; curl -fsSL --retry 3 "$1" -o "$2"; }; } checked() { # checked FILE SHA256: FILE is what was published, or the install stops [ "$(sha256 "$1")" = "$2" ] || { echo "$(basename "$1") doesn't match its published checksum" >&2; exit 1; } }