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

Method run

src/harness/agentic_loop/loop.py:158–175  ·  view source on GitHub ↗

Run a single task through the agentic loop. Args: task: The user's task description. plan_mode: If True, runs structured plan mode: Phase 1: Decompose into subtasks (task tools only) Phase 2: Generate YAML plan for each subtask

(self, task: str, plan_mode: bool = False)

Source from the content-addressed store, hash-verified

156 self._verifier: Optional[PlanVerifier] = None
157
158 def run(self, task: str, plan_mode: bool = False) -> str:
159 """Run a single task through the agentic loop.
160
161 Args:
162 task: The user's task description.
163 plan_mode: If True, runs structured plan mode:
164 Phase 1: Decompose into subtasks (task tools only)
165 Phase 2: Generate YAML plan for each subtask
166 No execution — plans are generated and verified only.
167 """
168 self._setup()
169 if plan_mode:
170 result = self._run_plan_mode(task)
171 else:
172 self.session.add_user_message(task)
173 result = self._inner_loop()
174 self.logger.event("loop_end", self.session.get_usage_summary())
175 return result
176
177 def run_interactive(self) -> None:
178 """Interactive REPL mode. Reads tasks from stdin.

Callers 15

mainFunction · 0.95
_capture_git_stateFunction · 0.45
_run_gitFunction · 0.45
backup_workspaceFunction · 0.45
restore_workspaceFunction · 0.45
restore_task_filesFunction · 0.45
_is_vm_runningFunction · 0.45
_run_workflow_flowFunction · 0.45
_vm_flowFunction · 0.45
_run_agent_flowFunction · 0.45

Calls 6

_setupMethod · 0.95
_run_plan_modeMethod · 0.95
_inner_loopMethod · 0.95
add_user_messageMethod · 0.80
eventMethod · 0.80
get_usage_summaryMethod · 0.80

Tested by

no test coverage detected