Files
glm-coding-helper/scripts
OLmatterandClaude Opus 4.7 03dd2f1e0e fix(userscript): v8.21.3 root-cause captcha loop — CFG undefined in captcha IIFE
真正根因:v8.21 在 captcha IIFE 内的 handleCaptchaDirectInPage 直接引用
CFG.CAPTCHA_CLICK_DELAY,但 captcha IIFE 是独立闭包,没有 CFG。
后端响应成功后走到 click loop 就抛 ReferenceError: CFG is not defined,
catch 块重置 captchaSent=false + lastCaptchaText='' → 50ms tick 死循环。

修复:
- captcha IIFE 顶部通过 GM_getValue('glm_coding_config_v5') 读
  CAPTCHA_CLICK_DELAY / RL_RETRY_DELAY(主 IIFE 写到同一 key),
  预计算 _clickDelay / _rlDelay 常量
- catch 块改为 30s 冷却(window.__glmCaptchaCooldownUntil),
  checkCaptchaPrompt 起手检查冷却直接 return,不再重发同一张图

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 23:27:53 +08:00
..
2026-05-25 18:31:54 +08:00