Conversation
fix: recognize current Flow host and preserve upload failures
Generation had been failing for a week with CAPTCHA_FAILED: CONTENT_TIMEOUT even though /health reported healthy. Three separate causes, all from the move from labs.google/fx/tools/flow to flow.google.com: - The Flow bearer is only observable during the labs.google -> flow.google.com handoff. Reloading a flow.google.com tab never re-captures it, so the token was never obtained (has_flow_key false) and could never refresh. Token refresh now drives an extension-owned tab through TOKEN_URL. - reCAPTCHA Enterprise is only loaded on /project/<id> pages, never on the home page the old FLOW_URL now redirects to. On-demand tabs open the request's projectId (or the last project page seen), and project tabs are preferred over other Flow tabs. - The first tab matching a Flow URL was used blindly. A tab with a dead bridge (opened before an extension reload, or never loaded injected.js) swallowed GET_CAPTCHA for 25s. Tabs are now pinged (PING_BRIDGE -> FLOW_AGENT_PING/PONG) before use and skipped if they do not answer. Hardening found necessary while debugging: - Every await on the tab-lookup path is bounded (withTimeout) so one Chrome API call that never settles cannot park the shared getOrOpenFlowTab promise and silently stall every later request. - GET_CAPTCHA is re-dispatched until injected.js answers (it loads async; a first dispatch could be lost); injected.js dedups by requestId and caps grecaptcha.execute at 15s. - The Google API fetch and callback delivery carry timeouts. - The last 200 '[Flow Agent]' console lines persist to chrome.storage.local.debugLog so stalls can be diagnosed after the fact. Verified end to end: a 4s text-to-video clip generated in 88s through the extension (credits 1050 -> 1043). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GkWggBWEKrNTR4B5opZ3bo
… delivery Google migrated Flow from React on labs.google to Angular Boq on flow.google.com, replacing direct client-side aisandbox-pa REST calls with batchexecute and signed CDN URLs on flow-content.google. - Automate image generation in active Flow project tab via extension scripting (mode switch, aspect ratio selection, prompt entry, generate trigger) - Add dual-layer detection of generated signed assets on flow-content.google via DOM img tags and performance resource entries - Add extension reload and diagnostic endpoints (/api/dev/reload, /api/dev/probe) to bridge and server - Update extension manifest and permissions for flow.google.com and flow-content.google
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google recently migrated Google Flow completely from
labs.google/fx/tools/flowtohttps://flow.google.com/. As part of this migration:boq_labs-ai-sandbox-frontend_...).batchexecuteRPCs instead of client-sideBearer ya29...REST calls tohttps://aisandbox-pa.googleapis.com.aisandbox-pa.googleapis.comdirectly without the token fails with401 UNAUTHENTICATED, and requests with cookies or origin headers fail Google's internal XD3 check (Bad request: Origin doesn't match Host for XD3).https://flow-content.google/image/....Changes
Active Flow Tab Automation:
https://flow.google.com/*andhttps://*.google.com/*.background.js, automated the active Google Flow project tab viachrome.scripting.executeScript:imgtags) and network performance entries for the new signed asset URL onflow-content.google/image/....flow-agentfor direct downloading.Diagnostics & Management:
/api/dev/reloadand/api/dev/probeendpoints to the bridge and server routes to allow reloading the unpacked extension and diagnosing tab state programmatically./creditsrequests to return instant 200 without blocking.rules.jsonto prevent synthetic CORS stalls on Flow's new origin.Verification
flow image "a cute glowing origami fox sitting on an open book, soft warm studio lighting" --aspect squareoutput/, and recorded tohistory.json.