From 9acd0d33b61cd2ada6c3d98612c73c0ed12a4768 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 21 Sep 2026 11:12:41 -0700 Subject: [PATCH] fix(code_execution): heartbeat is a background-only terminal modifier, blocked in the sandbox The execute_code sandbox refuses background/notify modifiers on terminal(); heartbeat implies notify and rides the same delivery path, so it joins the blocked set (and the stub-drift test's mirror of it). --- tests/tools/test_code_execution.py | 2 +- tools/code_execution_rpc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tools/test_code_execution.py b/tests/tools/test_code_execution.py index 7ccb2b48b7..2d3ba82c92 100644 --- a/tests/tools/test_code_execution.py +++ b/tests/tools/test_code_execution.py @@ -428,7 +428,7 @@ class TestStubSchemaDrift(unittest.TestCase): # Parameters that are internal (injected by the handler, not user-facing) _INTERNAL_PARAMS = {"task_id", "user_task"} # Parameters intentionally blocked in the sandbox - _BLOCKED_TERMINAL_PARAMS = {"background", "pty", "notify", "notify_on_complete", "watch_patterns"} + _BLOCKED_TERMINAL_PARAMS = {"background", "pty", "notify", "notify_on_complete", "watch_patterns", "heartbeat"} def test_stubs_cover_all_schema_params(self): """Every user-facing parameter in the real schema must appear in the diff --git a/tools/code_execution_rpc.py b/tools/code_execution_rpc.py index eae6ccc6d8..c7bc1e9f3f 100644 --- a/tools/code_execution_rpc.py +++ b/tools/code_execution_rpc.py @@ -22,7 +22,7 @@ from tools.registry import tool_error logger = logging.getLogger("tools.code_execution_tool") # Terminal parameters that must not be used from ephemeral sandbox scripts. -_TERMINAL_BLOCKED_PARAMS = {"background", "pty", "notify", "notify_on_complete", "watch_patterns"} +_TERMINAL_BLOCKED_PARAMS = {"background", "pty", "notify", "notify_on_complete", "watch_patterns", "heartbeat"} def _default_dispatch(task_id):