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 run. Requires autonomy=AutonomyConfig(track_changes=True, snapshot=True) so run_autonomous() records a pre-run snapshot.

Signature

Returns

bool
:agent = Agent(autonomy=AutonomyConfig(level=“full_auto”, snapshot=True)) 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 4448