mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 14:04:27 +01:00
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>
This commit is contained in:
2
cli.py
2
cli.py
@@ -219,7 +219,7 @@ def create(agent_name):
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
if not re.match("\W*$", agent_name):
|
if not re.match("\w*$", agent_name):
|
||||||
click.echo(
|
click.echo(
|
||||||
click.style(
|
click.style(
|
||||||
f"😞 Agent name '{agent_name}' is not valid. It should not contain spaces or special characters other than -_",
|
f"😞 Agent name '{agent_name}' is not valid. It should not contain spaces or special characters other than -_",
|
||||||
|
|||||||
Reference in New Issue
Block a user