[Bug] Unhandled FileNotFoundError in CLI Rollback Command
Description:
The rollback command attempts to restore a virtual environment from a backup directory. If the backup directory is deleted by another process after the list is displayed but before the user confirms the rollback, the command crashes with an unhandled FileNotFoundError.
Context:
cli/envforge_agent/cli.py
Steps to Reproduce:
- Run
envforge rollback and wait at the selection prompt.
- In another terminal, delete the selected backup directory.
- Confirm the selection in the CLI.
- The CLI crashes with a raw traceback.
Current Behavior:
shutil.copytree is called without verifying the source directory still exists at execution time.
Expected Behavior:
The command should verify the source directory exists immediately before copying and raise a clean error if it is missing.
Suggested Fix/Remediation:
Add an existence check before copying:
[Bug] Unhandled FileNotFoundError in CLI Rollback Command
Description:
The
rollbackcommand attempts to restore a virtual environment from a backup directory. If the backup directory is deleted by another process after the list is displayed but before the user confirms the rollback, the command crashes with an unhandledFileNotFoundError.Context:
cli/envforge_agent/cli.pySteps to Reproduce:
envforge rollbackand wait at the selection prompt.Current Behavior:
shutil.copytreeis called without verifying the source directory still exists at execution time.Expected Behavior:
The command should verify the source directory exists immediately before copying and raise a clean error if it is missing.
Suggested Fix/Remediation:
Add an existence check before copying: