Skip to content

Qoder国际版调度查询问题 #284

Closed

Description

@Hiyajomaho-num9

What happened

当Qoder登录完毕后,前端余额调度却迟迟不更新,需要手动更新

Reproduction

问题点在于

if health.Hot || ready {
    m.fetchQuota(ctx, item.ID, item.URL, forceQuota)
    m.fetchAccountModels(ctx, item)
}
return nil

和

func (m *Manager) fetchQuota(ctx context.Context, accountID, workerURL string, force bool) {
	client := qoder.WorkerClient{
		HTTP:        &http.Client{Timeout: 5 * time.Second},
		ProxyAPIKey: m.ProxyAPIKey(),
	}
	quota, err := client.Quota(ctx, workerURL, force)
	if err != nil || quota == nil {
		return

当 Qoder 账号登录完成,health.Hot || ready 条件满足执行fetchQuota时,fetchQuota在额度查询过程中不返回是否为等待获取或获取额度失败做静默处理,导致前端无法正确识别额度刷新成功。
若后续用户不主动执行额度获取动作时,前端则持续显示旧额度或空额度。

建议:
1.让 fetchQuota 返回 error,将error原因反馈给前端
2.解耦前端额度显示需要获取等待模型列表步骤

Versions

No response

Activity

  1. caigee-cmd commented on Oct 10, 2026

    @caigee-cmd
    Owner

    已由 #287 修复并合入 main(merge commit ac4f008)。

    改动要点:

    • fetchQuota 现在返回 error(typed QuotaRefreshError),额度查询失败/空响应不再被静默吞掉。
    • 单账号刷新接口 POST /api/accounts/{id}/refresh 会把该错误以 502 account_refresh_failed 返回,前端在账号卡片上显示失败原因。
    • 额度刷新与模型目录刷新改为并发执行,额度接口故障不再阻塞模型目录刷新。
    • 后台维护 RefreshAll 仍保持 best-effort,不因额度失败而中断。

    对应本 issue 的两点建议均已覆盖:

    1. fetchQuota 返回 error 并把原因反馈给前端;
    2. 解耦额度显示与模型列表步骤。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions