fix: harden generated agent platform access
All checks were successful
build / build (push) Successful in 21s
All checks were successful
build / build (push) Successful in 21s
This commit is contained in:
6
agent.py
6
agent.py
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user