Skip to content

fix(image): per-attempt wall-clock deadline on every fal call#183

Merged
eren23 merged 1 commit into
mainfrom
fix/fal-call-deadline
Jul 20, 2026
Merged

fix(image): per-attempt wall-clock deadline on every fal call#183
eren23 merged 1 commit into
mainfrom
fix/fal-call-deadline

Conversation

@eren23

@eren23 eren23 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Self-play discovery finding #5: a fal edit call hung 12+ minutes with no error while the SSE heartbeat kept the dead generation open forever — endless shimmer, no banner, no recovery path.

_fal_subscribe (the one seam every fal call rides) now wraps subscribe_async in asyncio.wait_for with FAL_CALL_TIMEOUT_S (default 240s, floor 30s — clears gpt-image-2's ~170s edits). A timeout is deliberately not retried: it fails fast into the existing TimeoutError → friendly "took too long — hit retry" frame (#153), already wired to the banner end-to-end.

Suite + ruff + mypy green.

🤖 Generated with Claude Code

Live-caught during the self-play discovery pass: one fal edit call hung
12+ MINUTES with no error — and the SSE heartbeat (added to survive
proxy body timeouts) faithfully kept the dead generation open forever.
Endless shimmer, no banner, no recovery.

_fal_subscribe (the one seam all fal calls ride — image, edit,
continue, expand, inpaint) now wraps subscribe_async in
asyncio.wait_for with FAL_CALL_TIMEOUT_S (default 240s, floor 30s —
clears the slowest legitimate path, gpt-image-2 edits at ~170s;
openrouter-hosted models don't ride this seam). A timeout is
deliberately NOT retried: fail fast into the existing TimeoutError →
friendly "took too long — hit retry" frame (#153) instead of stacking
3x the deadline.
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@eren23
eren23 merged commit 13cb82c into main Jul 20, 2026
9 checks passed
@eren23
eren23 deleted the fix/fal-call-deadline branch July 20, 2026 09:35
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.

1 participant