Skip to content

fix(upscale): report a refused export of a clip Flow already rendered (#1570) - #1595

Merged
ffroliva merged 3 commits into
developfrom
bugfix/1570-as29s-export-refusal
Nov 29, 2026
Merged

ffroliva merged 3 commits into
developfrom
bugfix/1570-as29s-export-refusal

Conversation

@ffroliva

@ffroliva ffroliva commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Exporting a video clip again at a scale Flow has already rendered sends no export RPC (p0UkFb / jwpduf); Flow serves the stored file through as29s (measured 2026-11-28). A PUBLIC_ERROR_UNUSUAL_ACTIVITY refusal on that path was not mapped, so the export waited out its budget and ended as a capture timeout.

The export listener (migrated_video_upscale._export_refusal_listener) now maps a refusal frame on as29s the same way as one on the export RPCs: upscale_refusal(...), exit 10, with the scale's charged / next_action (1080p no / wait, 720p and 270p maybe / wait, 4K maybe / reconcile). Any other as29s error is still ignored, because the page also uses as29s for its own reads; adding as29s to the export RPC list would have turned those into exit 7. An as29s refusal during a fresh export ends it the same way, since it means the page itself is refused.

Closes #1570.

Verification

  • /gflow:check gates: all green; pytest -n 4: 9683 passed, 52 skipped, coverage 94.09%.
  • Unit tests: an as29s refusal during the export raises the 1080p refusal (no / wait, route batchexecute:as29s); an as29s error with another reason does not end the export. The first fails without the fix (the export runs into the capture timeout).
  • E2E tests/e2e/test_upscale_refusal_contract_bdd.py (@e2e_auth, $0) gains a stored-export scenario: a control export of a clip Flow has already rendered (no p0UkFb is sent and the file is written), then the same clip's export with its as29s replies replaced by a refusal frame from the moment the export's capture hooks are installed (so page loading and hydration are untouched). All three scenarios passed on a live profile. The scenario cannot single out the export's own as29s request from a page poll answered in the same window; both reach the listener the same way.
  • Reviews: /code-review xhigh and /ponytail-review xhigh by fresh agents; no important findings. Folded in: one refusal branch for both RPC groups, the e2e arms its replacement from the capture hook itself, _stored fails on a real timeout instead of skipping, and ERRORS.md notes the fresh-export case.

Summary by CodeRabbit

  • Bug Fixes
    • Exports of clips already rendered at the requested quality now report an unusual-activity rejection promptly instead of waiting for the export timeout.
    • The rejection includes the applicable charge and next-step information, consistent with other upscale refusals.

…#1570)

Exporting a clip again at a scale Flow has already rendered sends no p0UkFb;
Flow serves the stored file through as29s. The export listener now maps a
PUBLIC_ERROR_UNUSUAL_ACTIVITY frame on as29s to the scale's refusal
(upscale_refusal) instead of waiting out the capture budget. Any other
as29s error is still ignored, because the page also uses as29s for its own
reads. The upscale e2e gains a stored-export scenario that replaces as29s
replies only once the export's capture hooks are installed.
…t rpcs

Addresses the code and lean reviews: a single branch maps the refusal; the e2e arms its as29s replacement from the capture hook itself and fails on a real timeout; ERRORS.md notes an as29s refusal during a fresh export.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48c1e099-fde5-44b6-88aa-edc7a6ad1a97
Commits

Reviewing files that changed from the base of the PR and between ac39098 and 557e4c3.

Files selected for processing: 5

  • docs/ERRORS.md
  • docs/FLOW_WIRE_RPCS.md
  • tests/api/test_migrated_video_upscale.py
  • tests/e2e/test_upscale_refusal_contract_bdd.py
  • website/docs/ERRORS.md

No actionable comments were generated in the recent review.

Walkthrough

The upscale refusal listener now maps unusual-activity responses from as29s to WafRejectionError during exports of stored renders. Other as29s errors remain ignored. API and end-to-end tests cover both cases.

Changes: Stored-render upscale refusal

Layer / File(s) Summary
Map stored-render refusals
src/gflow_cli/api/transports/migrated_video_upscale.py, docs/ERRORS.md, website/docs/ERRORS.md, docs/superpowers/plans/2026-11-28-upscale-refusal-contract/SCENARIO.md, CHANGELOG.md
The listener maps unusual-activity responses from as29s to upscale refusals and continues to ignore other as29s errors. The documentation, scenario contract, and changelog describe the behavior and scale-dependent outcome.
Validate as29s refusal handling
tests/api/test_migrated_video_upscale.py, tests/e2e/test_upscale_refusal_contract_bdd.py, tests/features/upscale_refusal_contract.feature
API and end-to-end tests cover unusual-activity refusals from as29s, other as29s errors, and exports of previously rendered clips.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related PRs

  • ffroliva/gflow-cli#1591: Both PRs use the scale-specific upscale outcome contract and update related refusal-contract tests and documentation.

Suggested reviewers: leonjoeeee

Merge Risk: Minimal · previous review ac390

This change maps an unusual-activity refusal on the stored-render export path to the existing upscale refusal error (exit code 10), instead of letting the export end as a capture timeout. Other as29s errors are still ignored. No concrete defect was established, so the merge risk is minimal. The open question is whether a refused page poll can ever coincide with an export that would still complete, which only live wire data can settle.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix (reporting a refused export of a clip Flow already rendered), which matches the main change: the upscale export listener now maps an unusual-activity refusal on the as29s store…
Linked Issues check Passed [#1570] The issue requires that a PUBLIC_ERROR_UNUSUAL_ACTIVITY refusal on as29s, for an already-rendered clip export, end the export as a refusal rather than a capture timeout. At head, src/gflow_cli…
Out of Scope Changes check Passed All changed files relate to the #1570 fix. The transport change adds the as29s constant and the refusal branch, and it keeps other as29s errors ignored. Other as29s errors do not reach the WireFormatE…
Full details: Title check

Explanation

The title names the fix (reporting a refused export of a clip Flow already rendered), which matches the main change: the upscale export listener now maps an unusual-activity refusal on the as29s stored-render path to upscale_refusal with exit code 10. The title's wording is specific and no part of it is off-topic. The title cites #1570, which is the linked issue number, and that does not affect the check. The objectives mention PR #1595, which differs from the number in the title. That mismatch is a metadata concern and does not change the title's relevance to the changeset.

Full details: Linked Issues check

Explanation

[#1570] The issue requires that a PUBLIC_ERROR_UNUSUAL_ACTIVITY refusal on as29s, for an already-rendered clip export, end the export as a refusal rather than a capture timeout. At head, src/gflow_cli/api/transports/migrated_video_upscale.py defines _STORED_EXPORT_RPCID = "as29s". In _export_refusal_listener, a response whose error reasons contain UNUSUAL_ACTIVITY_REASON and whose rpcid is in (*_EXPORT_RPCIDS, _STORED_EXPORT_RPCID) calls settle_exception with upscale_refusal(rpcid, code, scale). This ends the export through the same refusal path as the export RPCs. The PR also adds unit tests for an as29s refusal (route batchexecute:as29s) and an e2e stored-export scenario, which the author reports passed on a live profile. Limits: I read the listener code directly. I did not read the upscale_refusal table in src/gflow_cli/api/refusal.py, so the per-scale charged/next_action values are taken from the PR description and not independently verified. I did not read the test diff; test coverage is taken from the PR summary.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the #1570 fix. The transport change adds the as29s constant and the refusal branch, and it keeps other as29s errors ignored. Other as29s errors do not reach the WireFormatError branch, which still applies only to _EXPORT_RPCIDS. The test changes cover the new branch. The e2e changes (_refusal_body(rpcid), configurable refuse_rpc, stored-export steps) and the feature scenario support the new behavior. The CHANGELOG, ERRORS.md (both copies), and SCENARIO.md edits document the same behavior. No unrelated functional change was identified in the reviewed evidence.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25b7b689-9988-4c0a-aee1-25a321c19ba6
Commits

Reviewing files that changed from the base of the PR and between cdb1c8f and ac39098.

Files selected for processing: 8

  • CHANGELOG.md
  • docs/ERRORS.md
  • docs/superpowers/plans/2026-11-28-upscale-refusal-contract/SCENARIO.md
  • src/gflow_cli/api/transports/migrated_video_upscale.py
  • tests/api/test_migrated_video_upscale.py
  • tests/e2e/test_upscale_refusal_contract_bdd.py
  • tests/features/upscale_refusal_contract.feature
  • website/docs/ERRORS.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

…port

Addresses the council review on #1595: ERRORS.md states that an as29s refusal after an accepted 720p/270p export reads wait, FLOW_WIRE_RPCS.md names the stored-export use of as29s, and the unit test is a row of the existing refusal parametrize.
@ffroliva

Copy link
Copy Markdown
Owner Author

Council review at ac39098: soft YELLOW, no must-fix (D0, D2, D3, D4, D5, D6, D9, D12, D14 green; D1 yellow on an undocumented outcome).

Folded in at 557e4c3:

  • D1: docs/ERRORS.md states that an as29s refusal during a fresh 720p or 270p export reads maybe / wait even after Flow accepted the export (a jwpduf refusal there reads reconcile). Adding as29s to the after-accept set would be wrong for a stored render, where nothing was accepted; 4K already reads reconcile and 1080p is measured free.
  • D14: the new refusal test is a row of the existing refusal parametrize.
  • D9: docs/FLOW_WIRE_RPCS.md names the stored-export use of as29s.
  • The redundant refuse=None in the e2e is gone.

Filed separately: the direct path's as29s download read surfaces a refusal frame as exit 7 (the direct twin of this fix).

@ffroliva
ffroliva merged commit 91afcaf into develop Nov 29, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(upscale): map a refusal on as29s for an already-rendered export

1 participant