Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1563](https://github.com/ffroliva/gflow-cli/pull/1563)).** When Flow refuses `image upscale`
or `video upscale` as `PUBLIC_ERROR_UNUSUAL_ACTIVITY` on the download-menu path, the command now
exits **10** (`WafRejectionError`) instead of **7** (`WireFormatError`); under
`GFLOW_CLI_EXIT_CODES=2` it is 10 instead of 43. It is never retryable. 1080p video and 2K image
read `charged: no` / `next_action: wait`; 720p and 270p read `maybe` / `wait` until their billing
is measured; 4K and a refusal on the `jwpduf` status poll read `maybe` / `reconcile`, and their
`GFLOW_CLI_EXIT_CODES=2` it is 10 instead of 43. It is never retryable. The scales measured to spend
no credits (1080p, 720p and the 270p GIF for video, 2K for image;
[#1599](https://github.com/ffroliva/gflow-cli/issues/1599); a 720p export is the original
download for a clip whose original is 720p, and Flow's upscale for a smaller original, and
both were measured) read `charged: no` /
`next_action: wait`; 4K and a refusal on the `jwpduf` status poll read `maybe` / `reconcile`, and their
hint no longer says nothing was charged. The MCP tools `gflow_upscale_image` and
`gflow_upscale_video` return the same fields.
- **A final submit refusal reads `next_action: wait`.** The `WafRejectionError` raised after the
Expand All @@ -103,13 +106,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`as29s`. A `PUBLIC_ERROR_UNUSUAL_ACTIVITY` refusal there now raises `WafRejectionError`
(exit 10) with the scale's outcome, instead of waiting out the export budget and timing out.
- **An upscale that times out or returns the wrong file reads its scale's outcome
([#1571](https://github.com/ffroliva/gflow-cli/issues/1571)).** On the download-menu path, a
1080p video export or a 2K image upscale that times out, returns bytes that are not the
requested file, or has its export RPC refused for a reason other than unusual activity now
reads `charged: no` / `next_action: retry` (it read `maybe` / `retry` or `maybe` /
([#1571](https://github.com/ffroliva/gflow-cli/issues/1571)).** On the download-menu path, an
upscale at a free scale (1080p, 720p or 270p video, 2K image) that times out, returns bytes that
are not the requested file, or has its export RPC refused for a reason other than unusual
activity now reads `charged: no` / `next_action: retry` (it read `maybe` / `retry` or `maybe` /
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
`reconcile`). A 4K image upscale that times out now reads `maybe` / `reconcile` and is no
longer retryable, as a 4K video already did. 720p and the 270p GIF keep their outcomes, and
their hints no longer say that re-running spends no credits, which has not been measured.
longer retryable, as a 4K video already did.
- **`video upscale` on the download-menu path waits for the clip before clicking, and gives
720p and 1080p exports 240 s ([#1564](https://github.com/ffroliva/gflow-cli/pull/1564)).** The
first click on the clip editor's download button waits up to 3 s for the editor's first data reply,
Expand Down
6 changes: 3 additions & 3 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ GFLOW_CLI_HISTORY_PROMPTS=redacted gflow image t2i "confidential brief"
**Values:** `auto` | `headless` | `headed`
**Default:** `auto`. A request the direct transport can send (a measured shape) launches Chrome
**headless**, and that browser only mints the reCAPTCHA token; a surface that still needs Flow's
UI launches **headed**, except the surfaces measured headless (`video extend` on flow.google.com,
the page fallback of `media trash` / `media restore`, the video download-menu upscales (720p, 270p, and 4K unmeasured), and image-to-image from one local `--ref`
UI launches **headed**, except the surfaces that launch headless (`video extend` on flow.google.com,
the page fallback of `media trash` / `media restore`, the video download-menu upscales (720p, 270p, and 4K, whose headless run is unmeasured), and image-to-image from one local `--ref`
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
file in an existing project on an otherwise direct request), which launch headless. A run that holds any UI item launches headed for the whole run. A
refusal Flow did not charge is retried once from a new headless browser process. The
per-command list is [BROWSER_MODES](BROWSER_MODES.md).
Expand All @@ -434,7 +434,7 @@ per-command list is [BROWSER_MODES](BROWSER_MODES.md).

| Value | Measured shapes (direct HTTP) | Flow UI surfaces |
|---|---|---|
| `auto` | headless | headed, except the surfaces measured headless ([BROWSER_MODES](BROWSER_MODES.md)) |
| `auto` | headless | headed, except the surfaces that launch headless ([BROWSER_MODES](BROWSER_MODES.md)) |
| `headed` | headed | headed |
| `headless` | headless | headless: unsupported in v0.108.0, see [#1554](https://github.com/ffroliva/gflow-cli/issues/1554) |

Expand Down
20 changes: 10 additions & 10 deletions docs/ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,30 @@ place today:
refused the same way on the UI path reads `no` / `wait` too.
- `image upscale` and `video upscale`: Flow refusing the upscale or export RPC as
`PUBLIC_ERROR_UNUSUAL_ACTIVITY` is `WafRejectionError` (exit 10), never retryable, and its
`charged` / `next_action` depend on the scale. The scales measured to spend no credits (1080p
video, 2K image) read `no` / `wait`; 720p and the 270p GIF, whose billing has not been measured,
read `maybe` / `wait`; 4K (a 4K video bills on click; 4K image billing is unmeasured and treated
`charged` / `next_action` depend on the scale. The scales measured to spend no credits (1080p,
720p and the 270p GIF for video, 2K for image;
[spike](superpowers/spikes/2026-11-29-export-billing-720p-270p.md)) read `no` / `wait`;
4K (a 4K video bills on click; 4K image billing is unmeasured and treated
the same), and a refusal on the `jwpduf` status poll, which
runs after Flow accepted the export, read `maybe` / `reconcile`. No `retry_after` is given: no
cooldown has been measured. Any other refusal of those RPCs stays `WireFormatError` (exit 7).
A clip Flow has already rendered at the requested scale is served through `as29s` with no
export RPC; a refusal there follows the same scale rule, and any other `as29s` error is
ignored, because the page also uses `as29s` for its own reads. An `as29s` refusal during a
fresh export ends it the same way, since it means the page itself is refused; there it reads
the scale's refusal outcome even after Flow accepted the export, so a 720p or 270p export
reads `maybe` / `wait` rather than the `reconcile` a `jwpduf` refusal would give
the scale's refusal outcome even after Flow accepted the export
([#1570](https://github.com/ffroliva/gflow-cli/issues/1570)).
The direct path reads the same refusal on the `jwpduf` poll and on the `as29s` read of the
finished clip's URL, for a 1080p upscale, a text-to-video or an image-to-video, and stops at
once with `maybe` / `reconcile` instead of waiting out its poll budget or reporting exit 7
([#1597](https://github.com/ffroliva/gflow-cli/issues/1597)).
On the download-menu path, an upscale that times out after its click (`TransportTimeoutError`,
exit 9), returns bytes that are not the file asked for, or has its export RPC refused for any
other reason (`WireFormatError`, exit 7) follows the same scale rule: 1080p video and 2K image
read `no` / `retry` (re-running spends nothing), 4K reads `maybe` / `reconcile` and is never
retryable, and 720p and the 270p GIF keep their class's outcome (`maybe` / `retry` for a
timeout, `maybe` / `reconcile` for wrong bytes) until their billing is measured
([#1571](https://github.com/ffroliva/gflow-cli/issues/1571)). On the direct 1080p route a
other reason (`WireFormatError`, exit 7) follows the same scale rule: the free scales
(1080p, 720p and 270p video, 2K image) read `no` / `retry` (re-running spends nothing), and
4K reads `maybe` / `reconcile` and is never retryable
([#1571](https://github.com/ffroliva/gflow-cli/issues/1571),
[#1599](https://github.com/ffroliva/gflow-cli/issues/1599)). On the direct 1080p route a
failure after the request was sent stays `maybe` / `reconcile`, like every direct request.
`RelaunchFailed` (exit 15, `no` / `retry`) is raised when the browser cannot start again,
either for the retry after a refusal (its detail names the refusal) or for a request that
Expand Down
4 changes: 2 additions & 2 deletions docs/MCP.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ shape, and any video with a `max_credits` cap, opens a headed browser. The excep
`auto` runs it headless ([#1554](https://github.com/ffroliva/gflow-cli/issues/1554)), as do the page fallback of
`gflow_media_trash` / `gflow_media_restore`, a `gflow_generate_image` call whose only reference
is one local file in an existing project, when the request would go direct once the file is uploaded,
and the `gflow_upscale_video` download-menu scales (720p, 270p, and 4K, which is unmeasured). A refusal Flow did not
and the `gflow_upscale_video` download-menu scales (720p, 270p, and 4K, whose headless run is unmeasured). A refusal Flow did not
charge is retried once from a new headless browser; a second one is final (`WafRejectionError`,
`charged: "no"`, `retryable: false`, `next_action: "wait"`). `headless` for any other Flow UI shape is
unsupported in v0.108.0 ([#1554](https://github.com/ffroliva/gflow-cli/issues/1554)). The
Expand Down Expand Up @@ -195,7 +195,7 @@ is [BROWSER_MODES](BROWSER_MODES.md).
* `gflow_usage_stats(weeks)`: Summarize local gflow-cli usage statistics over the last N weeks (default 12, range 1..53). Returns command invocation counts across surfaces from local telemetry (or null when telemetry is off) and generation counts by command, model, status, and month from the local catalog. Its `telemetry` block includes `state`, `switch`, `upload` (`enabled` and `reason`), and the current report (#1164). The tool reads local data and spends no credits; like other MCP calls, its telemetry hook may start a separate weekly upload when eligible. MCP does not expose telemetry `on` or `off`; those controls are CLI-only by design.
* `gflow_download_media(media_id, out_dir, profile)`: Fetches an already-generated asset from Flow by its media ID and writes it to disk — the recovery path for a generation that was billed but whose download failed. Spends no credits. The bytes are verified against the size Flow reports before the file is written, and the catalog's `local_files` row is updated. Returns `path`, `bytes`, `media_id`, `workflow_id`, `project_id` and `profile`. The transfer retries a dropped connection internally ([#895](https://github.com/ffroliva/gflow-cli/issues/895)), so a failure marked `retryable` means pause and call again — not immediately, and not in a tight loop: each call opens a browser under a per-profile lease, and a second concurrent call fails on that lease instead (exit 11).
* `gflow_upscale_image(media_id, scale, project, out_dir, profile)`: Upscales an already-generated image to 2K or 4K; it opens a headed browser under `auto` (a headless 2K upscale was refused as unusual activity on one of two accounts, #1554). `scale` is `2k` or `4k` (4K requires Ultra; Pro accounts support 2K). A scale the download menu does not list is exit 22 (`upscale-unavailable`), naming the listed scales. 2K spends no credits; whether 4K does has not been measured, so a 4K refusal reads `charged: maybe` / `next_action: reconcile`.
* `gflow_upscale_video(media_id, scale, project, out_dir, profile, browser_visibility)`: Upscales or exports an already-generated video to 4K Ultra (spends credits), 1080p Full HD, downloads it at 720p (the original, or for a clip with a smaller original Flow's 720p upscale), or exports a 270p animated GIF. `scale` is `4k`, `1080p`, `720p`, or `270p`. Flow decides which scales each clip offers (a Veo 3.1 Lite clip lists no 1080p; `4k` requires Flow Ultra); a scale the clip's download menu does not list returns `UpscaleUnavailableError` (exit 22) naming the listed scales (#1338). Driven on `flow.google.com` only; 1080p was measured free (2026-10-07) while 4K spends credits (measured 50 credits on Omni 1.2 Flash, 2026-11-23). A 1080p upscale of a clip the local catalog records as Omni 1.2 Flash, 4 s, 16:9 goes over direct HTTP with a headless browser that only mints the reCAPTCHA token; 1080p planned through the menu drives it in a headed browser. The result names the `route` the upscale took (`ui` when a planned direct attempt fell back to the menu) and the `visibility`. Under `auto`, the download-menu scales (720p, 270p, and 4K unmeasured) run in a headless browser (#1554).
* `gflow_upscale_video(media_id, scale, project, out_dir, profile, browser_visibility)`: Upscales or exports an already-generated video to 4K Ultra (spends credits), 1080p Full HD, downloads it at 720p (the original, or for a clip with a smaller original Flow's 720p upscale), or exports a 270p animated GIF. `scale` is `4k`, `1080p`, `720p`, or `270p`. Flow decides which scales each clip offers (a Veo 3.1 Lite clip lists no 1080p; `4k` requires Flow Ultra); a scale the clip's download menu does not list returns `UpscaleUnavailableError` (exit 22) naming the listed scales (#1338). Driven on `flow.google.com` only; 1080p was measured free (2026-10-07), as were 720p and the 270p GIF (2026-11-29) while 4K spends credits (measured 50 credits on Omni 1.2 Flash, 2026-11-23). A 1080p upscale of a clip the local catalog records as Omni 1.2 Flash, 4 s, 16:9 goes over direct HTTP with a headless browser that only mints the reCAPTCHA token; 1080p planned through the menu drives it in a headed browser. The result names the `route` the upscale took (`ui` when a planned direct attempt fell back to the menu) and the `visibility`. Under `auto`, the download-menu scales (720p, 270p, and 4K unmeasured) run in a headless browser (#1554).
* `gflow_list_tools()`: Lists the prompt tools (name/title/description/category) accepted by the generate tools' `tools` param. Each `tools` item is `{"name": <slug>, "options": {...}}`, e.g. `[{"name": "creative-director"}]`.
* `gflow_list_models()`: The image and video model catalog, the same object as `gflow models --json` ([#883](https://github.com/ffroliva/gflow-cli/issues/883)); each model entry is what `gflow models show <id> --json` prints ([#1196](https://github.com/ffroliva/gflow-cli/issues/1196)): per model `name`, `label` (image: Flow's menu name), the CLI's `--model` `aliases` (the generate tools accept each of them as `model`, plus wider spellings such as `narwhal` or `veo_lite`), `ref_cap`, `default` (image), and `max_duration`, `durations` (video: the clip lengths `duration` accepts for that model) and `retires_on` (video: the ISO date Flow retires the model, or `null`; [#1375](https://github.com/ffroliva/gflow-cli/issues/1375)). `aspects` and video `tiers` sit on each section (`image` / `video`), not on the per-model entry, so `models show --json` does not carry them. Built from the same enums the generate tools use, so every alias it lists is accepted back. Static: no profile, no browser, no spend.
* `gflow_instructions_list(project, profile)`: Lists a project's persistent Agent-Mode instruction cards (live server brief; credits-free).
Expand Down
3 changes: 2 additions & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ Notes:
gflow could not pick its item.
- **flow.google.com only.** There is no labs.google route; `GFLOW_CLI_FLOW_HOST=labs.google`
refuses the command with exit 36.
- **Cost:** the 1080p export was measured free (1 observation, 2026-10-07); the 4K export on Flow Ultra spends credits (measured 50 credits on Omni 1.2 Flash, 2026-11-23).
- **Cost:** the 1080p export was measured free (1 observation, 2026-10-07), as were the 720p
export and the 270p GIF ([2026-11-29](superpowers/spikes/2026-11-29-export-billing-720p-270p.md)); the 4K export on Flow Ultra spends credits (measured 50 credits on Omni 1.2 Flash, 2026-11-23).
- Saved as `<output_dir>/videos/<YYYY-MM-DD>/<mediaId>_<scale>.<ext>` (`.mp4` or `.gif`).

## `gflow image generate` / `gflow video generate`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nothing was charged.
| Failure | Exit | `charged` | `next_action` | Evidence |
|---|---|---|---|---|
| `UNUSUAL_ACTIVITY` on `p0UkFb`, 1080p | 10 | `no` | `wait` | 1080p export measured free (2026-10-07 menu, 2026-11-27 direct) |
| `UNUSUAL_ACTIVITY` on `p0UkFb`, 720p / 270p | 10 | `maybe` | `wait` | unmeasured: billing of these exports has not been observed |
| `UNUSUAL_ACTIVITY` on `p0UkFb`, 720p / 270p | 10 | `no` | `wait` | measured 0 credits (2026-11-29, #1574; changed by #1599) |
| `UNUSUAL_ACTIVITY` on `p0UkFb`, 4K | 10 | `maybe` | `reconcile` | 4K bills on click; refusal billing unmeasured |
| `UNUSUAL_ACTIVITY` on `jwpduf` (any scale) | 10 | `maybe` | `reconcile` | the status poll runs after the export was accepted |
| `UNUSUAL_ACTIVITY` on `as29s` during an export (stored render) | 10 | per scale, as `p0UkFb` | per scale | a rendered clip sends no `p0UkFb` (#1570) |
Expand All @@ -27,7 +27,7 @@ nothing was charged.
| Scale not offered by Flow | 22 | `no` | `none` | unchanged (#1338) |
| Other export RPC error, timeout or wrong bytes, free scale (menu path) | 7 / 9 | `no` | `retry` | 1080p video and 2K image measured free (#1571) |
| Other export RPC error, timeout or wrong bytes, 4K | 7 / 9 | `maybe` | `reconcile` | 4K may bill; never retryable (#1571) |
| Other export RPC error, timeout or wrong bytes, 720p / 270p | 7 / 9 | `maybe` | class default (`reconcile` / `retry`) | billing unmeasured; the hint says so (#1571) |
| Other export RPC error, timeout or wrong bytes, 720p / 270p | 7 / 9 | `no` | `retry` | measured 0 credits (#1574; changed by #1599) |
| Any failure after the send, direct 1080p route | 7 / 9 | `maybe` | `reconcile` | the direct path never resends |

`retry_after` is never set: no cooldown has been measured, so no number is promised. The
Expand All @@ -52,7 +52,7 @@ the live wire), **unmeasured** (inferred; a spike is filed).
| # | Dimension | Scale / route / stage / retry / surface | Severity | Expected behaviour | Tag | Test category |
|---|---|---|---|---|---|---|
| 1 | D2 D7 | 1080p / menu / `p0UkFb` reply / none / CLI | High | `WafRejectionError`, exit 10, `no` / `wait`; hint says nothing was charged and names the cooldown | refusal frame measured on submits; on `p0UkFb` unmeasured | Unit + E2E (`e2e_auth`, route-fulfilled) |
| 2 | D2 D7 | 720p, 270p / menu / `p0UkFb` / none / CLI | High | exit 10, `maybe` / `wait`; hint does not claim nothing was charged | unmeasured | Unit |
| 2 | D2 D7 | 720p, 270p / menu / `p0UkFb` / none / CLI | High | exit 10, `no` / `wait` | measured (#1574) | Unit |
| 3 | D2 D7 | 4K / menu / `p0UkFb` / none / CLI | Critical | exit 10, `maybe` / `reconcile`; hint says check the project and balance before re-running; never "nothing was charged" | unmeasured | Unit |
| 4 | D2 D7 | any / menu / `jwpduf` reply / none / CLI | Critical | exit 10, `maybe` / `reconcile` | unmeasured | Unit |
| 5 | D7 | any / menu / `p0UkFb` other reason / none / CLI | Medium | `WireFormatError`, exit 7, unchanged | measured (#1014 era) | Unit (existing) |
Expand Down Expand Up @@ -93,7 +93,7 @@ the live wire), **unmeasured** (inferred; a spike is filed).
2. PR C: timeout and wrong bytes on free scales read `no` / `retry` (row 16), delivered by #1571.
3. PR D: `--json` on `gflow video upscale` and `gflow image upscale` (row 17).
4. Spike: scope of an export refusal (page, process, profile) on `p0UkFb`.
5. Spike: billing of the 720p and 270p exports on the wire.
5. Spike: billing of the 720p and 270p exports on the wire (done: 0 credits, #1574).
6. Spike (paid, owner approval required): whether a refused 4K upscale is billed.

## Suggested BDD scenarios
Expand Down
Loading