Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/coding_review_agent_loop/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
PR_RE = re.compile(r"<!--\s*AGENT_PR:\s*(\d+)\s*-->", re.I)
GH_PR_URL_RE = re.compile(r"/pull/(\d+)(?:\b|$)")
CLARIFY_RE = re.compile(r"<!--\s*AGENT_CLARIFY\s*-->", re.I)
SAME_PR_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+same[- ]pr follow[- ]ups\s*$", re.I)
FUTURE_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+future follow[- ]ups\s*$", re.I)
LEGACY_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+non[- ]blocking follow[- ]ups\s*$", re.I)
SAME_PR_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+same[- ]pr follow[- ]ups:?\s*$", re.I)
FUTURE_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+future follow[- ]ups:?\s*$", re.I)
LEGACY_FOLLOWUP_HEADING_RE = re.compile(r"^\s*#{2,6}\s+non[- ]blocking follow[- ]ups:?\s*$", re.I)
ANY_HEADING_RE = re.compile(r"^\s*#{1,6}\s+\S")
HTML_COMMENT_RE = re.compile(r"^\s*<!--.*-->\s*$")
SIGNATURE_RE = re.compile(r"^\s*--\s+\S")
Expand Down
28 changes: 28 additions & 0 deletions tests/test_agent_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,34 @@ def test_parse_approved_followups_extracts_same_pr_and_future_independently():
]


def test_parse_approved_followups_accepts_trailing_colons_on_headings():
review = """
LGTM with follow-ups.

### Same-PR follow-ups:
- Rename the helper for clarity.

### Future follow-ups:
- Add an integration fixture later.

### Non-blocking follow-ups:
- Legacy future item.

<!-- AGENT_STATE: approved -->
-- Google Gemini
"""

followups = parse_approved_followups(review, reviewer="Gemini")

assert [(item.reviewer, item.text) for item in followups.same_pr] == [
("Gemini", "Rename the helper for clarity.")
]
assert [(item.reviewer, item.text) for item in followups.future] == [
("Gemini", "Add an integration fixture later."),
("Gemini", "Legacy future item."),
]


@pytest.mark.parametrize(
"placeholder",
[
Expand Down
Loading