refactor: narrow harness metadata types (#3811)
Signed-off-by: Pat Sukprasert <pat.sukprasert@databricks.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = (
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user