Repository navigation
[3811 by GPT-6.2 Astra] Idle shutdown: redeliver the GitHub webhook that woke the instance (direct-webhook mode) - #3812
Conversation
Implemented direct-webhook recovery for issue #3811. After a recorded idle stop, ProPR waits for the webhook listener, scans GitHub App deliveries back to two minutes before the stop, and requests up to 200 redeliveries. It skips GUIDs with a later successful attempt and stops on rate limits. Recovery counts are logged and exposed at `idleShutdown.lastWake.webhookRecovery`. The Fly smoke workflow and tutorial use the versions from PR #3804, which were absent from this checkout. The workflow now checks the App’s event subscriptions, configures its webhook, verifies that GitHub accepted a redelivery after wake, and restores the previous configuration during cleanup. Verification: 77 tests passed, including an in-flight duplicate test. TypeScript, OpenAPI validation, and the docs build passed. App JWT requests and fixture restoration were also verified with mocked GitHub responses. Live Fly verification remains pending. The temporary-branch push needed to trigger it is handled by the automated workflow, so there is no live run link yet. ProPR-Agent: codex/gpt-6.2-astra
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 34881fd Summary of ChangesFixed the Core lint passed with zero warnings, the TypeScript build passed, and all 62 focused shutdown and webhook recovery tests passed. Review digestRisk-tiered paths
Diff size: 1 file changed, +2/−15 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed the `max-lines` failure in [idleShutdown.ts](/home/node/workspace/src/daemon/idleShutdown.ts) by reusing five existing `IdleDrainContext` field definitions and simplifying an import. The change preserves runtime behavior. Core lint passed with zero warnings, the TypeScript build passed, and all 62 focused shutdown and webhook recovery tests passed. PR: #3812 Comment by: @github-actions[bot] (ID: 7169598790) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot] Analysis SummaryThe reported Validate Changes failure is already fixed on the PR branch. At I reproduced the original failure and verified that GitHub canceled the follow-up validation run during dependency installation, before it reached lint. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Scope: keep this PR to the core recoveryF1 (blocker): this PR creates Please:
Items 6 and 7 of #3811 move to #3804. The live smoke acceptance for #3811 runs from #3804 once both are on the epic branch. |
|
✅ Applied the requested follow-up changes in commit 75053c9 Summary of ChangesRemoved the Fly smoke workflow and setup tutorial from #3812. Both paths now have an empty diff against GitHub denied the integration permission to edit the PR description. The handoff text remains pending: Handoff to #3804Items 6 and 7 of #3811 move to #3804. After #3812 merges, update #3804 from the epic and apply these changes:
Run live smoke acceptance for #3811 from #3804 once both changes are on the epic branch. Review digestRisk-tiered paths
Diff size: 2 files changed, +0/−423 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
Removed the Fly smoke workflow and setup tutorial from #3812. Both paths now have an empty diff against `3758-epic-runtime-abstraction-sc0`. The core recovery, replay protection, status API and client types, tests, and operations guide with the measured 15–20 s cold start are intact. All 35 focused tests passed. GitHub denied the integration permission to edit the [PR description](#3812). The handoff text remains pending: ### Handoff to #3804 Items 6 and 7 of #3811 move to #3804. After #3812 merges, update #3804 from the epic and apply these changes: - Replace PAT-based repository webhook creation in the smoke workflow. Save the fixture App’s webhook configuration, point its own webhook at the disposable instance with `PATCH /app/hook/config`, and restore the original configuration in an `always()` step. - Require the fixture App to subscribe to both **Issues** and **Pull request** events. - Update the Fly tutorial to explain that after the instance starts, ProPR requests redelivery of the webhook delivery that woke it. Run live smoke acceptance for #3811 from #3804 once both changes are on the epic branch. PR: #3812 Comment by: @integry (ID: 7170914658) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds bounded GitHub App delivery recovery after idle wake, with status reporting and focused tests. It needs a localized correction to deduplication retention before merge. ✅ Listener readiness — API startup now awaits ✅ Bounded recovery — Recovery caps redelivery requests at 200, spaces requests, and reports errors and counters. ✅ Concurrent duplicate protection — The added test verifies that a redelivery arriving during original processing receives 409 without invoking the processor again. The supplied current-head checks show no failures and one pending check. This review uses static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Retain reservations across duplicate attempts
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise live wake recoveryThe implementation summary says live Fly verification remains pending. A smoke run demonstrating a timed-out waking delivery followed by successful processing would complement the injected API tests and verify the platform timing assumptions. This is optional deployment evidence, rather than a separate verified code blocker. ScoreThe implementation is focused and the reported checks are encouraging, but automatic recovery can outlive the deduplication reservation and repeat processing. The required correction is localized. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 1e79e6f
Summary of ChangesFixed F1. A duplicate webhook now atomically renews its GUID reservation before returning HTTP 409, so concurrent attempts cannot both enter processing. The new regression covers a duplicate just before expiry followed by idle recovery just after the original expiry. Recovery received 409, and the processor ran exactly once. All 42 focused tests passed. TypeScript and Review digestRisk-tiered paths
Diff size: 4 files changed, +60/−117 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Fixed F1. A duplicate webhook now atomically renews its GUID reservation before returning HTTP 409, so concurrent attempts cannot both enter processing. The new regression covers a duplicate just before expiry followed by idle recovery just after the original expiry. Recovery received 409, and the processor ran exactly once. All 42 focused tests passed. TypeScript and `git diff --check` also passed. PR: #3812 Comment by: @propr-ultrafix (ID: 0) Model: GPT-6.2 Astra ProPR-Agent: codex/gpt-6.2-astra
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds bounded GitHub App webhook recovery after idle wake, extends delivery deduplication retention, and exposes recovery results through the status API. No merge-blocking defect is demonstrated by the supplied diff and context. Merge readiness is conditional on the remaining checks completing successfully. ✅ Listener readiness — API startup now awaits the listening event before the all-in-one supervisor starts the daemon. ✅ Bounded recovery — Recovery deduplicates delivery GUIDs across pages, caps redelivery requests at 200, and stops on reported rate-limit exhaustion. ✅ Concurrent replay protection — The atomic Redis operation retains duplicate suppression while renewing expiry; the added test covers redelivery during original processing. This was a static review; no commands were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Cover recovery API failuresThe new tests cover pagination, request limits, and quota exhaustion, but not exceptions during listing or partway through redelivery. Optional tests could verify that S3: 🟢 Verify production Redis semanticsThe replay tests use an in-memory implementation of ScoreThe implementation is focused and includes useful boundary and concurrency coverage. No verified blocker remains; the supplied current-head status reports no failures and four pending checks, while live Fly verification remains unconfirmed. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3811
Branch:
3811/gpt-6.2-astra-idle-shutdown-redeliver-t-20261125-1715-kfxCommits: ✅ Changes committed (bebd3a3)
AI Processing Completed
Execution Details:
Summary:
Implemented direct-webhook recovery for issue #3811. After a recorded idle stop, ProPR waits for the webhook listener, scans GitHub App deliveries back to two minutes before the stop, and requests up to 200 redeliveries. It skips GUIDs with a later successful attempt and stops on rate limits. Recovery counts are logged and exposed at
idleShutdown.lastWake.webhookRecovery.The Fly smoke workflow and tutorial use the versions from PR #3804, which were absent from this checkout. The workflow now checks the App’s event subscriptions, configures its webhook, verifies that GitHub accepted a redelivery after wake, and restores the previous configuration during cleanup.
Verification: 77 tests passed, including an in-flight duplicate test. TypeScript, OpenAPI validation, and the docs build passed. App JWT requests and fixture restoration were also verified with mocked GitHub responses.
Live Fly verification remains pending. The temporary-branch push needed to trigger it is handled by the automated workflow, so there is no live run link yet.
Review digest
Risk-tiered paths
.github/workflows/fly-e2e.yml(added, +290/−0): CI or workflow filepackages/api/openapi/routeDocsIdleShutdown.ts(+4/−0)packages/api/server.ts(+4/−1)packages/api/webhookHandler.ts(+8/−11)packages/client/src/generated/apiTypes.ts(+7/−0)packages/shared/src/idleShutdown.ts(+9/−0)src/daemon.ts(+12/−4)src/daemon/directWebhookRecovery.ts(added, +94/−0)src/daemon/idleShutdown.ts(+10/−0)docs/docs/operations/idle-shutdown.md(+5/−1)docs/docs/tutorials/setup-fly.md(added, +135/−0)docs/static/openapi/propr-api.yaml(+19/−0)test/directWebhookRecovery.test.ts(added, +61/−0)test/idleShutdownRecovery.test.ts(+23/−0)test/webhookReplayProtection.test.ts(+29/−0)Diff size: 15 files changed, +710/−17 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3811.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Recovering the webhook that wakes a Fly Machine
Idle shutdown guide showing the measured cold start, recovery window, and API status counters.
Full-size original