Skip to content

The agent that grows with you

fix(bot-screen): truncate launcher.log on each start

teknium1aae797bc274d
diff --git a/tools/bot_desktop/runtime.py b/tools/bot_desktop/runtime.py
index 7547eafd741..16e4569bfb2 100644
--- a/tools/bot_desktop/runtime.py
+++ b/tools/bot_desktop/runtime.py
@@ -331,7 +331,8 @@ def _spawn_and_wait(sd: Path, num: int, wait_seconds: float) -> DesktopStatus:
if (browser := dock_launch()) is not None:
# first-run / default-browser dialogs would sit between the human and the bot's tabs
child_env["HERMES_BD_BROWSER_EXEC"] = f"{browser[0]} --user-data-dir={browser[1]} --no-first-run --no-default-browser-check"
- log = open(sd / "launcher.log", "ab") # noqa: SIM115 — handed to the child, closed by it
+ # Truncated per start: the log is a diagnostic for THIS launch, and nothing rotates it otherwise.
+ log = open(sd / "launcher.log", "wb") # noqa: SIM115 — handed to the child, closed by it
proc = subprocess.Popen( # windows-footgun: ok — Linux-only runtime (is_supported_host)
["bash", str(_LAUNCHER)], env=child_env, stdin=subprocess.DEVNULL, stdout=log, stderr=log,
start_new_session=True, close_fds=True)