AIStudio2API icon indicating copy to clipboard operation
AIStudio2API copied to clipboard

[Bug] OpenBidi aborts immediately if EnsureDisclaimerAcknowledged fails (401/429/5xx) without marking account state or failing over

Open photobrand opened this issue 1 week ago • 1 comments

发生了什么 / What happened

Summary

In internal/aistudio/webchannel.go:140-172, PooledService.OpenBidi loops across eligible accounts to establish a Gemini Live / Robotics WebChannel session. However, before opening the WebChannel, it calls EnsureDisclaimerAcknowledged (GetUserPreferences / UpdateUserPreferences) and returns immediately on any error:

if err := s.client.EnsureDisclaimerAcknowledged(ContextWithAccountLease(ctx, lease), request.AccountID, request.Mode); err != nil {
	if owned {
		err = errors.Join(err, lease.Release())
	}
	return nil, err
}

Trigger & Consequence

On an account's first Live/Robotics call in a process, EnsureDisclaimerAcknowledged makes live upstream RPCs over that account's credentials and proxy. If that account has expired cookies (HTTP 401, code 16), hits 429, or encounters a transient 5xx/network error:

  1. OpenBidi immediately fails the Live/Robotics session on attempt 0 instead of trying the remaining healthy accounts in the pool.
  2. ConfirmAuthenticationFailure / markRetryableFailure is never called, so the broken account stays ready and gets picked again on the next Live request.

Suggested Fix

Route errors from EnsureDisclaimerAcknowledged (when owned is true) through the same retryable-error / auth-confirmation / account-switch path used for OpenBidiProtected (lines 214-238).

版本 / Version

v0.3.14

photobrand avatar Nov 22 '26 15:11 photobrand

每人最多同时打开 3 个 Issue,这个 Issue 已自动关闭。请等已有的 Issue 处理完再提,或把内容补充到已有的 Issue 里。

Each user can have at most 3 open issues at a time, so this one was closed automatically. Please wait until your existing issues are resolved, or add this to one of them.

github-actions[bot] avatar Nov 22 '26 15:11 github-actions[bot]