Fixed error when launching the application in agent mode (state is not a member of PentestAgentAgent).

This commit is contained in:
famez
2026-01-27 21:43:37 +01:00
parent 432e81b283
commit e87c9ca1c8
2 changed files with 8 additions and 2 deletions

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