Skip to content

fix(runway): apply configured request policy to video generation requests - #102134

Closed
chengzhichao-xydt wants to merge 2 commits into
openclaw:mainfrom
chengzhichao-xydt:cz/runway-video-request-policy
Closed

chengzhichao-xydt wants to merge 2 commits into
openclaw:mainfrom
chengzhichao-xydt:cz/runway-video-request-policy

Conversation

@chengzhichao-xydt

@chengzhichao-xydt chengzhichao-xydt commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Runway video generation previously ignored models.providers.runway.request overrides (headers, allowPrivateNetwork, dispatcherPolicy). Users who configured a request policy for Runway saw it applied to chat/completion providers but not to video generation, so private-network access, custom headers, and dispatcher routing were dropped on the floor.

Why This Change Was Made

Mirror the pattern already used by openai, pixverse, google image generation, and Alix-007's recent DashScope/MiniMax/OpenRouter video request-policy PRs: resolve the configured transport policy once and carry it through every HTTP stage of the video operation.

Changes

  • extensions/runway/video-generation-provider.ts
    • Import sanitizeConfiguredModelProviderRequest.
    • Read req.cfg?.models?.providers?.runway.
    • Forward the sanitized request policy to resolveProviderHttpRequestConfig.
    • Pass the resolved allowPrivateNetwork and dispatcherPolicy into pollRunwayTask and downloadRunwayVideos.
    • Use guarded fetch helpers for status polling and generated-video download when the resolved policy includes allowPrivateNetwork or dispatcherPolicy, falling back to the existing unguarded helpers when no guarded options are needed.
  • extensions/runway/video-generation-provider.test.ts
    • Expand the regression test to assert that configured headers, allowPrivateNetwork, and dispatcherPolicy reach create, poll, and download stages.
    • Fix test type errors caught by check-test-types.

Evidence

node scripts/run-vitest.mjs extensions/runway/video-generation-provider.test.ts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo
node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/runway/video-generation-provider.ts extensions/runway/video-generation-provider.test.ts
  • Vitest: 10/10 passing.
  • tsgo (source + test): no type errors.
  • oxlint: clean.

Real behavior proof against a local Runway-compatible endpoint, showing the configured X-Runway-Policy header is sent and private-network access is allowed:

[proof] local Runway-compatible endpoint at http://127.0.0.1:37479
[server] POST /v1/text_to_video
[server] Authorization: Bearer dummy-runway-key
[server] X-Runway-Policy: runway-policy
[server] GET /v1/tasks/task-proof
[server] GET /video.mp4
[proof] generated video count: 1
[proof] video MIME type: video/mp4
[proof] done

🤖 Generated with Claude Code

@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 9:13 AM ET / 13:13 UTC.

Summary
This PR updates Runway video generation to apply the existing configured provider request policy to create, poll, and download HTTP stages, with regression coverage.

PR surface: Source +112, Tests +101. Total +213 across 2 files.

Reproducibility: yes. source-reproducible. Current main resolves Runway video HTTP config without passing models.providers.runway.request, while PR head threads the resolved policy through create, poll, and download stages.

Review metrics: 1 noteworthy metric.

  • Existing config surface newly consumed: 1 provider request-policy path changed. Runway video generation now honors an existing models.providers.runway.request block that current main ignores.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] This intentionally changes upgrade behavior for existing Runway video users who already configured models.providers.runway.request: their headers, dispatcher, and private-network policy will now affect Runway video HTTP stages instead of being ignored.
  • [P1] The live PR is mergeable but behind the moving base, so maintainers may want final exact-head CI after refresh before landing.

Maintainer options:

  1. Accept request-policy propagation (recommended)
    Land after exact-head CI if maintainers accept existing Runway request overrides now affecting all video HTTP stages.
  2. Ask for upgrade proof
    Require one more transcript using a pre-existing Runway request override if maintainers want explicit upgrade-path evidence before landing.

Next step before merge

  • No automated repair job is needed; the remaining action is maintainer/CI handling for a compatibility-sensitive provider fix.

Maintainer decision needed

  • Question: Should Runway video generation start honoring existing models.providers.runway.request overrides on create, poll, and download in this PR?
  • Rationale: This is the technically consistent fix for the existing request-policy contract, but it intentionally changes behavior for users whose Runway request overrides were previously ignored by video generation.
  • Likely owner: steipete — This person is the clearest Runway provider feature-history owner from the introduction commit, while shared-policy owners remain useful reviewers.
  • Options:
    • Accept request-policy propagation (recommended): Land after exact-head CI if maintainers accept existing Runway request overrides now affecting all Runway video HTTP stages.
    • Ask for upgrade-focused proof: Require one more transcript using a pre-existing Runway request override if maintainers want explicit upgrade-path evidence before landing.

Security
Cleared: No concrete security or supply-chain regression found; the diff changes no dependencies or workflows and routes existing request-policy settings through existing sanitized HTTP helpers.

Review details

Best possible solution:

Runway video generation should consistently honor the existing sanitized provider request policy across submit, status polling, and generated-video download without adding another config surface.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible. Current main resolves Runway video HTTP config without passing models.providers.runway.request, while PR head threads the resolved policy through create, poll, and download stages.

Is this the best way to solve the issue?

Yes. The PR keeps the fix inside the Runway provider and reuses the existing provider HTTP request-policy helpers instead of adding a duplicate config or policy path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e25fa79c5d19.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix live output from a local Runway-compatible endpoint showing configured header delivery, local endpoint access, poll, download, and generated-video result.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The PR fixes a focused provider bug for an existing request-policy contract with limited blast radius.
  • merge-risk: 🚨 compatibility: Existing Runway video installations with request overrides will see those transport settings start applying where current main ignored them.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix live output from a local Runway-compatible endpoint showing configured header delivery, local endpoint access, poll, download, and generated-video result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix live output from a local Runway-compatible endpoint showing configured header delivery, local endpoint access, poll, download, and generated-video result.
Evidence reviewed

PR surface:

Source +112, Tests +101. Total +213 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 170 58 +112
Tests 1 103 2 +101
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 273 60 +213

What I checked:

  • Current main omits configured request overrides: Current main resolves Runway video HTTP config with provider/capability/transport but does not pass models.providers.runway.request, so configured headers/private-network/dispatcher policy cannot affect this path. (extensions/runway/video-generation-provider.ts:403, e25fa79c5d19)
  • PR head resolves and propagates policy: PR head sanitizes models.providers.runway.request, passes it to resolveProviderHttpRequestConfig, and forwards allowPrivateNetwork/dispatcherPolicy into create, poll, and download calls. (extensions/runway/video-generation-provider.ts:510, 537770bd7377)
  • Regression coverage checks all stages: The added test asserts request sanitization/resolution, create-call policy, and guarded poll/download options for Runway video requests. (extensions/runway/video-generation-provider.test.ts:158, 537770bd7377)
  • Shared helper contract supports the fix: resolveProviderHttpRequestConfig accepts request overrides and returns headers, allowPrivateNetwork, and dispatcherPolicy; fetchWithTimeoutGuarded accepts SSRF policy and dispatcherPolicy for guarded fetches. (src/media-understanding/shared.ts:340, e25fa79c5d19)
  • Sibling provider pattern: PixVerse video generation already resolves sanitized provider request policy and carries allowPrivateNetwork/dispatcherPolicy into later video steps, supporting this owner-local Runway fix shape. (extensions/pixverse/video-generation-provider.ts:434, e25fa79c5d19)
  • Real behavior proof and CI signal: The PR body includes local Runway-compatible endpoint output showing configured header delivery, local endpoint access, poll, download, and generated-video result; live PR metadata showed successful relevant CI checks on the reviewed head. (537770bd7377)

Likely related people:

  • steipete: GitHub commit metadata shows this person authored and committed the Runway provider introduction that added the touched Runway video provider and tests. (role: introduced behavior; confidence: high; commits: f92ac83d889c; files: extensions/runway/video-generation-provider.ts, extensions/runway/video-generation-provider.test.ts)
  • vincentkoc: GitHub commit metadata shows this person authored the provider request transport override work that defines the shared request-policy surface reused here. (role: request-policy contributor; confidence: high; commits: 61f13173c29a, cfbad0a4f985; files: src/agents/provider-request-config.ts, src/config/types.provider-request.ts, src/media-understanding/shared.ts)
  • qas: GitHub commit metadata shows this person authored the model-provider request.allowPrivateNetwork opt-in that this PR now applies to Runway video HTTP stages. (role: private-network policy contributor; confidence: medium; commits: 71617ef2f056; files: src/agents/provider-request-config.ts, src/config/types.provider-request.ts, src/config/zod-schema.core.ts)
  • fuller-stack-dev: Current-main blame ties the present Runway provider request-config lines to a recent broad squash commit, though that history is less domain-specific than the original feature and policy commits. (role: recent area contributor; confidence: low; commits: 2fbd4cdcbaec; files: extensions/runway/video-generation-provider.ts, src/media-understanding/shared.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (5 earlier review cycles)
  • reviewed 2026-07-08T09:35:18.691Z sha ef48f273afb13fd294bafbec383e6601c27d744f :: needs real behavior proof before merge. :: [P2] Widen the captured request type before asserting policy fields
  • reviewed 2026-07-08T09:43:10.976Z sha ef48f273afb13fd294bafbec383e6601c27d744f :: needs real behavior proof before merge. :: [P2] Widen the resolver mock result before returning dispatcher policy | [P2] Widen the captured request type before asserting policy fields
  • reviewed 2026-07-08T09:57:46.372Z sha 907749b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-08T10:07:29.633Z sha 907749b :: needs changes before merge. :: [P2] Carry request policy through poll and download
  • reviewed 2026-07-08T13:06:10.991Z sha 537770b :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 8, 2026
…ests

Apply models.providers.runway.request overrides (headers,
allowPrivateNetwork, dispatcherPolicy) to Runway video generation
requests via sanitizeConfiguredModelProviderRequest and
resolveProviderHttpRequestConfig, matching other providers.

- Fix test type errors caught by check-test-types.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@chengzhichao-xydt
chengzhichao-xydt force-pushed the cz/runway-video-request-policy branch from ef48f27 to 907749b Compare July 8, 2026 09:50
@chengzhichao-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 8, 2026
@chengzhichao-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 8, 2026
@chengzhichao-xydt

Copy link
Copy Markdown
Contributor Author

Closing this PR as requested. A fresh follow-up PR will be opened for the remaining request-policy/timeout direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant