Skip to content

Clear stale monitor execution state#125

Merged
alvarosanchez merged 2 commits into
mainfrom
codex/clear-monitor-liveness-state
May 13, 2026
Merged

Clear stale monitor execution state#125
alvarosanchez merged 2 commits into
mainfrom
codex/clear-monitor-liveness-state

Conversation

@alvarosanchez
Copy link
Copy Markdown
Owner

Summary

  • Clear stale monitor-only executionState when GitHub Sync turns a fired monitor PR wait into a healthy unassigned in_review state.
  • Add regression coverage for a triggered Paperclip monitor whose linked PR remains review-ready.
  • Repair the real host path where local Paperclip REST status patches succeed but do not clear raw executionState by issuing a focused SDK state-clear patch afterward.

Root Cause

Paperclip issue monitors leave historical monitor state in executionState.monitor after a monitor fires. When GitHub Sync later observed the linked PR as a healthy maintainer/review wait, it cleared the assignee but left that monitor-only execution state behind. Paperclip liveness recovery then saw an in_review issue with executionState but no resolvable currentParticipant, and created invalid_review_participant recovery work.

Validation

  • pnpm build
  • pnpm typecheck
  • pnpm test
  • Disposable real-host verification with rebuilt local plugin installed into paperclipai@2026.512.0:
    • Created an in_review Monitor PR child assigned to a test Micronaut Engineer agent.
    • Scheduled and triggered a Paperclip monitor so the issue had fired monitor-only executionState.
    • Linked the issue to real GitHub PR micronaut-projects/micronaut-core#12668, verified CLEAN with green checks.
    • Ran installed plugin sync.runNow through the Paperclip plugin action bridge.
    • Confirmed final issue state: status=in_review, no assignee, executionState=null.
    • Confirmed Paperclip liveness preview returned findings=0 and no invalid_review_participant item.

Model Used

  • Model ID/version: Codex GPT-5, as exposed by this Codex session.
  • Context window size: not exposed by the local Codex desktop runtime to this agent.
  • Capabilities used: shell commands, local file edits, git/GitHub CLI, Paperclip disposable host verification, GitHub API via gh.

Copilot AI review requested due to automatic review settings May 13, 2026 19:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves GitHub Sync’s handling of Paperclip monitor-triggered issues by ensuring stale monitor-only executionState is cleared when a fired monitor PR wait becomes a healthy, unassigned in_review state. This prevents Paperclip liveness recovery from generating invalid_review_participant work due to leftover monitor state.

Changes:

  • Broaden “healthy maintainer wait” detection to allow clearing monitor-only/stale executionState while keeping PRs in in_review and unassigned.
  • Add a regression scenario asserting that a triggered monitor wait ends with executionState = null.
  • Add a follow-up SDK patch after successful local REST PATCHes to reliably clear raw executionState on real hosts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/worker.ts Expands maintainer-wait execution-state eligibility and adds a post-REST SDK patch to clear executionState.
tests/plugin.spec.ts Adds a regression scenario for a monitor-triggered executionState and asserts it is cleared after sync.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/worker.ts Outdated
Comment thread tests/plugin.spec.ts Outdated
@alvarosanchez alvarosanchez merged commit 4984ca5 into main May 13, 2026
1 check passed
@alvarosanchez alvarosanchez deleted the codex/clear-monitor-liveness-state branch May 13, 2026 20:09
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.

2 participants