fix: allow multiline commands

This commit is contained in:
2026-07-19 23:37:45 +02:00
parent 5b2b09b000
commit 14737db853
3 changed files with 61 additions and 10 deletions
+1 -2
View File
@@ -4,7 +4,7 @@ import re
from agentci.domain.models import CommandName, JobKind, ParsedCommand
COMMAND_RE = re.compile(r"^/agent[ \t]+([a-z]+)(?:[ \t]+([\s\S]*))?$")
COMMAND_RE = re.compile(r"^/agent[ \t]+([a-z]+)(?:[ \t\r\n]+([\s\S]*))?$")
class CommandError(ValueError):
@@ -46,4 +46,3 @@ def resolve_job_kind(command: ParsedCommand, *, is_pull_request: bool) -> JobKin
if command.name not in mapping:
raise CommandError(f"`/agent {command.name}` can only be used on a pull request.")
return mapping[command.name]