Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(forge): Make `watchfiles` pattern more specific to prevent unwanted (breaking) reloads

Reinier van der Leer8762f7ab3df4
diff --git a/autogpts/forge/forge/__main__.py b/autogpts/forge/forge/__main__.py
index c251fbdf32..d0b1536e51 100644
--- a/autogpts/forge/forge/__main__.py
+++ b/autogpts/forge/forge/__main__.py
@@ -45,5 +45,13 @@ if __name__ == "__main__":
host="localhost",
port=int(port),
log_level="error",
+ # Reload on changes to code or .env
reload=True,
+ reload_dirs=os.path.dirname(os.path.dirname(__file__)),
+ reload_excludes="*.py", # Cancel default *.py include pattern
+ reload_includes=[
+ f"{os.path.basename(os.path.dirname(__file__))}/**/*.py",
+ ".*",
+ ".env",
+ ],
)