From 3d02648d0c3d51511afd3af53ba1b76ebb236a0d Mon Sep 17 00:00:00 2001 From: richard-epsilla Date: Sun, 20 Sep 2026 16:11:10 -0700 Subject: [PATCH] mario: the launcher finds the interpreter and the browsers by name An MCP stdio server gets a restricted environment from the SDK, so nothing the image exported reaches the launcher, and a hosted sandbox's HOME is made per session, so a home-relative venv never matches one the image installed (both found by the hosted port). The launcher now takes SYSTEMONE_PYTHON if the host set it for the server, then the known venv paths, and picks the first known browser root that holds a chromium-* directory when PLAYWRIGHT_BROWSERS_PATH is unset. Plugin 0.3.2, so a launched harness relaunches onto it. Co-Authored-By: Claude Fable 5.1 --- kits/mario/plugin/bin/mario-env | 18 ++++++++++++++---- kits/mario/plugin/plugin.json | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/kits/mario/plugin/bin/mario-env b/kits/mario/plugin/bin/mario-env index 6b7c362..9ea9839 100755 --- a/kits/mario/plugin/bin/mario-env +++ b/kits/mario/plugin/bin/mario-env @@ -3,12 +3,22 @@ # the System One base's own Python (the venv the image installs for that base, which carries # browser-use and the MCP SDK) and on the Chromium installed beside it; outside the image, any # python3 with `systemone-harness[browser]` and a Chrome on the machine will do. +# +# An MCP stdio server gets a restricted environment from the SDK, so nothing the image exported +# reaches this script, and a hosted sandbox's HOME is made per session, so a home-relative venv +# never matches one the image installed. The interpreter and the browsers are therefore found +# here, by name: SYSTEMONE_PYTHON if the host set it for the server, then the known venv paths; +# PLAYWRIGHT_BROWSERS_PATH if set, then the known browser roots that hold a chromium-* directory. here="$(cd "$(dirname "$0")/.." && pwd)" py=python3 -for cand in /data/agent-tools/systemone-venv/bin/python "$HOME/.systemone-venv/bin/python"; do - if [ -x "$cand" ]; then py="$cand"; break; fi +for cand in "$SYSTEMONE_PYTHON" /data/agent-tools/systemone-venv/bin/python /opt/systemone-venv/bin/python "$HOME/.systemone-venv/bin/python"; do + if [ -n "$cand" ] && [ -x "$cand" ]; then py="$cand"; break; fi done -if [ -z "$PLAYWRIGHT_BROWSERS_PATH" ] && [ -d /data/agent-tools/ms-playwright ]; then - export PLAYWRIGHT_BROWSERS_PATH=/data/agent-tools/ms-playwright +if [ -z "$PLAYWRIGHT_BROWSERS_PATH" ]; then + for root in /data/agent-tools/ms-playwright /opt/ms-playwright /ms-playwright "$HOME/.cache/ms-playwright"; do + if [ -d "$root" ] && ls -d "$root"/chromium-* >/dev/null 2>&1; then + export PLAYWRIGHT_BROWSERS_PATH="$root"; break + fi + done fi exec "$py" "$here/server/mario_env.py" diff --git a/kits/mario/plugin/plugin.json b/kits/mario/plugin/plugin.json index b7af2ed..1f3864c 100644 --- a/kits/mario/plugin/plugin.json +++ b/kits/mario/plugin/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", "name": "mario-env", - "version": "0.3.1", + "version": "0.3.2", "description": "Full Screen Mario as an environment for the System One base: the game's state as literal text each step, the keys it listens to as actions, and the browser's frame for the page to show.", "homepage": "https://github.com/HarnessRouter/starter-kit", "license": "SEE LICENSE IN ../LICENSE.md"