MCPcopy Index your code
hub / github.com/MiniMax-AI/Mini-Agent / terminate

Method terminate

mini_agent/tools/bash_tool.py:191–214  ·  view source on GitHub ↗

Terminate a background shell and clean up all resources. Args: bash_id: The unique identifier of the background shell Returns: The terminated BackgroundShell object Raises: ValueError: If shell not found

(cls, bash_id: str)

Source from the content-addressed store, hash-verified

189
190 @classmethod
191 async def terminate(cls, bash_id: str) -> BackgroundShell:
192 """Terminate a background shell and clean up all resources.
193
194 Args:
195 bash_id: The unique identifier of the background shell
196
197 Returns:
198 The terminated BackgroundShell object
199
200 Raises:
201 ValueError: If shell not found
202 """
203 shell = cls.get(bash_id)
204 if not shell:
205 raise ValueError(f"Shell not found: {bash_id}")
206
207 # Terminate the process
208 await shell.terminate()
209
210 # Clean up monitoring and remove from manager
211 cls._cancel_monitor(bash_id)
212 cls._remove(bash_id)
213
214 return shell
215
216
217class BashTool(Tool):

Callers

nothing calls this directly

Calls 4

getMethod · 0.80
_cancel_monitorMethod · 0.80
_removeMethod · 0.80
terminateMethod · 0.45

Tested by

no test coverage detected