Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

The execute path closes the turn's browser before the finalize too (#308)

github-actions[bot]2cdf1e51c8e7
diff --git a/gateway/app.py b/gateway/app.py
index 6b10a4ff..aabc2666 100644
--- a/gateway/app.py
+++ b/gateway/app.py
@@ -7508,6 +7508,7 @@ async def _resp_execute(translator: _RespTranslator, *, org: str, member: str, s
if translator.usage:
rec["usage"] = translator.usage
_cancel_req.pop(sid, None) # turn settled — a leftover Stop must not hit the next turn
+ await _browser_close(sid, "turn_end") # before the checkpoint and the finalize: the stop row belongs in the trace (see _adopt_orphan_turn)
await _checkpoint(sid, rec)
# The checkpoint replaced the workspace tarball with the sandbox's own copy, so anything the
# media server wrote into it during the turn is gone. Re-project here — one line, one place,