Fix auto-retry stopping permanently after limit and raise max to 50#2
Open
nandanadileep wants to merge 1 commit intoAngel2mp3:mainfrom
Open
Fix auto-retry stopping permanently after limit and raise max to 50#2nandanadileep wants to merge 1 commit intoAngel2mp3:mainfrom
nandanadileep wants to merge 1 commit intoAngel2mp3:mainfrom
Conversation
The retry counter was never reset after hitting the limit, causing retries to stay broken for the rest of the browser session even after navigating away and back (SPA). Fix by resetting ge_imRetryCount to 0 when the moderation signal clears and enough time has elapsed since the last retry, so each new generation attempt starts with a fresh counter. Also raise the Max Retries input cap from 20 to 50 as requested. Closes Angel2mp3#1
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.
Summary
Fixes #1 — two related problems with the auto-retry feature:
Bug: retries stop working permanently after hitting the limit
ge_imRetryCountis scoped to the script's closure and never reset after exhausting retries. Because Grok is a SPA, navigating away and back does not re-run the userscript, so the counter stays at the max for the entire browser session — explaining why a page refresh does nothing and only a full browser restart helps.Fix: in
ge_checkModeration, whenge_findModerationSignal()returns false (moderation has cleared — meaning a new generation succeeded or the user started fresh), resetge_imRetryCountto 0 if it was non-zero and at least 5 seconds have passed since the last retry. The 5-second cooldown prevents the counter from resetting during the brief moment between a retry click and the moderation signal reappearing.Enhancement: raise Max Retries cap from 20 to 50
The input's
maxattribute and the change-handler validation both capped the value at 20. Both updated to 50.Files changed
Grok-Enhancer.user.js— reset logic inge_checkModeration, input max raised to 50Test plan