Skip to main content

undo

Method
This is a method of the Agent class in the agent module.
Undo the last set of file changes. Restores files to the state before the last autonomous iteration. Requires autonomy=AutonomyConfig(track_changes=True).

Signature

Returns

bool
:agent = Agent(autonomy=“full_auto”) result = agent.start(“Refactor utils.py”) agent.undo() # Restore original files

Uses

  • get_current_hash
  • restore
  • logger.debug

Source

View on GitHub

praisonaiagents/agent/agent.py at line 3444