Commit 72cda73
Fix test_tool_choice_none_after_tool_results to match actual behavior
The test was failing after rebase because it used non-existent OCI SDK
classes (models.Tool) and had incorrect expectations about when tool_choice
is set to 'none'.
Changes:
1. Replace OCI SDK mock objects with Python function (following pattern
from other tests in the file)
2. Update test to trigger actual tool_choice=none behavior by exceeding
max_sequential_tool_calls limit (3 tool calls)
3. Fix _prepare_request call signature (add stop parameter)
4. Pass bound model kwargs to _prepare_request (required for tools)
5. Update docstring to accurately describe what's being tested
The test now correctly validates that tool_choice is set to ToolChoiceNone
when the max_sequential_tool_calls limit is reached, preventing infinite
tool calling loops.
Related to PR oracle#50 (infinite loop fix) and PR oracle#53 (tool call optimization).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 9cc8d4d commit 72cda73
File tree
1 file changed
+26
-32
lines changed- libs/oci/tests/unit_tests/chat_models
1 file changed
+26
-32
lines changedLines changed: 26 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
774 | | - | |
| 774 | + | |
775 | 775 | | |
776 | | - | |
777 | | - | |
| 776 | + | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
| 785 | + | |
| 786 | + | |
786 | 787 | | |
787 | 788 | | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
799 | 797 | | |
800 | 798 | | |
801 | | - | |
| 799 | + | |
802 | 800 | | |
803 | | - | |
| 801 | + | |
804 | 802 | | |
805 | 803 | | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
818 | 810 | | |
819 | 811 | | |
820 | | - | |
821 | | - | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
822 | 816 | | |
823 | | - | |
| 817 | + | |
824 | 818 | | |
825 | 819 | | |
826 | 820 | | |
| |||
0 commit comments