Skip to content

[BUG] Agent cannot run when final_answer_checks is provided #1440

@Zoe14

Description

@Zoe14

Describe the bug
final_answer_checks are being called after every action step instead of just final_answer_step
When final_answer_checks is not none, the agent run would fail with Check check_final_answer failed with error: None is not of type 'object'
Looking at the log, it is running the check_final_answer before final_answer step.

Code to reproduce the error
create any agent that has final_answer_checks

Error logs (if any)
Check check_final_answer failed with error: None is not of type 'object'

Expected behavior
should only run check_final_answer when there is a final_answer

Packages version:
version = "1.18.0"

Additional context
It is introduced by this change.
when token streaming is not enabled, _step_stream always returns a FinalOutput. when it is not final answer, it is a FinalOutput(output=None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions