feat(python/robomp): added followup thread context to comment handling

- Normalized reviewer-bot matching by stripping a trailing `[bot]` suffix when resolving configured bot logins.
- Fetched PR thread history for followup comments without directives and carried it through task execution.
- Updated followup prompt rendering to include prior conversation context for handle_comment tasks.
This commit is contained in:
can1357
2026-05-25 20:09:26 +02:00
parent 7a867a5e85
commit 4cd86383c0
8 changed files with 117 additions and 11 deletions
+8 -3
View File
@@ -157,11 +157,16 @@ def route(
return issue_key(repo, pr_number) # type: ignore[arg-type]
def _reviewer_bot_login(user: Mapping[str, Any] | None) -> str | None:
"""Return the lowercased login if this user is a configured reviewer bot."""
"""Return the normalized login if this user is a configured reviewer bot."""
if not isinstance(user, Mapping):
return None
login = str(user.get("login") or "").lower()
return login if login and login in reviewer_bots else None
raw_login = str(user.get("login") or "").lower()
if not raw_login:
return None
login = raw_login.removesuffix("[bot]")
if login in reviewer_bots:
return login
return raw_login if raw_login in reviewer_bots else None
def _directive_kwargs(comment: Mapping[str, Any] | None, login: str | None, assoc: str | None) -> dict[str, Any]:
"""Decide whether this comment is a directive (reviewer-bot OR maintainer-mention)."""