Forward sandbox into agent builder backend
All checks were successful
build / build (push) Successful in 4s
All checks were successful
build / build (push) Successful in 4s
This commit is contained in:
@@ -27,6 +27,7 @@ class BuilderContext:
|
||||
settings: Settings | None = None
|
||||
project_prefix: str | None = None
|
||||
workspace: Any | None = None
|
||||
sandbox: Any | None = None
|
||||
grant_token: str | None = None
|
||||
# LLM creds forwarded by the orchestrator according to this agent's Card.
|
||||
# The builder accepts caller-selected creds and falls back to platform
|
||||
@@ -368,7 +369,12 @@ def _build_project_backend(ctx: BuilderContext, *, settings: Settings) -> Any |
|
||||
except Exception: # noqa: BLE001
|
||||
return _with_builder_skills(StateBackend())
|
||||
return _with_builder_skills(
|
||||
_workspace_backend_with_grep_compat(WorkspaceBackend, ctx.workspace),
|
||||
_workspace_backend_with_grep_compat(
|
||||
WorkspaceBackend,
|
||||
ctx.workspace,
|
||||
sandbox=ctx.sandbox,
|
||||
default_image=settings.image,
|
||||
),
|
||||
artifacts_root=f"/{prefix}/{_BUILDER_ARTIFACT_DIR}",
|
||||
)
|
||||
try:
|
||||
@@ -404,12 +410,21 @@ def _build_project_backend(ctx: BuilderContext, *, settings: Settings) -> Any |
|
||||
)
|
||||
)
|
||||
return _with_builder_skills(
|
||||
_workspace_backend_with_grep_compat(WorkspaceBackend, workspace),
|
||||
_workspace_backend_with_grep_compat(
|
||||
WorkspaceBackend,
|
||||
workspace,
|
||||
sandbox=ctx.sandbox,
|
||||
default_image=settings.image,
|
||||
),
|
||||
artifacts_root=f"/{prefix}/{_BUILDER_ARTIFACT_DIR}",
|
||||
)
|
||||
|
||||
|
||||
def _workspace_backend_with_grep_compat(workspace_backend_cls: Any, workspace: Any) -> Any:
|
||||
def _workspace_backend_with_grep_compat(
|
||||
workspace_backend_cls: Any,
|
||||
workspace: Any,
|
||||
**backend_kwargs: Any,
|
||||
) -> Any:
|
||||
"""Patch older a2a-pack WorkspaceBackend grep glob behavior.
|
||||
|
||||
Older ``WorkspaceBackend.grep`` only matched ``glob`` against the full
|
||||
@@ -436,7 +451,7 @@ def _workspace_backend_with_grep_compat(workspace_backend_cls: Any, workspace: A
|
||||
return result
|
||||
return super().grep(pattern, path=path, glob=scoped_glob)
|
||||
|
||||
return BuilderWorkspaceBackend(workspace)
|
||||
return BuilderWorkspaceBackend(workspace, **backend_kwargs)
|
||||
|
||||
|
||||
def _with_builder_skills(default_backend: Any, *, artifacts_root: str = "/") -> Any:
|
||||
|
||||
Reference in New Issue
Block a user