From 9ad3cd9df23949746ecceb597d522a0292e6bda0 Mon Sep 17 00:00:00 2001 From: clawmetry-autofix Date: Tue, 25 Aug 2026 12:55:48 +0000 Subject: [PATCH 1/3] fix(nemoclaw): fall back to sandbox exec when host path yields no gateway logs (#5192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For container-isolated NemoClaw sandboxes, /tmp/gateway.log lives inside the container filesystem and is invisible to host-path reads. Record how many OCSF events the host-path branch adds; if it adds nothing and no OPENSHELL_GATEWAY_LOG override is set, run `openshell sandbox exec -n -- tail -n /tmp/gateway.log` to fetch the log from inside the container — matching the harness's own log-fetch path in test/cli/logs.test.ts. Closes #5192 Co-Authored-By: ClawMetry Autofix Bot --- clawmetry/adapters/openclaw.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/clawmetry/adapters/openclaw.py b/clawmetry/adapters/openclaw.py index a0352400e1..0c8155f44d 100644 --- a/clawmetry/adapters/openclaw.py +++ b/clawmetry/adapters/openclaw.py @@ -792,6 +792,7 @@ def _openshell_sandbox_logs(name: str, count: int = 20) -> list: [_gw_log_override] if _gw_log_override else _gateway_log_files() ) _gw_log_path = _gw_candidates[-1] if _gw_candidates else None + _gw_events_before = len(events) if _gw_log_path: try: with open(_gw_log_path, "r", encoding="utf-8", errors="replace") as _gf: @@ -806,6 +807,29 @@ def _openshell_sandbox_logs(name: str, count: int = 20) -> list: pass except OSError: pass + # For genuinely container-isolated sandboxes the host path has no + # visibility into the container filesystem. Fall back to reading + # /tmp/gateway.log from inside the container via `sandbox exec`, + # matching the harness's own fetch path in test/cli/logs.test.ts + # (#5192). Skip when OPENSHELL_GATEWAY_LOG is set so test fixtures + # that override the path keep working. + if len(events) == _gw_events_before and not _gw_log_override: + try: + _exec_res = _sp.run( + ["openshell", "sandbox", "exec", "-n", name, + "--", "tail", "-n", str(count), "/tmp/gateway.log"], + capture_output=True, text=True, timeout=10, + ) + for _exec_line in (_exec_res.stdout or "").splitlines(): + _exec_line = _exec_line.strip() + if not _exec_line: + continue + try: + events.append(json.loads(_exec_line)) + except Exception: + pass + except Exception: + pass return events except Exception: return [] From db1b95efdb39643a3552494f28e6dcd2e81344af Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 27 Aug 2026 03:20:32 +0000 Subject: [PATCH 2/3] fix(nemoclaw): reduce sandbox exec timeout to 3s to fix OSS golden path When openshell is installed but the sandbox container does not exist, `sandbox exec -n ` hangs for the full timeout before exiting. With multiple seeded sessions in test_sessions_seeded_in_duckdb, the 10s-per-call cost stacked and blew the Playwright assertion deadline. 3s is ample for a real tail call into a running container. --- clawmetry/adapters/openclaw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clawmetry/adapters/openclaw.py b/clawmetry/adapters/openclaw.py index 0c8155f44d..e287bbdf42 100644 --- a/clawmetry/adapters/openclaw.py +++ b/clawmetry/adapters/openclaw.py @@ -818,7 +818,7 @@ def _openshell_sandbox_logs(name: str, count: int = 20) -> list: _exec_res = _sp.run( ["openshell", "sandbox", "exec", "-n", name, "--", "tail", "-n", str(count), "/tmp/gateway.log"], - capture_output=True, text=True, timeout=10, + capture_output=True, text=True, timeout=3, ) for _exec_line in (_exec_res.stdout or "").splitlines(): _exec_line = _exec_line.strip() From 6ade7df763debcf454fa187ad1603140ab54ac99 Mon Sep 17 00:00:00 2001 From: Vivek Chand Date: Thu, 27 Aug 2026 12:30:46 +0000 Subject: [PATCH 3/3] ci: re-trigger E2E Gate (stale required check)