[Bug] Windows 3.8.1: Aliyun CAPTCHA getInstance times out after 10000ms; SDK config order is incorrect
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索现有 Issues/Discussions;未发现包含
Captcha instance timed out、captcha verify failed或3007的同类报告。 - 我已阅读 CONTRIBUTING.md。
分类
- 问题类别:对话 / Agent 交互 · Agent chat
- Agent 框架:ZCode Agent(自研)
- 严重程度:阻塞使用 · Blocking
- 复现频率:必现 · Always(在此机器上进入 CAPTCHA challenge 时)
问题描述 · Description
Windows 版 ZCode 3.8.1 使用内置 Z.ai Start Plan / GLM-5.3 时,CAPTCHA challenge 无法进入可交互状态:界面没有出现滑块或弹窗,客户端等待 10 秒后报:
ProtocolRequestError: Captcha instance timed out after 10000ms.
缺少或拒绝无效验证码令牌的请求还会被服务端以独立错误拒绝:
provider_code=3007
reason=auth_failed
status=400
retryable=false
message=captcha verify failed
客户端实例超时与服务端 3007 是同一 CAPTCHA 流程中的两个不同失败阶段,不应被合并成同一个错误。
复现步骤 · Steps to reproduce
- 在 Windows 11 上安装并启动官方 ZCode 3.8.1。
- 登录具有 Z.ai Start Plan 的账号,选择 GLM-5.3。
- 创建或继续一个 ZCode Agent 任务并发送请求,直至 Start Plan 请求进入 CAPTCHA challenge。
- 观察界面:没有出现可操作的验证码弹窗或滑块。
- 约 10 秒后,请求以
Captcha instance timed out after 10000ms/Model request failed结束。 - 后续请求可能收到服务端
3007 captcha verify failed。
该现象在两个独立代理出口上相同复现,因此不像单一出口 IP 问题。
期望表现 · Expected behavior
- 按阿里云 CAPTCHA 文档要求,在加载 SDK 前设置
window.AliyunCaptchaConfig。 getInstance应及时回调;需要交互验证时,应显示可操作的弹窗/滑块。- 实例创建失败或超时后,应丢弃失败实例并允许下一次请求重新初始化。
- 客户端实例超时与服务端 3007 应显示不同、可诊断的错误信息。
实际表现 · Actual behavior
官方 3.8.1 renderer bundle 中,初始化顺序为:
await yEt(); // 动态加载 AliyunCaptcha.js
// ...
window.AliyunCaptchaConfig = { region: e.region, prefix: e.prefix };
但阿里云 Web/H5 接入文档要求先设置 window.AliyunCaptchaConfig,再动态加载 SDK:
此外,实例等待超时后存在一个粘滞状态:
xEt()在E$ && E$.configKey === t时直接复用缓存的E$;SEt()在 10000ms 后拒绝等待;- 超时处理通过
M$()清理当前请求D$,但没有清除E$或重新创建instancePromise; - 下一次相同配置仍会复用未完成的旧
instancePromise,继续超时,直至 renderer 重启。
本地诊断实验仅将配置赋值移动到 SDK 加载之前,并重新计算 ASAR integrity:SDK、CAPTCHA iframe 与若干模型请求随后可以成功,说明加载顺序确实相关。但普通运行中稍后仍发生一次实例超时,表明还需要修复失败实例的清理/重建路径;这不是一个完整的用户侧 workaround。
环境 · Environment
- ZCode Desktop:
3.8.1.5310 - Agent runtime:
0.16.3 - Model/provider:
builtin:zai-start-plan / GLM-5.3 - OS: Windows 11 Home, x64, build
26200 - Installation: official Windows desktop package
脱敏日志 · Redacted logs
AI SDK stream failed
cause: ProtocolRequestError
message: Captcha instance timed out after 10000ms.
durationMs: 11381
Turn failed
cause: Model request failed.
inner cause: ZCode Protocol CAPTCHA instance timeout
另一次服务端拒绝:
provider=builtin:zai-start-plan
provider_code=3007
model=GLM-5.3
reason=auth_failed
status=400
retryable=false
message=captcha verify failed
未附完整日志,因为其中包含账号会话、请求 ID 与工作区信息;如维护者需要,可通过 ZCode 应用内反馈渠道提供自动脱敏后的诊断包。
建议修复 · Suggested fix
- 在插入/复用
AliyunCaptcha.js之前设置并校验window.AliyunCaptchaConfig。 getInstance超时、初始化onError或终止失败时清除E$,移除旧挂载内容并重新初始化,避免缓存未完成的 promise。- 只有在实例 ready 后启动 traceless verification;需要交互时确保主窗口获得可见 challenge。
- 将本地
Captcha instance timed out与服务端3007 captcha verify failed分开映射和上报。 - 增加回归测试:首次初始化、同配置复用、实例超时后重建、交互 fallback、renderer 重启恢复。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the official 3.8.1 renderer bundle and trace AliyunCaptcha.js loading around yEt(), xEt(), SEt(), M$(), E$, and D$. Verify the configuration is set before SDK loading and inspect how timeout or initialization failure handles the cached instance. Done means failed instances can be rebuilt, interactive challenges appear, and client timeouts remain distinct from server 3007 errors; the issue also requests regression coverage for these paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- authentication, desktop, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100