Merge pull request #22 from famez/main

Several fixes
This commit is contained in:
Masic
2026-01-27 15:12:08 -07:00
committed by GitHub
4 changed files with 15 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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")

View File

@@ -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()