Add recover() method to Probot to fix stuck initialization state#14
Draft
Copilot wants to merge 3 commits intocopilot/process-heavy-datafrom
Draft
Add recover() method to Probot to fix stuck initialization state#14Copilot wants to merge 3 commits intocopilot/process-heavy-datafrom
Copilot wants to merge 3 commits intocopilot/process-heavy-datafrom
Conversation
Co-authored-by: nigelfpowers <202913696+nigelfpowers@users.noreply.github.com>
When Probot initialization fails, initializationState gets permanently stuck as INITIALIZING with no way to retry. Add a public recover() method that resets the initialization state and retries, enabling recovery from transient failures without creating a new Probot instance. No existing code was deleted; only additions were made. Co-authored-by: nigelfpowers <202913696+nigelfpowers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recover function without deletions
Add recover() method to Probot to fix stuck initialization state
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
#initialize()fails,initializationStatepermanently sticks atINITIALIZING, making every subsequentauth(),getNodeMiddleware(), etc. return the original rejected promise with no retry path — short of constructing a newProbotinstance.Changes
src/probot.ts: Addspublic async recover()toProbot. ResetsinitializationState → UNINITIALIZEDand replaces the settledDeferredPromisewith a fresh one, then calls#initialize()to retry. No-ops if alreadyINITIALIZED. No existing lines removed.test/probot.test.ts: Adds arecovertest suite — simulates a first-init failure via a customOctokitsubclass that throws on its first construction, assertsauth()rejects, callsrecover(), then assertsauth()succeeds.Usage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
bad.n8kk48m.proxy/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development /home/REDACTED/work/probot/probot/node_modules/tinypool/dist/entry/process.js(dns block)bad.nq1mv9s.proxy/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development /home/REDACTED/work/probot/probot/node_modules/tinypool/dist/entry/process.js(dns block)smee.io/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development /home/REDACTED/work/probot/probot/node_modules/tinypool/dist/entry/process.js(dns block)/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development /home/REDACTED/work/probot/probot/node_modules/tinypool/dist/entry/process.js -p 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh(dns block)/opt/hostedtoolcache/node/24.13.1/x64/bin/node /opt/hostedtoolcache/node/24.13.1/x64/bin/node --conditions node --conditions development /home/REDACTED/work/probot/probot/node_modules/tinypool/dist/entry/process.js -p modules/@npmcli/run-script/lib/node-gyp-bin/sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.