|
28 | 28 | # Aliases that agents may use instead of "pipe_code". First found is promoted when canonical key is absent; extras are dropped. |
29 | 29 | _PIPE_CODE_ALIASES = ("pipe", "the_pipe_code", "code", "name", "pipe_name", "pipe_ref") |
30 | 30 |
|
31 | | -# Aliases that agents may use instead of "output". |
32 | | -_OUTPUT_ALIASES = ("output_concept", "output_type") |
| 31 | +# Alias that agents may use instead of "output". |
| 32 | +_OUTPUT_ALIAS = "output_concept" |
33 | 33 |
|
34 | 34 |
|
35 | 35 | def _normalize_sub_pipe_dict(data: dict[str, Any]) -> None: |
@@ -110,19 +110,17 @@ def parse_pipe_spec(pipe_type: str, spec_data: dict[str, Any]) -> PipeSpec: |
110 | 110 | else: |
111 | 111 | spec_data.pop("expression") |
112 | 112 |
|
113 | | - # Accept output aliases (e.g. "output_concept", "output_type") → promote to "output". |
114 | | - # When both "output" and an alias coexist, try the alias value first (agents often put |
| 113 | + # Accept "output_concept" as an alias for "output". |
| 114 | + # When both "output" and the alias coexist, try the alias value first (agents often put |
115 | 115 | # the correct concept name in the alias), falling back to the original "output" value. |
116 | 116 | output_fallback: Any | None = None |
117 | | - for alias in _OUTPUT_ALIASES: |
118 | | - if alias in spec_data: |
119 | | - alias_value = spec_data.pop(alias) |
120 | | - if "output" not in spec_data: |
121 | | - spec_data["output"] = alias_value |
122 | | - else: |
123 | | - output_fallback = spec_data["output"] |
124 | | - spec_data["output"] = alias_value |
125 | | - break |
| 117 | + if _OUTPUT_ALIAS in spec_data: |
| 118 | + alias_value = spec_data.pop(_OUTPUT_ALIAS) |
| 119 | + if "output" not in spec_data: |
| 120 | + spec_data["output"] = alias_value |
| 121 | + else: |
| 122 | + output_fallback = spec_data["output"] |
| 123 | + spec_data["output"] = alias_value |
126 | 124 |
|
127 | 125 | # Accept output as dict → extract the concept string |
128 | 126 | # Agents sometimes structure the output like inputs (as a dict). |
|
0 commit comments