mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 14:23:20 +00:00
Fixed error when launching the application in agent mode (state is not a member of PentestAgentAgent).
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user