Skip to content

fix: support forwarded GitHub notifications#52

Merged
ecarreras merged 3 commits into
pilipilisbot:mainfrom
gisce:fix/github-forwarded-mail-bot-login
May 26, 2026
Merged

fix: support forwarded GitHub notifications#52
ecarreras merged 3 commits into
pilipilisbot:mainfrom
gisce:fix/github-forwarded-mail-bot-login

Conversation

@giscebot
Copy link
Copy Markdown
Contributor

@giscebot giscebot commented May 26, 2026

Summary

  • accept GitHub notification emails rewritten by Google Groups when GitHub headers/reply metadata are preserved
  • support multiple trusted notification senders in policy
  • classify mentions, assignments, and review requests using configured bot logins while preserving the default pilipilisbot identity
  • document source.from lists and botLogins in the policy reference/example

Tests

  • .venv312/bin/python -m pytest tests/test_parser.py tests/test_policy.py tests/test_manual_enqueue_cli.py tests/test_queue.py tests/test_reader_run.py tests/test_executor.py tests/test_monitor.py -q
  • .venv312/bin/python -m pytest -q

@ecarreras ecarreras requested a review from pilipilisbot May 26, 2026 20:01
Copy link
Copy Markdown
Owner

@pilipilisbot pilipilisbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I checked the diff, the policy/parser docs, the existing queue/executor/dashboard behavior, and ran both the PR-focused test set and the full suite.

I’m requesting changes because this currently regresses the default bridge behavior. Policy.bot_logins defaults to an empty set, while the hardcoded @pilipilisbot patterns were removed from parser.py. As a result, existing deployments and unchanged tests that construct Policy(trusted_orgs={...}) no longer treat direct @pilipilisbot PR comments as actionable: they classify as archive_notification, become done, and never enter the pending/dispatch path.

Evidence:

  • Focused PR tests passed: ../github-agent-bridge/.venv/bin/python -m pytest tests/test_parser.py tests/test_policy.py tests/test_manual_enqueue_cli.py tests/test_queue.py tests/test_reader_run.py -q -> 50 passed.
  • Full suite failed: ../github-agent-bridge/.venv/bin/python -m pytest -q -> 26 failed, 133 passed.
  • Representative failure: tests/test_executor.py::test_assigned_pr_comment_upgrades_to_work_allowed expected reply_comment but got archive_notification for a direct @pilipilisbot PR comment using the default policy shape.
  • The dashboard/monitor failures cascade from the same issue because those tests enqueue default @pilipilisbot notifications and expect pending/running jobs.

Please preserve the existing default bot identity, or otherwise migrate the default/example policy and all call sites/tests so the default installed bridge keeps recognizing @pilipilisbot. Since this PR also adds source.from lists and botLogins, the policy reference/example should be updated in the same PR so operators know how to configure forwarded senders and bot identities.

@giscebot
Copy link
Copy Markdown
Contributor Author

Addressed the requested changes in 80dfee9 (fix: preserve default bot login policy).

What changed:

  • Policy() and policy files without botLogins now keep the default pilipilisbot identity, so existing direct @pilipilisbot notifications still classify as actionable.
  • An explicit "botLogins": [] remains supported for deployments that intentionally want no login matching.
  • policy.example.json, README.md, and docs/policy-reference.md now document source.from lists for forwarded senders and the botLogins key.

Verification:

  • .venv312/bin/python -m pytest tests/test_parser.py tests/test_policy.py tests/test_manual_enqueue_cli.py tests/test_queue.py tests/test_reader_run.py tests/test_executor.py tests/test_monitor.py -q -> 78 passed
  • .venv312/bin/python -m pytest -q -> 161 passed

Note: I initially tried the full suite under Homebrew Python 3.14, but it segfaulted inside Starlette/AnyIO test-client teardown. I reran under Python 3.12, which is within the project's declared >=3.11 range, and the full suite passed.

Copy link
Copy Markdown
Owner

@pilipilisbot pilipilisbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The follow-up commit 80dfee9 resolves the requested-change blocker by preserving the default pilipilisbot bot login when botLogins is omitted, while still allowing an explicit empty list.

I rechecked the PR diff and verified locally:

  • ../github-agent-bridge/.venv/bin/python -m pytest tests/test_parser.py tests/test_policy.py tests/test_manual_enqueue_cli.py tests/test_queue.py tests/test_reader_run.py tests/test_executor.py tests/test_monitor.py -q -> 78 passed
  • ../github-agent-bridge/.venv/bin/python -m pytest -q -> 161 passed
  • git diff --check -> passed

No GitHub checks are reported on the PR branch, so the local full-suite result is the current verification evidence.

@ecarreras ecarreras requested a review from pilipilisbot May 26, 2026 21:30
Copy link
Copy Markdown
Owner

@pilipilisbot pilipilisbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved again on the latest head e26c41b. The new commit treats APPROVED pull request reviews as non-actionable, which fits the bridge behavior we want: approval notifications should be acknowledged without dispatching another agent run.

I verified the review-followup/executor path and the full suite locally:

  • ../github-agent-bridge/.venv/bin/python -m pytest tests/test_github_followup_detection.py tests/test_executor.py -q -> 16 passed
  • ../github-agent-bridge/.venv/bin/python -m pytest -q -> 162 passed
  • git diff --check 80dfee9481dc8cdc011bc144ee50552ea3e21e43..HEAD -> passed

GitHub Actions are also green on the branch: dashboard, pytest (3.11), and pytest (3.12) passed on run 26476157892.

Copy link
Copy Markdown
Owner

@pilipilisbot pilipilisbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. I reloaded the full PR timeline for the latest review request, checked the current head e26c41b, and re-reviewed the dispatch change that treats APPROVED pull request review notifications as non-actionable.

Current verification:

  • GitHub Actions are green on e26c41b: dashboard, pytest (3.11), and pytest (3.12) all passed in run 26476157892.
  • Local focused verification still passes: ../github-agent-bridge/.venv/bin/python -m pytest tests/test_github_followup_detection.py tests/test_executor.py -q -> 16 passed.
  • The PR is mergeable with mergeStateStatus: CLEAN and reviewDecision: APPROVED.

I don’t see any new blocker after the latest follow-up commit.

@ecarreras ecarreras merged commit c34dcb6 into pilipilisbot:main May 26, 2026
3 checks passed
@giscebot
Copy link
Copy Markdown
Contributor Author

Post-merge cleanup completed for PR #52.

  • Confirmed the PR is merged: merge commit c34dcb6 on 2026-05-26 21:41 UTC.
  • Fetched repository refs; origin/main now includes the merge and is at ea5e935.
  • Checked local worktrees: the only registered checkout is the canonical repository at /home/openclaw/repos/github-agent-bridge, currently clean. No separate dedicated PR worktree exists, so nothing was removed.

@pilipilisbot
Copy link
Copy Markdown
Owner

Post-merge cleanup completed in the active OpenClaw workspace.

  • Confirmed PR fix: support forwarded GitHub notifications #52 is merged at c34dcb6; post-merge tests and release workflows succeeded on run IDs 26476795146 and 26476795142.
  • Fetched/pruned refs and fast-forwarded the canonical checkout to clean main at v0.19.1 (ea5e935).
  • Removed the clean dedicated worktree /home/openclaw/.openclaw/workspace/github/github-agent-bridge-pr52 and deleted stale local branch pr-52-forwarded-notifications.

@giscebot
Copy link
Copy Markdown
Contributor Author

Post-merge cleanup rechecked after the previous cleanup note.

  • No dedicated PR fix: support forwarded GitHub notifications #52 worktree remains registered; the only git worktree is the canonical checkout at /home/openclaw/repos/github-agent-bridge.
  • Removed the remaining merged local PR branch fix/github-forwarded-mail-bot-login (e26c41b), which is already an ancestor of main via merge commit c34dcb6.
  • Left the canonical checkout untouched because it currently has unrelated local changes on fix/bot-trigger-actors (src/github_agent_bridge/actors.py, tests/test_queue.py).

No PR #52 workspace artifacts remain to clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants