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

Class BashOutputResult

mini_agent/tools/bash_tool.py:18–49  ·  view source on GitHub ↗

Bash command execution result with separated stdout and stderr. Inherits from ToolResult which provides: - success: bool - content: str (used for formatted output message, auto-generated from stdout/stderr) - error: str | None (used for error messages)

Source from the content-addressed store, hash-verified

16
17
18class BashOutputResult(ToolResult):
19 """Bash command execution result with separated stdout and stderr.
20
21 Inherits from ToolResult which provides:
22 - success: bool
23 - content: str (used for formatted output message, auto-generated from stdout/stderr)
24 - error: str | None (used for error messages)
25 """
26
27 stdout: str = Field(description="The command's standard output")
28 stderr: str = Field(description="The command's standard error output")
29 exit_code: int = Field(description="The command's exit code")
30 bash_id: str | None = Field(default=None, description="Shell process ID (only when run_in_background=True)")
31
32 @model_validator(mode="after")
33 def format_content(self) -> "BashOutputResult":
34 """Auto-format content from stdout and stderr if content is empty."""
35 output = ""
36 if self.stdout:
37 output += self.stdout
38 if self.stderr:
39 output += f"\n[stderr]:\n{self.stderr}"
40 if self.bash_id:
41 output += f"\n[bash_id]:\n{self.bash_id}"
42 if self.exit_code:
43 output += f"\n[exit_code]:\n{self.exit_code}"
44
45 if not output:
46 output = "(no output)"
47
48 self.content = output
49 return self
50
51
52class BackgroundShell:

Callers 3

executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected