fix(YouTube): fix bare except, browser leak, recursion limits#235
fix(YouTube): fix bare except, browser leak, recursion limits#235tatenda-source wants to merge 2 commits intoFujiwaraChoki:mainfrom
Conversation
…lidation Closes FujiwaraChoki#225 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86a2aaedf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not hasattr(self, '_script_retries'): | ||
| self._script_retries = 0 | ||
| self._script_retries += 1 | ||
| if self._script_retries > 5: | ||
| warning("Max retries reached for script generation. Using current script.") | ||
| self._script_retries = 0 |
There was a problem hiding this comment.
Reset retry counters after successful generation
_script_retries is incremented for oversized scripts but only reset when the max is exceeded, so a successful retry leaves a nonzero counter behind. Since the same YouTube instance is reused for multiple generations in the interactive flow, later videos can hit the max retry path too early and skip intended retries even when this run is the first failure. The same state-leak pattern appears in metadata/prompt retry counters as well, so counters should be cleared on successful generation.
Useful? React with 👍 / 👎.
Clears _script_retries, _metadata_retries, and _prompts_retries after successful generation so reused YouTube instances don't hit the max retry path prematurely on later videos. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
except:withexcept Exception as e:and log the errorfinallyblock instead of only on successCloses #225
Test plan
🤖 Generated with Claude Code