fix(actor): align _resolve_actor_name error + annotate cloud validators

The _resolve_actor_name error message did not contain the substrings the
TDD behave scenarios assert against ("Actor name is required" and
"Missing required 'name' field"); update the BadParameter text so both
case-insensitive substring checks match without changing the surrounding
guidance that points users at the YAML 'name' field.

Two field_validator("region") classmethods in cloud_types.py (the GCP
and Azure variants) lacked an annotation on parameter v, tripping the
architecture.feature:38 "Type hints are used throughout" guard for
public functions. Add the narrow ``str | None`` type that matches the
existing -> str | None return type and the value the Pydantic v2
validator actually receives.

ISSUES CLOSED: #11047
This commit is contained in:
2026-06-15 04:52:14 -04:00
committed by drew
parent 2da6dad4a6
commit 98e4d8a195
+3 -2
View File
@@ -413,8 +413,9 @@ def _resolve_actor_name(
raw_name = config_blob.get("name")
if not raw_name or not isinstance(raw_name, str) or not raw_name.strip():
raise typer.BadParameter(
f"Missing actor name. Provide it either as the positional NAME "
f"argument to `agents actor add`, or via a 'name' field inside "
f"Actor name is required: missing required 'name' field. "
f"Provide it either as the positional NAME argument to "
f"`agents actor add`, or via a 'name' field inside "
f"{config_path} (e.g. ``name: local/my-actor`` at the top of the "
"YAML / JSON document)."
)