Harden builder sandbox package install
All checks were successful
build / build (push) Successful in 10s
All checks were successful
build / build (push) Successful in 10s
This commit is contained in:
2
a2a.yaml
2
a2a.yaml
@@ -1,5 +1,5 @@
|
||||
name: agent-builder
|
||||
version: 0.1.1
|
||||
version: 0.1.4
|
||||
entrypoint: agent:AgentBuilder
|
||||
description: Generate, test, and deploy new a2a agents from natural language.
|
||||
expose:
|
||||
|
||||
2
agent.py
2
agent.py
@@ -49,7 +49,7 @@ class AgentBuilder(A2AAgent[BuilderConfig, NoAuth]):
|
||||
"Writes the project into the user's workspace, validates it in a "
|
||||
"sandbox, then ships it via the control plane."
|
||||
)
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
|
||||
config_model = BuilderConfig
|
||||
auth_model = NoAuth
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -342,6 +342,8 @@ class TemplateInitTests(unittest.TestCase):
|
||||
"export PYTHONDONTWRITEBYTECODE=1",
|
||||
str(sandbox.calls[0]["script"]),
|
||||
)
|
||||
self.assertIn("a2a-pack>=0.1.80 unavailable", str(sandbox.calls[0]["script"]))
|
||||
self.assertIn("a2a-pack==0.1.79", str(sandbox.calls[0]["script"]))
|
||||
self.assertEqual(_FakeAsyncClient.posts, [])
|
||||
|
||||
def test_cp_deploy_tarball_posts_agent_dsl(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user