MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / begin_run

Method begin_run

masfactory/visualizer/client.py:86–99  ·  view source on GitHub ↗

Prepare Visualizer runtime state for a new run without re-installing hooks.

(self, root_graph: object, *, input: dict[str, object] | None = None)

Source from the content-addressed store, hash-verified

84 return
85
86 def begin_run(self, root_graph: object, *, input: dict[str, object] | None = None) -> None:
87 """
88 Prepare Visualizer runtime state for a new run without re-installing hooks.
89 """
90 try:
91 from .runtime_hooks import reset_root_graph_runtime_hooks
92
93 reset_root_graph_runtime_hooks(root_graph, self)
94 if isinstance(input, dict):
95 self.log("info", f"[run] start graph={getattr(root_graph, 'name', 'unknown')} inputKeys={list(input.keys())}")
96 else:
97 self.log("info", f"[run] start graph={getattr(root_graph, 'name', 'unknown')}")
98 except Exception:
99 return
100
101 def end_run(self, root_graph: object, *, output: dict[str, object] | None = None) -> None:
102 """Report the end of a run to the Visualizer (best-effort).

Callers 1

invokeMethod · 0.80

Calls 3

logMethod · 0.95
keysMethod · 0.80

Tested by

no test coverage detected