fix(workflows): command/prompt steps fail cleanly on a non-string integration (#3626)

_try_dispatch guarded only 'if not integration_key', then called
get_integration(integration_key). A non-string integration (a list/dict, or an
expression like integration: "{{ steps.pick.output.agents }}" that resolves to a
list) reached the registry dict lookup and raised 'TypeError: unhashable type:
list', aborting the entire workflow run. Widen the guard to also require a str,
so a non-string integration is treated as not-dispatchable and execute() falls
through to its existing FAILED StepResult (unconfigured integration=None still
returns None as before). Applied to both command and prompt steps.

Tests: a list integration now yields a FAILED result (fail before: TypeError).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali jawwad
2026-07-22 17:35:39 +05:00
committed by GitHub
parent 4f4d19ba93
commit aee9df00d4
3 changed files with 38 additions and 2 deletions

View File

@@ -189,7 +189,11 @@ class CommandStep(StepBase):
not possible (integration not found, CLI not installed, or
dispatch not supported).
"""
if not integration_key:
if not integration_key or not isinstance(integration_key, str):
# A non-string integration (a list/dict/expression that resolved to
# one) would raise TypeError: unhashable type from get_integration's
# dict lookup below and abort the whole run. Treat it as "not
# dispatchable" so execute() falls through to its FAILED StepResult.
return None
try:

View File

@@ -138,7 +138,10 @@ class PromptStep(StepBase):
context: StepContext,
) -> dict[str, Any] | None:
"""Dispatch *prompt* directly through the integration CLI."""
if not integration_key or not prompt:
if not integration_key or not isinstance(integration_key, str) or not prompt:
# A non-string integration would raise TypeError: unhashable type
# from get_integration's dict lookup and abort the run; treat it as
# not dispatchable so execute() falls through to its FAILED result.
return None
try: