Harden builder sandbox package install
All checks were successful
build / build (push) Successful in 10s

This commit is contained in:
robert
2026-06-07 22:10:23 -03:00
parent aba68aaf2e
commit cd1c661109
4 changed files with 12 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ if TYPE_CHECKING:
A2A_PACK_MIN_VERSION = "0.1.80"
A2A_PACK_SANDBOX_FALLBACK_VERSION = "0.1.79"
logger = logging.getLogger(__name__)
@@ -468,7 +469,13 @@ def build_tools(ctx: ToolContext) -> list[Any]:
script = (
"set -e\n"
"export PYTHONDONTWRITEBYTECODE=1\n"
f"pip install --quiet 'a2a-pack>={A2A_PACK_MIN_VERSION}' >/dev/null\n"
"python -m pip install --quiet "
f"'a2a-pack>={A2A_PACK_MIN_VERSION}' >/dev/null || "
"(echo 'a2a-pack>="
f"{A2A_PACK_MIN_VERSION} unavailable; falling back to "
f"a2a-pack=={A2A_PACK_SANDBOX_FALLBACK_VERSION} for sandbox card validation' >&2; "
"python -m pip install --quiet --index-url https://pypi.org/simple "
f"'a2a-pack=={A2A_PACK_SANDBOX_FALLBACK_VERSION}' >/dev/null)\n"
"mkdir -p /tmp/agent\n"
f"echo '{b64}' | base64 -d | tar -xzf - -C /tmp/agent\n"
"cd /tmp/agent\n"