MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _inner_loop_with_tools

Method _inner_loop_with_tools

src/harness/agentic_loop/loop.py:883–900  ·  view source on GitHub ↗

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],
    )

Source from the content-addressed store, hash-verified

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."""

Callers 1

_run_plan_modeMethod · 0.95

Calls 1

_inner_loopMethod · 0.95

Tested by

no test coverage detected