Skip to content

Commit

Permalink
Merge branch 'release-v0.4.3' into upstream/release-v0.4.3-bulletin-v…
Browse files Browse the repository at this point in the history
…ersions
  • Loading branch information
lc0rp committed Jun 27, 2023
2 parents d06c1ab + c025132 commit 18ad399
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions autogpt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ def run_auto_gpt(
for command_category in enabled_command_categories:
command_registry.import_commands(command_category)

# Unregister commands that are incompatible with the current config
incompatible_commands = []
for command in command_registry.commands.values():
if callable(command.enabled) and not command.enabled(config):
command.enabled = False
incompatible_commands.append(command)

for command in incompatible_commands:
command_registry.unregister(command.name)
logger.debug(
f"Unregistering incompatible command: {command.name}, "
f"reason - {command.disabled_reason or 'Disabled by current config.'}"
)

ai_name = ""
ai_config = construct_main_ai_config(config)
ai_config.command_registry = command_registry
Expand Down

0 comments on commit 18ad399

Please sign in to comment.