Skip to content

Commit a0c4509

Browse files
committed
fix(altk-agent): preserve legacy AgentExecutor semantics in input overrides
ALTK Agent inherits AgentComponent.inputs, but it still runs on AgentExecutor (its run_agent overrides the create_agent path). Without this override, AgentComponent's new create_agent-specific info text on handle_parsing_errors and max_iterations would surface in the ALTK Agent UI, and the verbose toggle (still consumed by ALTK's AgentExecutor call) would silently disappear from the panel. Override the two info strings and re-add the verbose BoolInput so the ALTK Agent panel keeps describing what its runtime actually does.
1 parent 5d95e7a commit a0c4509

1 file changed

Lines changed: 35 additions & 2 deletions

File tree

src/lfx/src/lfx/components/altk/altk_agent.py

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,44 @@ def set_advanced_true(component_input):
2323

2424

2525
def get_parent_agent_inputs():
26-
return [
27-
input_field
26+
"""Inherit parent inputs, but restore the legacy AgentExecutor semantics.
27+
28+
ALTK Agent still runs on `AgentExecutor` (see `ALTKBaseAgentComponent.run_agent`),
29+
so it needs the legacy `verbose` input and the original `handle_parsing_errors` /
30+
`max_iterations` info text. The parent `AgentComponent` dropped `verbose` and
31+
re-worded those two info strings to describe `create_agent` middleware, which
32+
would be misleading here.
33+
"""
34+
overrides = {
35+
"handle_parsing_errors": BoolInput(
36+
name="handle_parsing_errors",
37+
display_name="Handle Parse Errors",
38+
value=True,
39+
advanced=True,
40+
info="Should the Agent fix errors when reading user input for better processing?",
41+
),
42+
"max_iterations": IntInput(
43+
name="max_iterations",
44+
display_name="Max Iterations",
45+
value=15,
46+
advanced=True,
47+
info="The maximum number of attempts the agent can make to complete its task before it stops.",
48+
),
49+
}
50+
parent_inputs = [
51+
overrides.get(input_field.name, input_field)
2852
for input_field in ALTKBaseAgentComponent.inputs
2953
if input_field.name not in INPUT_NAMES_TO_BE_OVERRIDDEN
3054
]
55+
# `verbose` was removed from `AgentComponent.inputs`. ALTK's `run_agent` still
56+
# passes it through to `AgentExecutor.from_agent_and_tools(verbose=...)`, so
57+
# re-add it after `handle_parsing_errors` to preserve the previous UI order.
58+
rebuilt: list = []
59+
for input_field in parent_inputs:
60+
rebuilt.append(input_field)
61+
if input_field.name == "handle_parsing_errors":
62+
rebuilt.append(BoolInput(name="verbose", display_name="Verbose", value=True, advanced=True))
63+
return rebuilt
3164

3265

3366
# === Combined ALTK Agent Component ===

0 commit comments

Comments
 (0)