Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
4cf71ca
chore: back-merge main (v0.105.1) into develop
ffroliva Nov 22, 2026
06f1287
fix(migrated): a new-project click that times out is exit 23, not a c…
ffroliva Nov 22, 2026
55a8e21
test(e2e): a covered new-project button is exit 23 and creates nothing
ffroliva Nov 22, 2026
50c19db
docs(changelog): link #1434
ffroliva Nov 22, 2026
18836d7
fix(migrated): wait briefly for a late create request; word the hint …
ffroliva Nov 22, 2026
2b0b031
fix(migrated): council review of #1435 — exact wording, one more test
ffroliva Nov 22, 2026
2a5c259
Merge pull request #1435 from ffroliva/bugfix/create-project-click-ti…
ffroliva Nov 22, 2026
e3f4b22
docs(spike): how much of an image t2i run is startup
ffroliva Nov 22, 2026
804fae8
docs(spike): the warm arm has no production counterpart; gflow run is…
ffroliva Nov 22, 2026
415bc31
docs(mcp): correct the "warm daemon" claim in the serve docstring
ffroliva Nov 22, 2026
e2e8040
feat(transport): freeze the ogiZ0b frame builder contract
ffroliva Nov 22, 2026
959c396
feat(transport): add GeneratedImage.transport to the contract
ffroliva Nov 22, 2026
135f23d
Record generated image transport in asset metadata
ffroliva Nov 22, 2026
b327f11
Add direct_can_serve strategy selector and unit tests
ffroliva Nov 22, 2026
bfef801
Builds pure ogiZ0b request bodies
ffroliva Nov 22, 2026
716938d
feat(transport): build the ogiZ0b T2I body as a pure function (T1.1)
ffroliva Nov 22, 2026
c84c032
Record transport telemetry fact and report map
ffroliva Nov 22, 2026
b1d8023
Extract ogiz0b_reply_images reply mapper from _mc_submit_observe
ffroliva Nov 22, 2026
a5966b4
Bump notice version to 4, name transport in notice and docs
ffroliva Nov 22, 2026
0fc2fe7
Implement DirectHttpTransport with fallback and direct HTTP runner
ffroliva Nov 22, 2026
7cd2c3c
feat(telemetry): record the image transport in asset metadata and the…
ffroliva Nov 22, 2026
7f378cf
fix(telemetry): keep the transport enum to the values a caller produces
ffroliva Nov 22, 2026
7ef67f3
Register direct_http transport in experimental transports
ffroliva Nov 22, 2026
b8abd74
Add offline BDD scenario for direct_http image transport
ffroliva Nov 22, 2026
7817505
feat(transport): add the direct_http image transport adapter (T1.2-T1.5)
ffroliva Nov 22, 2026
eebc858
fix(transport): send the migrated wire model name on the direct path
ffroliva Nov 22, 2026
aa27157
test(e2e): a plain t2i on direct_http is made by one direct POST; 16:…
ffroliva Nov 22, 2026
c37b73d
test(e2e): the queued MCP worker path runs a t2i on direct_http (T1.7)
ffroliva Nov 22, 2026
df44a5e
test: mirror GeneratedImage.transport on the worker test fakes
ffroliva Nov 22, 2026
6e71af6
feat(transport): serve every aspect and up to two images on the direc…
ffroliva Nov 22, 2026
c41cc8a
feat(transport): serve a single in-project reference on the direct pa…
ffroliva Nov 23, 2026
b2576e8
fix(transport): wait for reCAPTCHA after navigating before a direct mint
ffroliva Nov 23, 2026
1014171
feat(transport): serve one named character on the direct path (T2.2)
ffroliva Nov 23, 2026
be46d25
test(e2e): a named character is generated by the direct transport (T2.2)
ffroliva Nov 23, 2026
d51389e
docs: the direct_http image transport — user doc, Gate 0 findings, pl…
ffroliva Nov 23, 2026
fb4be23
fix(transport): direct_http review round — fallbacks, token cache, pa…
ffroliva Nov 23, 2026
419b2a8
fix(transport): serve catalogued in-project refs again; cover local-f…
ffroliva Nov 23, 2026
1e9f679
feat(transport): serve a bare @Name mention on the direct path
ffroliva Nov 23, 2026
ed7689e
feat(transport): serve every image count Flow offers on the direct path
ffroliva Nov 23, 2026
1e4cca2
fix(transport): match Flow cookies per RFC 6265; address CodeRabbit o…
ffroliva Nov 23, 2026
1b73233
fix(transport): verify refs and characters before a direct POST (seco…
ffroliva Nov 23, 2026
8242b6a
test(captions): pin the default LLM endpoint in the refusal test
ffroliva Nov 23, 2026
e24787e
feat(telemetry): count runs by image transport in the weekly report (…
ffroliva Nov 23, 2026
c26c296
feat(transport): upload local files with one direct maseQ POST (Phase 4)
ffroliva Nov 23, 2026
b5122d4
chore(deps): bump the github-actions group with 2 updates
dependabot[bot] Nov 23, 2026
a0fa98e
chore(deps): bump mkdocs-material from 9.8.1 to 9.8.2 in /website
dependabot[bot] Nov 23, 2026
d9bad77
Merge pull request #1443 from ffroliva/fix/captions-test-ignores-loca…
ffroliva Nov 23, 2026
ef6f404
Merge pull request #1438 from ffroliva/chore/fix-mcp-server-docstring
ffroliva Nov 23, 2026
3e87c6a
Merge pull request #1436 from ffroliva/docs/t2i-warm-vs-cold-spike
ffroliva Nov 23, 2026
e7bb383
fix(transport): take the upload MIME type from the image bytes
ffroliva Nov 23, 2026
a11b9cb
Merge remote-tracking branch 'origin/develop' into feature/direct-htt…
ffroliva Nov 23, 2026
a6bd6b9
Merge pull request #1448 from ffroliva/dependabot/github_actions/gith…
ffroliva Nov 23, 2026
a1b3fb7
Merge pull request #1449 from ffroliva/dependabot/uv/website/mkdocs-m…
ffroliva Nov 23, 2026
cb8cd13
fix(image): report image batch failures instead of crashing (#1452) (…
rayw-lab Nov 23, 2026
f9c5749
chore(deps): bump the python-minor-patch group across 1 directory wit…
dependabot[bot] Nov 23, 2026
7fe4f1f
fix(captions): wrap text that has no spaces to break at (#1446) (#1447)
rayw-lab Nov 23, 2026
2040366
Merge pull request #1456 from ffroliva/dependabot/uv/python-minor-pat…
ffroliva Nov 23, 2026
512004e
Merge remote-tracking branch 'origin/develop' into feature/direct-htt…
ffroliva Nov 23, 2026
46a0369
fix(captions): centre the caption box on the text ink (#1431) (#1444)
rayw-lab Nov 23, 2026
7463691
fix(test): strip hex addresses before checking showlocals redaction (…
aryankalantri Nov 23, 2026
6a59b3f
docs(errors): add the confirmation-required envelope row (#1407) (#1441)
aryankalantri Nov 23, 2026
7a3c637
Merge remote-tracking branch 'origin/develop' into feature/direct-htt…
ffroliva Nov 23, 2026
d16c961
refactor(transport): return one character pair from the direct read path
ffroliva Nov 23, 2026
d8b1cbd
Merge pull request #1442 from ffroliva/feature/direct-http-image-tran…
ffroliva Nov 23, 2026
5f17b7b
chore(release): v0.106.0
ffroliva Nov 23, 2026
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
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gflow",
"version": "0.105.1",
"version": "0.106.0",
"description": "Reusable development and operations workflows for gflow-cli",
"author": {
"name": "Flavio Oliva",
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- name: Audit locked dependencies for known CVEs
# Fails the build on any known advisory. Accept later via: pip-audit --ignore-vuln <GHSA-id>
#
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Audit workflows (zizmor)
# --offline: the online audits need a GH token and reach the network, so
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install ${{ matrix.python-version }}
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -382,7 +382,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -456,7 +456,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -491,7 +491,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -524,7 +524,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -621,7 +621,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.12
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deps-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Set up Python
run: uv python install 3.13
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Compare pins with PyPI and open or update issues
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/governance-advisory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0 # full history so `git diff origin/<base>..HEAD` resolves

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Classify touched paths (advisory, never blocks)
# BASE_REF arrives through `env:`, never interpolated into the script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/governance-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0 # full history — the backtest replays every commit

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0

- name: Run backtest (advisory; writes to job summary)
run: uv run python scripts/dev/materiality_backtest.py >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
# This is the one workflow that publishes artefacts (PyPI + GitHub
# Release), so it must not restore a cache any other workflow can
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
with:
results_file: results.sarif
results_format: sarif
Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.106.0] — 2026-11-23

### Added

- **The weekly usage report counts runs by the image transport that made their images.** A new field, `transports` (`direct`, `ui`, `other`), counts each run that generated an image once, by its last generation. The privacy notice moves to version 4 and names the image transport; in the EU and EEA, consent given to an earlier notice version no longer counts, and uploads stop until `gflow telemetry on` is run again. Uploads pause in every region until the new notice has been shown; the telemetry endpoint accepts the new key.
- **An experimental `direct_http` image transport ([docs/DIRECT_TRANSPORT.md](docs/DIRECT_TRANSPORT.md)).** With `GFLOW_CLI_TRANSPORT=direct_http`, an image on `flow.google.com` is generated by one direct request to Flow's `ogiZ0b` RPC; the browser only mints the reCAPTCHA token and holds the session. It serves text-to-image with `nano2`/`nano21`, every aspect, one to four images, one ref made in this run (a `gflow run` `"ref": "batch:N"`, or a local file, which is itself uploaded by one direct `maseQ` request), or one character (`--reference-entity` with its name, or an `@Name` mention), each with one image; any other request runs on the UI transport before anything is sent. A sent request is never resent: a timeout or an unexpected status stops the run with `next_action: reconcile`, and a redirect, HTTP 401 or HTTP 403 (Flow accepted nothing) falls back to the UI transport. Each generated image records `"transport": "direct_http"` in its catalog metadata.

### Fixed

- **`gflow video captions` centres the caption box on the text ([#1431](https://github.com/ffroliva/gflow-cli/issues/1431)).** The text was drawn from its layout origin while the box was laid out around its ink, so the box sat above the glyphs and descenders touched or crossed its bottom edge. The text is now drawn so its ink lands where the box expects it, with the same padding above and below. Thanks to @rayw-lab ([#1444](https://github.com/ffroliva/gflow-cli/pull/1444)).
- **Burned-in captions wrap text that has no spaces to break at ([#1446](https://github.com/ffroliva/gflow-cli/issues/1446)).** `gflow video captions` and `gflow_video_captions` only broke lines at spaces, so Chinese or Japanese text, or a long URL, stayed on one line and ran off the right edge of the frame. A token wider than the line is now broken between characters, and closing punctuation is kept off the start of a line. Text with spaces wraps as before. Thanks to @rayw-lab ([#1447](https://github.com/ffroliva/gflow-cli/pull/1447)).
- **`image batch` reports a failure before or during the batch instead of crashing ([#1452](https://github.com/ffroliva/gflow-cli/issues/1452)).** On an account served `flow.google.com`, `image batch` raised `FlowHostMigratedError` out of the command as a traceback with exit 1; it now prints the error and its hint and exits 36, as `docs/USAGE.md` documents. A fail-fast stop after some prompts finished (`BatchPartialError`) lists the images already saved, then the error, and exits with its code. Thanks to @rayw-lab ([#1454](https://github.com/ffroliva/gflow-cli/pull/1454)).
- **A new-project button that will not take the click on `flow.google.com` is exit 23, not a crash ([#1434](https://github.com/ffroliva/gflow-cli/issues/1434)).** Generating without `--project` creates a project first. When the projects page's button rendered but the click timed out, Playwright's timeout escaped as an unhandled error (exit 1). gflow now checks whether the create request left the page: if it did not, the run stops with exit 23 and `charged: no`, saying no create request was sent and suggesting `--project` (MCP `project`); if it did, Flow may have made the project, so gflow waits for Flow's reply or reads the new project back, and reports exit 7 (not retryable) only if neither confirms it.

### Documentation and tests

- **`docs/ERRORS.md` lists the confirmation-required envelope ([#1407](https://github.com/ffroliva/gflow-cli/issues/1407)).** The MCP `gflow_media_trash` tool answers a call without `confirm: true` with a `confirmation_required` envelope; the error reference now has its row. Thanks to @aryankalantri ([#1441](https://github.com/ffroliva/gflow-cli/pull/1441)).
- **The `--showlocals` redaction test ignores memory addresses ([#1429](https://github.com/ffroliva/gflow-cli/issues/1429)).** It strips hexadecimal object addresses before checking that no token fragment appears, so a random address can no longer fail it. Thanks to @aryankalantri ([#1440](https://github.com/ffroliva/gflow-cli/pull/1440)).

## [0.105.1] — 2026-11-22

### Fixed
Expand Down Expand Up @@ -7368,7 +7387,8 @@ shell-script template that branches on these codes.

First skeleton. Not functional end-to-end yet.

[Unreleased]: https://github.com/ffroliva/gflow-cli/compare/v0.105.1...HEAD
[Unreleased]: https://github.com/ffroliva/gflow-cli/compare/v0.106.0...HEAD
[0.106.0]: https://github.com/ffroliva/gflow-cli/compare/v0.105.1...v0.106.0
[0.105.1]: https://github.com/ffroliva/gflow-cli/compare/v0.105.0...v0.105.1
[0.105.0]: https://github.com/ffroliva/gflow-cli/compare/v0.104.0...v0.105.0
[0.104.0]: https://github.com/ffroliva/gflow-cli/compare/v0.103.1...v0.104.0
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Deliberately NOT pinned: google-chrome-stable. Chrome's apt repo keeps only the current
# build, so a pinned version stops resolving within weeks. The trade-off is that this
# layer caches indefinitely and a rebuild is what picks up a newer Chrome.
ARG GFLOW_VERSION=0.105.1
ARG GFLOW_VERSION=0.106.0
RUN pip install --no-cache-dir "gflow-cli==${GFLOW_VERSION}"

VOLUME ["/data"]
Expand Down
91 changes: 91 additions & 0 deletions docs/DIRECT_TRANSPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Direct HTTP image transport (`direct_http`, experimental)

`direct_http` generates images on `flow.google.com` with one direct HTTP request to Flow's
`ogiZ0b` RPC instead of driving the composer page. The browser is still started and still
needed: it mints the reCAPTCHA token and holds the signed-in session. It no longer types
the prompt, opens the settings pane or clicks Generate.

It is experimental. It is off unless you select it, and any request it cannot build
exactly goes to the default `ui_automation` transport before anything is sent.

## Turning it on

```bash
GFLOW_CLI_TRANSPORT=direct_http gflow image t2i "a paper boat on a pond"
```

The setting applies to `gflow image t2i` / `i2i` / `generate`, to the MCP image tool
(in-process and as a queued job), and to each row of `gflow run` (from the environment, or
`"transport": "direct_http"` in the config; a `"ref": "batch:N"` row is served too).
The environment route needs nothing else. Naming the transport in a `gflow run` config, or
with `--transport direct_http` on an image command, also needs
`GFLOW_CLI_EXPERIMENTAL_TRANSPORTS=1`, as for every experimental transport; without it the
config is refused with exit 11 and the option does not list the value.
`gflow image batch` resolves to the same transport, but its rows run the inherited UI batch
method, which flow.google.com refuses on every transport.

## What it serves

A request goes direct only when every slot of the frame it needs has been measured against
Flow's own submit. Everything else is routed to `ui_automation` before any request is sent.

| Request | Direct | Measured by |
|---|---|---|
| Text-to-image, model `nano2` / `nano21` (sent as `BELUGA`) | yes | 10 consecutive live generations |
| Aspect 9:16, 16:9 | yes | live generations (768x1376, 1376x768) |
| Aspect 1:1, 4:3, 3:4 | yes | captures of Flow's own submit |
| Count 1 to 4 | yes | live generations: 2, 3 and 4 entries in one request returned 2, 3 and 4 images |
| One ref made in this run: a `gflow run` row's `"ref": "batch:N"`, one image | yes | a live `gflow run` |
| One `--ref ./photo.png` (a local file not yet in the catalog), one image | yes | uploaded by one direct `maseQ` request (reCAPTCHA action `UPLOAD_IMAGE`), then generated directly; a live generation |
| One `--reference-entity` with its `--reference-entity-name` | yes | a live generation |
| One `@Name` mention of a character in the project | yes, when exactly one character has that name (trimmed, case-insensitive, as the UI picker matches) | the id is read from the project; a live generation |
| Any other model (`nano-pro`, `nano2-lite`, `imagen4`) | no | wire name not captured |
| Several refs, several characters, a ref plus a character, or a ref or character with count 2-4 | no | not captured |
| A mention whose name matches no character, or several | no | the UI picker decides |
| Agent-mode instructions, or `--ui-mode agentic` | no | not captured |
| A configured proxy (gflow's, the environment's or the OS's) | no | the browser and the request could leave by different routes |

## Failure behaviour

| What happens | Before the request is sent? | Result |
|---|---|---|
| The browser's cookies, the session tokens or the reCAPTCHA mint are unavailable | yes | the same request runs on `ui_automation` |
| The connection cannot be opened (or opening it timed out) | yes | the same request runs on `ui_automation` |
| The account is served on labs.google, or `GFLOW_CLI_FLOW_HOST=labs.google` | yes | the same request runs on `ui_automation` |
| Flow answers a redirect, HTTP 401 or HTTP 403 | no: it was sent once and refused | the request is submitted a second time, through `ui_automation`'s own page |
| A timeout, a dropped connection or any other HTTP status | no | the run stops with a network error (`next_action: reconcile`); gflow does **not** resend, because Flow may have made the image |
| Flow refuses the prompt | no | the same refusal error as the UI path |
| A `--ref` found in the local catalog (a media id, or a file used before) | yes: the selector routes it before any request | the request runs on `ui_automation`; the catalog may be stale, and the UI path proves the image still exists before it submits, refusing at $0 |

A sent request is never resent on the direct transport: only a redirect, HTTP 401 or HTTP 403, which Flow refused without making anything, is submitted again, once, through `ui_automation`. Every rejected reply drops the cached session token, so a
stale one cannot stick in a long-running MCP server or worker. A reCAPTCHA mint is retried
for up to 10 seconds while the page loads its reCAPTCHA script, because a mint spends
nothing. The page is parked after every direct run, as after a UI run.

## What it records

- Each image's catalog row carries `"transport": "direct_http"` in its `metadata_json`.
- Log events: `direct.frame_built`, `direct.image_post` (status, `mint_ms`, `post_ms`,
`total_ms`) and `direct.fallback_to_ui` (reason). Set `GFLOW_CLI_LOG_LEVEL=INFO` to see
them. Tokens, cookies, prompts and signed URLs are never logged.

## Refusals observed

On 2026-11-23 the test profile made about 90 image generations in one day. Late in that day
Flow answered some requests with a WAF refusal (exit 10, `WafRejectionError`), on direct and
plain requests alike, including a plain text-to-image with no reference; the identical
request usually went through minutes later. The refusals followed the day's volume, not a
request shape: Flow's own submit for each refused shape was captured and matches what the
direct path sends. Those refusals came back as a refusal reply (exit 10): nothing was billed,
and gflow did not resend them. This differs from an HTTP 403, a redirect or a 401 on the
direct POST, where Flow accepted nothing and the request is submitted once more through
`ui_automation` (see the failure table).

## Speed

Measured on one profile, ten generations each, same prompt and model: the direct path took
a median of 18.6 s from mint to reply, the warm UI transport 20.7 s. Flow's own generation
time dominates both. The case for the transport is that it does not depend on the
composer's DOM, so selector changes and UI locale do not affect it.

Evidence: [`docs/superpowers/spikes/2026-11-22-direct-image-gate0.md`](superpowers/spikes/2026-11-22-direct-image-gate0.md).
1 change: 1 addition & 0 deletions docs/ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ members. They have no exit code of their own.
|---|---|---|---|---|
| `https://gflow-cli.dev/errors/unknown` | MCP and worker, an unclassified failure (the message is never shared; the worker's `detail` is its SHA-256 and `class` names the exception class; after the submit the worker stores the job `indeterminate` and sets `next_action: reconcile`) | — | `maybe` | `none` |
| `https://gflow-cli.dev/errors/bad-parameter` | MCP, a tool argument it refuses | — | `no` | `fix_input` |
| `https://gflow-cli.dev/errors/confirmation-required` | MCP `gflow_media_trash` without `confirm=true`; CLI `gflow media trash` without `--yes` in non-interactive `--json` mode (exits 2, and its envelope omits `next_action`) | — | `no` | `fix_input` |
| `https://gflow-cli.dev/errors/no-profile` | MCP, no profile, or its directory is missing | — | `no` | `reauth` |
| `https://gflow-cli.dev/errors/no-default-profile` | MCP, several profiles and no default | — | `no` | `fix_input` |
| `https://gflow-cli.dev/errors/profile-marker-missing` | MCP `gflow_auth_status` | — | `no` | `reauth` |
Expand Down
Loading
Loading