diff --git a/examples/control_plane/status-projection-cache-smoke.py b/examples/control_plane/status-projection-cache-smoke.py index 18366b2f84..9283f05de1 100644 --- a/examples/control_plane/status-projection-cache-smoke.py +++ b/examples/control_plane/status-projection-cache-smoke.py @@ -94,6 +94,10 @@ def run_cli_result( ) -> tuple[dict[str, Any], int, str]: env = os.environ.copy() env["PYTHONPATH"] = str(REPO_ROOT) + # This smoke reads machine JSON and asserts the inline decision/cache fields; + # the model-facing capture transport replaces that body with a reader + # reference, so keep the same opt-out the canary harness uses in argv. + env["LOOPX_CONTEXT_DELIVERY"] = "off" result = subprocess.run( [ sys.executable, diff --git a/examples/control_plane/status-quota-perf-budget-smoke.py b/examples/control_plane/status-quota-perf-budget-smoke.py index 98840073cd..3fc0cd9eee 100644 --- a/examples/control_plane/status-quota-perf-budget-smoke.py +++ b/examples/control_plane/status-quota-perf-budget-smoke.py @@ -112,6 +112,10 @@ def run_cli_result( ) -> tuple[dict[str, Any], float, int, str]: env = os.environ.copy() env["PYTHONPATH"] = str(REPO_ROOT) + # This smoke measures status/quota decision latency and reads the inline + # `should_run` field; the model-facing capture transport replaces that body + # with a reader reference, so keep the same opt-out the canary harness uses. + env["LOOPX_CONTEXT_DELIVERY"] = "off" started = time.perf_counter() result = subprocess.run( [ diff --git a/examples/control_plane/todo_lifecycle_fixtures.py b/examples/control_plane/todo_lifecycle_fixtures.py index b1a813dbc4..7dc4cc838f 100644 --- a/examples/control_plane/todo_lifecycle_fixtures.py +++ b/examples/control_plane/todo_lifecycle_fixtures.py @@ -5,9 +5,11 @@ import contextlib import io import json +import os import sys import tempfile from pathlib import Path +from unittest.mock import patch REPO_ROOT = Path(__file__).resolve().parents[2] @@ -126,7 +128,11 @@ def run_fixture_cli( ] stdout = io.StringIO() stderr = io.StringIO() - with contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr): + # These fixtures consume machine JSON and read the inline decision fields; + # the model-facing capture transport replaces that body with a reader + # reference, so opt out in-process the way the canary harness does in argv. + with patch.dict(os.environ, {"LOOPX_CONTEXT_DELIVERY": "off"}), \ + contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr): try: returncode = loopx_cli_main(argv) except SystemExit as exc: diff --git a/examples/custom-runtime-minimal-cli-turn-smoke.py b/examples/custom-runtime-minimal-cli-turn-smoke.py index 8299bc7afb..bfa3f6b9f7 100755 --- a/examples/custom-runtime-minimal-cli-turn-smoke.py +++ b/examples/custom-runtime-minimal-cli-turn-smoke.py @@ -13,10 +13,12 @@ import contextlib import io import json +import os import sys import tempfile from pathlib import Path from typing import Any +from unittest.mock import patch REPO_ROOT = Path(__file__).resolve().parents[1] if str(REPO_ROOT) not in sys.path: @@ -62,7 +64,10 @@ def run_cli(registry_path: Path, *args: str) -> dict[str, Any]: *args, ] buf = io.StringIO() - with contextlib.redirect_stdout(buf): + # This smoke reads machine JSON and asserts the inline decision fields; the + # model-facing capture transport replaces that body with a reader reference, + # so opt out in-process the way the canary harness does in argv. + with patch.dict(os.environ, {"LOOPX_CONTEXT_DELIVERY": "off"}), contextlib.redirect_stdout(buf): code = loopx_cli_main(argv) raw = buf.getvalue().strip() payload: dict[str, Any] = json.loads(raw) if raw else {}