refactor: narrow harness metadata types (#3811)

Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
This commit is contained in:
Pat Sukprasert
2026-08-01 17:48:42 +08:00
committed by GitHub
parent b6f2ca5f0a
commit b693a91a23
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ def native_terminal_name(harness: str | None) -> str | None:
:returns: The terminal short-name, e.g. ``"cursor"``, or ``None`` when
*harness* is not a native CLI harness.
"""
if not is_native_harness(harness):
if harness is None or not is_native_harness(harness):
return None
canonical = canonicalize_harness(harness) or harness
# Canonical native ids are ``<name>-native``; some accepted aliases keep the
+1 -1
View File
@@ -119,7 +119,7 @@ KEY_KIND = "key"
SUBSCRIPTION_KIND = "subscription"
GATEWAY_KIND = "gateway"
LOCAL_KIND = "local"
DATABRICKS_KIND = "databricks"
DATABRICKS_KIND: Literal["databricks"] = "databricks"
CLI_CONFIG_KIND = "cli-config"
BEDROCK_KIND = "bedrock"
_VALID_KINDS = (
+1 -1
View File
@@ -1537,7 +1537,7 @@ def _build_acp_spawn_env(
)
has_embedded = isinstance(cfg, dict) and "acp_agent" in cfg
embedded = cfg.get("acp_agent") if has_embedded else None
embedded = cfg.get("acp_agent") if isinstance(cfg, dict) else None
agent: AcpAgentEntry | None = None
if has_embedded:
if not isinstance(embedded, dict):