mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 22:33:38 +00:00
fix: increase MCP subprocess buffer limit to 1MB, CLI imports
This commit is contained in:
@@ -10,6 +10,8 @@ from rich.markdown import Markdown
|
||||
from rich.panel import Panel
|
||||
from rich.text import Text
|
||||
|
||||
from ..config.constants import AGENT_MAX_ITERATIONS, ORCHESTRATOR_MAX_ITERATIONS
|
||||
|
||||
console = Console()
|
||||
|
||||
# PA theme colors (matching TUI)
|
||||
@@ -25,7 +27,7 @@ async def run_cli(
|
||||
model: str,
|
||||
task: str = None,
|
||||
report: str = None,
|
||||
max_loops: int = 50,
|
||||
max_loops: int = AGENT_MAX_ITERATIONS,
|
||||
use_docker: bool = False,
|
||||
mode: str = "agent",
|
||||
):
|
||||
@@ -61,7 +63,9 @@ async def run_cli(
|
||||
start_text.append("Runtime: ", style=PA_SECONDARY)
|
||||
start_text.append(f"{'Docker' if use_docker else 'Local'}\n", style=PA_PRIMARY)
|
||||
start_text.append("Max loops: ", style=PA_SECONDARY)
|
||||
start_text.append(f"{max_loops}\n", style=PA_PRIMARY)
|
||||
# Show the actual max iterations used by each mode
|
||||
actual_max = ORCHESTRATOR_MAX_ITERATIONS if mode == "crew" else max_loops
|
||||
start_text.append(f"{actual_max}\n", style=PA_PRIMARY)
|
||||
|
||||
task_msg = task or f"Perform a penetration test on {target}"
|
||||
start_text.append("Task: ", style=PA_SECONDARY)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import argparse
|
||||
import asyncio
|
||||
|
||||
from ..config.constants import DEFAULT_MODEL
|
||||
from ..config.constants import AGENT_MAX_ITERATIONS, DEFAULT_MODEL
|
||||
from .cli import run_cli
|
||||
from .tui import run_tui
|
||||
|
||||
@@ -73,8 +73,8 @@ Examples:
|
||||
run_parser.add_argument(
|
||||
"--max-loops",
|
||||
type=int,
|
||||
default=50,
|
||||
help="Max agent loops before stopping (default: 50)",
|
||||
default=AGENT_MAX_ITERATIONS,
|
||||
help=f"Max agent loops before stopping (default: {AGENT_MAX_ITERATIONS})",
|
||||
)
|
||||
|
||||
# Tools subcommand
|
||||
|
||||
@@ -81,6 +81,7 @@ class StdioTransport(MCPTransport):
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
env=full_env,
|
||||
limit=1024 * 1024, # 1MB buffer limit for large MCP responses
|
||||
)
|
||||
|
||||
async def send(self, message: dict, timeout: float = 15.0) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user