[Bug] OpenBidi aborts immediately if EnsureDisclaimerAcknowledged fails (401/429/5xx) without marking account state or failing over
发生了什么 / 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:
OpenBidiimmediately fails the Live/Robotics session on attempt 0 instead of trying the remaining healthy accounts in the pool.ConfirmAuthenticationFailure/markRetryableFailureis never called, so the broken account staysreadyand 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
每人最多同时打开 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.