Skip to content

Fix auto-retry stopping permanently after limit and raise max to 50#2

Open
nandanadileep wants to merge 1 commit intoAngel2mp3:mainfrom
nandanadileep:fix/auto-retry-limit-and-reset
Open

Fix auto-retry stopping permanently after limit and raise max to 50#2
nandanadileep wants to merge 1 commit intoAngel2mp3:mainfrom
nandanadileep:fix/auto-retry-limit-and-reset

Conversation

@nandanadileep
Copy link
Copy Markdown

Summary

Fixes #1 — two related problems with the auto-retry feature:

Bug: retries stop working permanently after hitting the limit

ge_imRetryCount is 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, when ge_findModerationSignal() returns false (moderation has cleared — meaning a new generation succeeded or the user started fresh), reset ge_imRetryCount to 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 max attribute and the change-handler validation both capped the value at 20. Both updated to 50.

Files changed

  • Grok-Enhancer.user.js — reset logic in ge_checkModeration, input max raised to 50

Test plan

  • Hit the retry limit — retries should stop as before
  • Submit a new prompt that generates successfully — status should reset to "Ready" and retries should work again on the next moderated response
  • Set Max Retries to a value above 20 (e.g. 35) — it should save and be respected

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
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.

Grok Enhancer stops working after 20 auto retry limit. Also please add feature to increase the limit to atleast 50.

1 participant