The ReAct loop stops when the model emits a Finish action with its answer. Detecting that point tells the runner when to return the final answer rather than call another tool.
Implement first_finish_index(actions), returning where the episode ended, or None.
Scan the actions in order and return the first index whose name is Finish.
No results yet
Run your code to check it against the examples, or submit to run every test.