Only reasoning agent should terminate run, not the grounding agent.

Grounding agent does not have the full context and capabilities to
make this call. Only let reasoning agent make termination decision.

Add a wait action instead when grounder requests termination.
This commit is contained in:
Debanjum
2025-05-08 23:31:55 -06:00
parent ffe58d2ec1
commit e5415bdaee

View File

@@ -177,18 +177,18 @@ Focus on the visual action and provide all necessary context.
# Process grounding response # Process grounding response
if grounding_response.strip().endswith("DONE"): if grounding_response.strip().endswith("DONE"):
rendered_parts += ["Completed task."] # Ignore DONE response by the grounding agent. Reasoning agent handles termination.
actions.append(WaitAction(duration=1.0))
rendered_parts += ["Nothing to do."]
elif grounding_response.strip().endswith("FAIL"): elif grounding_response.strip().endswith("FAIL"):
rendered_parts += ["Error in grounding LLM response."] # Ignore FAIL response by the grounding agent. Reasoning agent handles termination.
actions.append(WaitAction(duration=1.0))
rendered_parts += ["Could not process response."]
else: else:
rendered_parts += [f"**Thought (Grounding)**: {grounding_response}"] rendered_parts += [f"**Thought (Grounding)**: {grounding_response}"]
for action in actions: for action in actions:
rendered_parts += [f"**Action**: {action}"] rendered_parts += [f"**Action**: {action}"]
action_results += [ action_results += [{"content": None}] # content set after environment step
{
"content": None, # Updated after environment step
}
]
except Exception as e: except Exception as e:
logger.error(f"Error calling Grounding LLM: {e}") logger.error(f"Error calling Grounding LLM: {e}")
rendered_parts += [f"**Error**: Error contacting Grounding LLM: {e}"] rendered_parts += [f"**Error**: Error contacting Grounding LLM: {e}"]