提交前确认 · Pre-submission checklist
问题类别 · Category
账号 / 登录 · Account / Login
涉及的 Agent 框架 · Agent framework
不涉及框架 · Not framework-specific
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
I purchased an active ZCode subscription and attempted to sign in to the ZCode desktop application on Ubuntu using “Connect to Z.ai — Global.”
The browser authentication completes successfully and displays “Authorization successful,” but ZCode does not complete the login. The application displays “登录失败,请重试” (“Login failed, please retry”).
The terminal log shows that the initial authentication/token response succeeds with code 0, but the subsequent business-token exchange fails with:
Error: zai_oauth_required
The failure occurs inside ZaiBusinessTokenResolver.exchangeBusinessToken and OAuthService.handleCallback. Because of this, I cannot sign in to ZCode or use my paid subscription.
复现步骤 · Steps to reproduce
- Install and open the ZCode desktop application on Ubuntu Linux.
- Click “Connect to Z.ai.”
- Select/use the Global Z.ai authentication option.
- Sign in through the browser using the account that owns the active paid ZCode subscription.
- Complete the authorization process.
- Observe that the browser displays “Authorization successful” and redirects back to the application.
- Observe that ZCode displays “登录失败,请重试” (“Login failed, please retry”).
- Check the terminal output.
- Observe that oauth.handleCallback fails with Error: zai_oauth_required.
期望表现 · Expected behavior
After successful browser authorization, ZCode should accept the OAuth callback, connect my Z.ai subscription to the desktop application, and sign me in successfully.
实际表现 · Actual behavior
The browser reports that authorization was successful, and the initial token response returns code 0. However, ZCode fails during the business-token exchange with Error: zai_oauth_required.
The application remains logged out and displays “登录失败,请重试” (“Login failed, please retry”).
ZCode 版本 · ZCode version
v3.3.4 [.deb]
设备 / 系统 / 浏览器 · Device / OS / Browser
Ubuntu 24.04 LTS
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
Browser result:
“Authorization successful — Redirecting to the application...”
ZCode result:
“登录失败,请重试” (“Login failed, please retry”)
Relevant sanitized terminal log:
[zaiOAuth] token final response body:
{
"code": 0,
"msg": "",
"data": {
"token": "[REDACTED]",
"user": {
"user_id": "[REDACTED]",
"email": "[REDACTED]",
"name": "[REDACTED]"
},
"zai": {
"access_token": "[REDACTED]"
}
}
}
[zcode-host] [rpc:call] oauth.handleCallback FAIL
Error: zai_oauth_required
at ZaiBusinessTokenResolver.exchangeBusinessToken
at ZaiProviderAdapter.exchangeToken
at OAuthService.runWithAdapterError
at OAuthService.handleCallback
The initial OAuth/token response succeeds, but the subsequent business-token exchange fails.

提交前确认 · Pre-submission checklist
问题类别 · Category
账号 / 登录 · Account / Login
涉及的 Agent 框架 · Agent framework
不涉及框架 · Not framework-specific
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
I purchased an active ZCode subscription and attempted to sign in to the ZCode desktop application on Ubuntu using “Connect to Z.ai — Global.”
The browser authentication completes successfully and displays “Authorization successful,” but ZCode does not complete the login. The application displays “登录失败,请重试” (“Login failed, please retry”).
The terminal log shows that the initial authentication/token response succeeds with code 0, but the subsequent business-token exchange fails with:
Error: zai_oauth_required
The failure occurs inside ZaiBusinessTokenResolver.exchangeBusinessToken and OAuthService.handleCallback. Because of this, I cannot sign in to ZCode or use my paid subscription.
复现步骤 · Steps to reproduce
期望表现 · Expected behavior
After successful browser authorization, ZCode should accept the OAuth callback, connect my Z.ai subscription to the desktop application, and sign me in successfully.
实际表现 · Actual behavior
The browser reports that authorization was successful, and the initial token response returns code 0. However, ZCode fails during the business-token exchange with Error: zai_oauth_required.
The application remains logged out and displays “登录失败,请重试” (“Login failed, please retry”).
ZCode 版本 · ZCode version
v3.3.4 [.deb]
设备 / 系统 / 浏览器 · Device / OS / Browser
Ubuntu 24.04 LTS
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
Browser result:
“Authorization successful — Redirecting to the application...”
ZCode result:
“登录失败,请重试” (“Login failed, please retry”)
Relevant sanitized terminal log:
[zaiOAuth] token final response body:
{
"code": 0,
"msg": "",
"data": {
"token": "[REDACTED]",
"user": {
"user_id": "[REDACTED]",
"email": "[REDACTED]",
"name": "[REDACTED]"
},
"zai": {
"access_token": "[REDACTED]"
}
}
}
[zcode-host] [rpc:call] oauth.handleCallback FAIL
Error: zai_oauth_required
at ZaiBusinessTokenResolver.exchangeBusinessToken
at ZaiProviderAdapter.exchangeToken
at OAuthService.runWithAdapterError
at OAuthService.handleCallback
The initial OAuth/token response succeeds, but the subsequent business-token exchange fails.