fix: harden generated agent platform access
All checks were successful
build / build (push) Successful in 21s

This commit is contained in:
robert
2026-05-25 23:30:49 -03:00
parent e95a8001c0
commit a20cd5ae3b
7 changed files with 208 additions and 125 deletions

View File

@@ -96,8 +96,10 @@ class AgentBuilder(A2AAgent[BuilderConfig, NoAuth]):
# it and surface a clean "I need to run through the orchestrator"
# error rather than letting it bubble up as a 500.
try:
bucket = getattr(ctx.workspace, "bucket", None)
workspace = ctx.workspace
bucket = getattr(workspace, "bucket", None)
except PermissionError:
workspace = None
bucket = None
if not bucket:
return {
@@ -126,6 +128,8 @@ class AgentBuilder(A2AAgent[BuilderConfig, NoAuth]):
graph = build_agent_builder(BuilderContext(
bucket=bucket, cp_jwt=cp_jwt,
project_prefix=f"agents/{name}",
workspace=workspace,
grant_token=getattr(workspace, "_grant_token", None),
llm_base_url=creds.base_url,
llm_api_key=creds.api_key,
llm_model=creds.model,