Poll private deployed agents by canonical URL
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:
@@ -42,6 +42,20 @@ class ToolContext:
|
||||
grant_token: str | None = None
|
||||
|
||||
|
||||
def _canonical_agent_url(name: str | None) -> str | None:
|
||||
if not isinstance(name, str) or not name.strip():
|
||||
return None
|
||||
return f"https://{name.strip()}.a2acloud.io"
|
||||
|
||||
|
||||
def _deploy_poll_url(body: dict[str, Any], name: str | None) -> str | None:
|
||||
for key in ("expected_url", "url"):
|
||||
value = body.get(key)
|
||||
if isinstance(value, str) and value.strip():
|
||||
return value.strip()
|
||||
return _canonical_agent_url(name)
|
||||
|
||||
|
||||
async def _wait_for_live_card(
|
||||
url: str | None,
|
||||
expected_version: str | None,
|
||||
@@ -541,7 +555,7 @@ def build_tools(ctx: ToolContext) -> list[Any]:
|
||||
body = r.json()
|
||||
name_ = body.get("name")
|
||||
version_ = body.get("version")
|
||||
url_ = body.get("url")
|
||||
url_ = _deploy_poll_url(body, str(name_) if name_ is not None else name)
|
||||
head_sha = body.get("head_sha")
|
||||
if isinstance(head_sha, str) and head_sha:
|
||||
_write_builder_state(
|
||||
|
||||
Reference in New Issue
Block a user