Skip to content

Commit

Permalink
Fix trying to load non-existing agent
Browse files Browse the repository at this point in the history
  • Loading branch information
kcze committed Feb 28, 2024
1 parent 5090f55 commit 6cf8b0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autogpts/autogpt/autogpt/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ async def run_auto_gpt(
if re.match(r"^\d+$", load_existing_agent):
load_existing_agent = existing_agents[int(load_existing_agent) - 1]
elif load_existing_agent and load_existing_agent not in existing_agents:
raise ValueError(f"Unknown agent '{load_existing_agent}'")
logger.info(
f"Unknown agent '{load_existing_agent}', "
f"creating a new one instead.",
extra={"color": Fore.YELLOW},
)
load_existing_agent = ""

# Either load existing or set up new agent state
agent = None
Expand Down

0 comments on commit 6cf8b0d

Please # to comment.