flow-agent icon indicating copy to clipboard operation
flow-agent copied to clipboard

v2.0.7 can't capture a token on the new flow.google.com batchexecute build (has_flow_key stays False)

Open QuanPH20104 opened this issue 2 months ago • 0 comments

Summary

On a fresh install of v2.0.7 (extension v1.2.4), the backend and extension connect fine, but flow status never advances past has_flow_key: False, so no generation can start. Root cause: Google has migrated Flow to a new host and RPC protocol that this project does not target.

Backend: up (http://127.0.0.1:8001)
  status:              unauthorized_or_disconnected
  extension_connected: True
  has_flow_key:        False

Backend log loops forever:

Client ... has no cached token. Triggering auto token refresh...
Requesting client ... to open/refresh Flow tab...
Extensions connected but no auth tokens — requesting flow tabs...

Root cause

Inspecting a live generation request from the current Flow web app (frontend build label boq_labs-ai-sandbox-frontend_20260917, i.e. shipped 2026-09-17) shows Google now serves Flow from a new host using the batchexecute RPC protocol with first-party cookie auth:

  • Request host/path: https://flow.google.com/_/AiSandboxAngularFrontend/data/batchexecute?rpcids=...
  • Auth: first-party session cookies only — there is no Authorization: Bearer header on the request.

That does not match what v2.0.7 expects:

v2.0.7 expects Current Flow (2026-09-17 build)
Host aisandbox-pa.googleapis.com / labs.google flow.google.com
Protocol aisandbox JSON API batchexecute RPC (f.req + rpcids)
Auth Authorization: Bearer ya29.… first-party cookies (no bearer)
Extension content-script match labs.google/fx/tools/flow* never matches flow.google.com

Consequences in the current code:

  • flow-extension/background.js webRequest listener filters on aisandbox-pa.googleapis.com / labs.google and only accepts values starting with Bearer ya29., so it never sees a token on flow.google.com.
  • flow-extension/manifest.json content-script matches is labs.google/fx/tools/flow*, so the content script does not run on flow.google.com.
  • flow-agent/flow_engine/config.py still points API_BASE at https://aisandbox-pa.googleapis.com with origin: https://labs.google, and the request/upload layers build Authorization: Bearer requests.

Question

Is support for the new flow.google.com + batchexecute + cookie-auth Flow planned? If a migration branch exists, I'm happy to test against it. Otherwise, is there a recommended workaround for accounts already on the new Flow build?

Environment

  • flow-agent v2.0.7 / extension v1.2.4
  • macOS, Chrome (stable, 2026)
  • Installed via scripts/setup.sh (uv tool install)

QuanPH20104 avatar Sep 19 '26 10:09 QuanPH20104