[Bug] Linux 登录停在等待认证,未弹出默认浏览器
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
- 我已搜索过现有 issue,确认这不是重复。
- 我已阅读 CONTRIBUTING.md。
问题类别 · Category
账号 / 登录 · Account / Login
涉及的 Agent 框架 · Agent framework
不涉及框架 · Not framework-specific
严重程度 · Severity
阻塞使用 · Blocking(首次登录无法继续)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
Linux 桌面版点击 Z.ai 或 BigModel 账号登录后,ZCode 进入“等待认证”状态,但默认浏览器没有打开授权页,界面会一直轮询到超时。使用官方 RPM 重新安装后问题仍可复现。
进一步诊断发现:ZCode 已正确生成授权请求并调用系统的 /usr/bin/xdg-open;xdg-open/gio open 均返回 0,但正在运行的 Firefox 没有收到或导航到该地址。把同一笔授权地址直接传给 /usr/bin/firefox 后,BigModel 国内登录页可以正常打开,完成授权后 ZCode 也能正常登录。
因此建议除修复浏览器交接外,在“等待认证”弹窗增加“重新打开浏览器”和“复制登录链接”入口,避免系统 opener 静默失败时用户只能等待超时。
复现步骤 · Steps to reproduce
- 在 Fedora 44 / GNOME Wayland 中将 Firefox 设为默认浏览器。
- 启动 ZCode 3.10.1 Linux x64 官方 RPM。
- 选择 BigModel 国内账号登录(Z.ai 登录入口也出现过相同行为)。
- ZCode 显示“等待 BigModel 完成认证”。
- 观察到 Firefox 没有打开授权页,ZCode 持续轮询。
期望表现 · Expected behavior
点击登录后,授权页应自动在默认浏览器中打开;如果系统浏览器调用未实际完成导航,界面应提供重新打开或复制链接的备用入口。
实际表现 · Actual behavior
ZCode 停留在等待认证状态,浏览器未显示授权页。日志表明 OAuth 轮询已启动,系统 opener 的进程退出码也是 0,因此界面没有错误提示。
ZCode 版本 · ZCode version
v3.10.1(官方 Linux x64 RPM,包版本 zcode-3.10.1-6272.x86_64)
设备 / 系统 / 浏览器 · Device / OS / Browser
- Fedora Linux 44 x86_64
- GNOME / Wayland
- Mozilla Firefox(系统默认浏览器)
- 网络代理保持启用;BigModel 国内站本身可正常访问
日志与诊断 · Logs / diagnostics
已脱敏的关键日志:
[oauthService][trace:OAuth polling flow started] {"expiresInMs":299395,"pollIntervalMs":2000,"provider":"bigmodel"}
[zcode-host] [rpc:call] oauth.startOAuthWithPolling OK
进程跟踪结果(授权 URL 与 state 已省略):
ZCode -> /usr/bin/xdg-open <BigModel OAuth URL> # exit 0
xdg-open -> gio open <BigModel OAuth URL> # exit 0
Firefox 未导航到授权 URL
/usr/bin/firefox <同一 BigModel OAuth URL> # exit 0,页面正常打开
最终通过第二种方式打开国内 BigModel 授权页并成功登录,说明 OAuth 生成、网络连通性和 ZCode 回调处理本身均正常,故障集中在 Linux 系统浏览器交接环节。
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 by reproducing the login flow on Fedora 44 with GNOME Wayland and Firefox, comparing /usr/bin/xdg-open and gio open with launching Firefox directly. Trace the Linux browser handoff used by OAuth and verify that the authorization page opens reliably; done means login no longer waits indefinitely and the waiting dialog offers reopening or copying the link when handoff fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- authentication, desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100