Skip to content

fix: archive IMAP lifecycle events - #318

Merged
ecarreras merged 1 commit into
mainfrom
fix/issue-299-lifecycle-email-events
Oct 21, 2026
Merged

ecarreras merged 1 commit into
mainfrom
fix/issue-299-lifecycle-email-events

Conversation

@giscebot

Copy link
Copy Markdown
Collaborator

Requested by: @ecarreras

TASK-85718

Summary

  • recognize GitHub issue_event/<id> close and reopen emails before assignment/footer heuristics;
  • archive those lifecycle notifications as non-executable policy no-ops instead of creating open_issue work;
  • require the timeline Message-ID, #event- URL, and lifecycle phrase together so normal comments discussing a closed issue remain actionable;
  • document the IMAP/webhook lifecycle behavior.

Why

GitHub lifecycle emails can include You are receiving this because you were assigned. in their delivery footer. The generic assignment heuristic treated that footer as the event itself, so close/reopen notifications could become open_issue + work_allowed. This is one of the concrete divergence classes blocking webhook promotion in #299.

The fix is deliberately conservative: it does not infer lifecycle state from arbitrary comment text, change webhook cutover configuration, or claim cross-source parity is complete.

Validation

  • focused regression run: 6 passed
  • PYTHONPATH=src /home/openclaw/.local/share/github-agent-bridge/venv/bin/pytest -q --disable-warnings — 603 passed
  • git diff --check

Risk

Low and bounded to IMAP timeline-event classification. A close/reopen notification now persists as the established archive_notification no-op. Assignment and comment events keep their existing behavior, and webhook unmerged-close handling is unchanged.

Refs #299

Co-authored-by: ecarreras <ecarreras@users.noreply.github.com>

@pilipilisbot pilipilisbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for this bounded IMAP lifecycle fix. The parser requires a timeline issue_event Message-ID, an #event- URL, and close/reopen text before archiving; that check precedes the assignment-footer heuristic while merge detection retains precedence. The queue test confirms an archived no-op rather than executable work, and the docs keep webhook rollout scope explicit.

I reviewed the changed parser, queue tests, and docs; directly exercised close, reopen, and assignment cases against this head; and checked the green Python 3.11/3.12 CI. The local pytest executable cited in the PR is not present on this host, so I did not reproduce the full suite locally. This is a narrow divergence fix, not completion of the cross-source identity/authorization parity or observation gates in #299.

@ecarreras
ecarreras merged commit aeb0d9c into main Oct 21, 2026
4 checks passed
@ecarreras
ecarreras deleted the fix/issue-299-lifecycle-email-events branch October 21, 2026 06:51
@pilipilisbot

Copy link
Copy Markdown
Collaborator

Post-merge sync complete for #318: GitHub confirms the PR merged as aeb0d9cef09b0d925a8a5a42c4244a1fd84575cd (head 6c3153fd7cdd0007be6e6a0c7f9baa9ff523e62f). The dedicated, clean worktree at /home/openclaw/projects/gisce-ti/worktrees/github-agent-bridge-pr-318 was removed and pruned; a fresh worktree scan shows no remaining checkout for this PR. The canonical checkout was left untouched. No code or PR-branch changes were made in this review-only sync.

@giscebot

Copy link
Copy Markdown
Collaborator Author

Post-merge sync complete.

  • Merge commit: aeb0d9c
  • CI: dashboard, pytest 3.11 and pytest 3.12 passed; the external agent check remains pending in GitHub.
  • The dedicated local worktree was clean and has been removed; the canonical checkout was left untouched.
  • The broader webhook/IMAP parity and observation gates in Make webhooks the primary ingestion path and retire IMAP safely #299 remain open.

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