Fix for agent_name regex (#6108)

The improved regex was introduced with
https://github.com/Significant-Gravitas/AutoGPT/pull/6096

However, there seems to be an issue with the updated regex;
The uppercase meta-character `\W` only matches non-word characters,
i.e. everything that is NOT [A-Za-z0-9_].
What you actually want is to use the lowercase `\w` character.

Co-authored-by: Simon Rummert <09.milieu.motes@icloud.com>
pull/6128/head
rummsi1337 2023-11-06 10:26:15 +01:00 committed by GitHub
parent 17fa807279
commit 25c6d019fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
cli.py
View File

@ -219,7 +219,7 @@ def create(agent_name):
import re
import shutil
if not re.match("\W*$", agent_name):
if not re.match("\w*$", agent_name):
click.echo(
click.style(
f"😞 Agent name '{agent_name}' is not valid. It should not contain spaces or special characters other than -_",