Skip to content

fix: handle direct model answers in ReACT loop#763

Open
markstur wants to merge 1 commit intogenerative-computing:mainfrom
markstur:issue_762
Open

fix: handle direct model answers in ReACT loop#763
markstur wants to merge 1 commit intogenerative-computing:mainfrom
markstur:issue_762

Conversation

@markstur
Copy link
Copy Markdown

@markstur markstur commented Mar 27, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

fix: handle direct model answers in ReACT loop

The ReACT framework now properly handles cases where the model provides
a direct answer without calling tools. Previously, these answers were
ignored and the loop would continue until exhausting the budget.

Added test coverage for both scenarios (no tools, unused tools).

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

The ReACT framework now properly handles cases where the model provides
a direct answer without calling tools. Previously, these answers were
ignored and the loop would continue until exhausting the budget.

Added test coverage for both scenarios (no tools, unused tools).

Fixes: generative-computing#762

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
@markstur markstur requested a review from a team as a code owner March 27, 2026 23:26
@github-actions github-actions bot added the bug Something isn't working label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@markstur
Copy link
Copy Markdown
Author

Note to reviewers: I do have concerns about my limited test environment and side effects. I'm seeing this as a good fix for when react_using_mellea with DuckDuckGo starts to find nothing. I suspect it could be impacted by DDGS rate limiting but not sure why it looks like this. Bottom line though is that there is a case where we have an answer in step value (is_complete) but we miss our is_final handling.

I wonder if there is any reason to only do this check after running out of iterations (last ditch handling), but it seem seems more right to me to just use the value when this elif case happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: react loop is missing a check for result without tool calls

1 participant