Run the inner loop with a custom tool set. Temporarily swaps tool lists, runs _inner_loop, then restores. Used by plan mode phases to restrict available tools.
(
self,
tools_openai: list[dict],
orchestrator_tools: list[OrchestratorTool],
)
| 881 | return raw_result[:2000] |
| 882 | |
| 883 | def _inner_loop_with_tools( |
| 884 | self, |
| 885 | tools_openai: list[dict], |
| 886 | orchestrator_tools: list[OrchestratorTool], |
| 887 | ) -> str: |
| 888 | """Run the inner loop with a custom tool set. |
| 889 | |
| 890 | Temporarily swaps tool lists, runs _inner_loop, then restores. |
| 891 | Used by plan mode phases to restrict available tools. |
| 892 | """ |
| 893 | saved_all, saved_orch = self._all_tools, self._orchestrator_tools |
| 894 | try: |
| 895 | self._all_tools = tools_openai |
| 896 | self._orchestrator_tools = orchestrator_tools |
| 897 | return self._inner_loop() |
| 898 | finally: |
| 899 | self._all_tools = saved_all |
| 900 | self._orchestrator_tools = saved_orch |
| 901 | |
| 902 | def _inner_loop(self) -> str: |
| 903 | """The core while(True) tool-calling loop.""" |
no test coverage detected