fix(runway): retry the /v1/tasks submit on transient errors

A dropped proxy connection (EOF) or 5xx on the task-create failed the whole generation. submitTask now retries transient (ErrTemporaryUpstream) submits up to 3x with backoff, honoring ctx. Applies to both Nano Banana image and Gen-4 video. Validated: 10/10 4K images (19-24MB PNG each) generated across 10 accounts.
This commit is contained in:
2026-07-09 17:06:43 +08:00
parent cc6a2b1c54
commit 33b5fc3b0e
2 changed files with 20 additions and 3 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ import (
"strings"
"time"
http "github.com/bogdanfinn/fhttp"
tlsclient "github.com/bogdanfinn/tls-client"
"github.com/google/uuid"
)
@@ -127,7 +126,7 @@ func (c *Client) createImageTask(ctx context.Context, client tlsclient.HttpClien
if len(refImages) > 0 {
opts["reference_images"] = refImages
}
res, err := c.apiJSON(ctx, client, token, teamID, http.MethodPost, "/v1/tasks", map[string]any{
res, err := c.submitTask(ctx, client, token, teamID, map[string]any{
"taskType": "gemini_3_1_flash_image",
"options": opts,
"asTeamId": jsonNumberOrString(teamID),