mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 14:23:20 +00:00
@@ -53,9 +53,14 @@ COPY . .
|
||||
RUN useradd -m -s /bin/bash pentestagent && \
|
||||
chown -R pentestagent:pentestagent /app
|
||||
|
||||
RUN playwright install-deps
|
||||
|
||||
# Switch to non-root user (can switch back for privileged operations)
|
||||
USER pentestagent
|
||||
|
||||
RUN playwright install
|
||||
|
||||
|
||||
# Expose any needed ports
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
@@ -938,3 +938,6 @@ Call create_plan with the new steps OR feasible=False."""
|
||||
else:
|
||||
parts.append(f"Error: {r.error}")
|
||||
return "\n".join(parts)
|
||||
|
||||
def get_state(self) -> AgentState:
|
||||
return self.state_manager.current_state
|
||||
@@ -2954,6 +2954,9 @@ Be concise. Use the actual data from notes."""
|
||||
self._set_status("thinking", "agent")
|
||||
|
||||
try:
|
||||
|
||||
from ..agents.base_agent import AgentState
|
||||
|
||||
async for response in self.agent.agent_loop(task):
|
||||
if self._should_stop:
|
||||
self._add_system("[!] Stopped by user")
|
||||
@@ -2999,11 +3002,11 @@ Be concise. Use the actual data from notes."""
|
||||
)
|
||||
|
||||
# Check state
|
||||
if self.agent.state.value == "waiting_input":
|
||||
if self.agent.get_state() == AgentState.WAITING_INPUT:
|
||||
self._set_status("waiting")
|
||||
self._add_system("? Awaiting input...")
|
||||
break
|
||||
elif self.agent.state.value == "complete":
|
||||
elif self.agent.get_state() == AgentState.COMPLETE:
|
||||
break
|
||||
|
||||
self._set_status("thinking")
|
||||
|
||||
@@ -571,7 +571,8 @@ class LocalRuntime(Runtime):
|
||||
self._playwright = await async_playwright().start()
|
||||
self._browser = await self._playwright.chromium.launch(headless=True)
|
||||
self._browser_context = await self._browser.new_context(
|
||||
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
||||
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
|
||||
ignore_https_errors=True
|
||||
)
|
||||
self._page = await self._browser_context.new_page()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user