Skip to content

fix(openrouter): apply request policy to music generation requests - #104835

Merged
steipete merged 1 commit into
openclaw:mainfrom
Alix-007:alix/openrouter-request-policy-music-generation
Jul 16, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
Alix-007:alix/openrouter-request-policy-music-generation

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where OpenRouter music generation ignored configured provider request policy, including custom headers, proxy settings, and TLS options.

Why This Change Was Made

The music provider now passes the sanitized OpenRouter request policy into the shared provider HTTP resolver, matching the existing OpenRouter video path. Its explicit allowPrivateNetwork: false override remains authoritative, so provider configuration cannot opt music requests into private-network access.

User Impact

OpenRouter music generation now honors supported provider transport settings. The existing private-network denial remains unchanged, including when cfg.models.providers.openrouter.request.allowPrivateNetwork is true.

Evidence

  • Exact tested head: f643e7a657c16aa6b8cf551e4b6cd30d2de21dc7.
  • Focused remote proof: pnpm test extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passed 2 files and 15 tests.
  • The transport regression starts a loopback server, configures allowPrivateNetwork: true, calls the real provider HTTP transport, expects a private-network denial, and asserts the server received zero requests.
  • Changed-surface gate passed: formatting, extension production/test typechecks, lint, plugin boundaries, SDK baseline, sidecar/storage guards, and runtime import-cycle checks.
  • git diff --check passed.
  • Fresh autoreview reported no accepted or actionable findings.

This is controlled local transport proof only. No live OpenRouter API call, real account, external proxy or TLS route, or generated music artifact was exercised.

@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 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 14, 2026, 7:39 AM ET / 11:39 UTC.

Summary
The PR passes sanitized OpenRouter provider request settings into music-generation HTTP resolution and adds unit and local HTTP transport coverage.

PR surface: Source +3, Tests +185. Total +188 across 3 files.

Reproducibility: yes. —a high-confidence source reproduction exists: current main hard-codes private-network denial and omits the configured OpenRouter request policy on the music HTTP path. The added regression demonstrates the corrected resolver and transport behavior, although a failing test was not run against current main in this review.

Review metrics: 1 noteworthy metric.

  • Private-network gate: 1 hard denial replaced by configured policy. This is the only behavior change requiring maintainer attention because it expands reachable destinations only when explicitly enabled.

Stored data model
Persistent data-model change detected: serialized state: extensions/openrouter/music-generation-provider.test.ts, serialized state: extensions/openrouter/music-generation-provider.transport.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
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] Merging changes music generation from an unconditional private-network denial to honoring an explicit operator request policy, so a configured request can reach private endpoints; the default remains denied, but the capability scope needs provider-owner confirmation.

Maintainer options:

  1. Confirm and merge the explicit opt-in (recommended)
    Accept that operators who deliberately enable private-network provider requests may use that policy for OpenRouter music generation.
  2. Forward policy but retain private-network denial
    Adjust the music path to preserve its unconditional destination restriction while still honoring safe headers, proxy, and other approved request settings.

Next step before merge

  • An OpenRouter provider-policy owner should decide whether explicit private-network permission applies to music generation, then merge the current patch or request the narrower hard-denial variant.

Maintainer decision needed

  • Question: Should OpenRouter music generation honor an explicit models.providers.openrouter.request.allowPrivateNetwork setting, or must this capability always deny private-network destinations even when the provider policy enables them?
  • Rationale: Source and proof establish that the patch works, but repository evidence does not settle whether music generation is intentionally exempt from the otherwise configurable provider transport policy.
  • Likely owner: vincentkoc — They are the strongest available OpenRouter provider-policy routing signal in the PR timeline.
  • Options:
    • Honor explicit operator policy (recommended): Merge the current behavior so music generation follows the sanitized provider request policy while remaining deny-by-default when no opt-in is configured.
    • Retain the music hard denial: Keep allowPrivateNetwork disabled for music generation while forwarding only request-policy fields that do not broaden destination reach.

Security
Needs attention: The code uses the existing sanitizer and resolver safely, but maintainers must affirm the intentional expansion from a hard private-network denial to explicit operator opt-in.

Review details

Best possible solution:

Use the canonical sanitized request-policy resolver for music generation, preserve deny-by-default behavior unless an operator explicitly opts in, and retain both resolver-wiring and real local transport regression coverage.

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

Yes—a high-confidence source reproduction exists: current main hard-codes private-network denial and omits the configured OpenRouter request policy on the music HTTP path. The added regression demonstrates the corrected resolver and transport behavior, although a failing test was not run against current main in this review.

Is this the best way to solve the issue?

Unclear overall. Reusing the sanitized canonical provider HTTP resolver is the narrowest maintainable implementation, but maintainers must confirm that the full policy—including explicit private-network permission—should apply to music generation.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a focused provider transport-policy bug with limited blast radius and strong regression proof.
  • merge-risk: 🚨 security-boundary: The PR allows explicitly configured OpenRouter music requests to reach private-network destinations where current main always denies them.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR provides exact-head terminal proof from an unmocked provider HTTP path using a local server, showing the configured header reaches the request and the SSE audio response becomes a track; a live OpenRouter account is unnecessary for this transport-wiring claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides exact-head terminal proof from an unmocked provider HTTP path using a local server, showing the configured header reaches the request and the SSE audio response becomes a track; a live OpenRouter account is unnecessary for this transport-wiring claim.
Evidence reviewed

PR surface:

Source +3, Tests +185. Total +188 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 1 +3
Tests 2 185 0 +185
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 189 1 +188

Security concerns:

  • [medium] Confirm private-network policy scope — extensions/openrouter/music-generation-provider.ts:397
    The sanitized request object can carry allowPrivateNetwork=true, so this changed line permits music-generation requests to reach private endpoints where current main always denies them; that may be correct for explicit operator policy, but it is a security-boundary decision.
    Confidence: 0.97

What I checked:

  • Current main remains affected: The music-generation path resolves provider HTTP configuration with an unconditional private-network denial and does not pass the configured OpenRouter request policy. (extensions/openrouter/music-generation-provider.ts:391, 1b02289fcfe9)
  • Canonical request-policy wiring: The PR removes the path-specific denial and passes the sanitized model-provider request object through the existing provider HTTP resolver rather than implementing a parallel transport path. (extensions/openrouter/music-generation-provider.ts:387, 1e52d3418a2d)
  • Focused regression coverage: The provider test verifies that headers and proxy policy are supplied to resolveProviderHttpRequestConfig for the audio capability. (extensions/openrouter/music-generation-provider.test.ts:300, 1e52d3418a2d)
  • Real local transport proof: The added test leaves provider HTTP unmocked, sends a request to a local HTTP server with explicit private-network permission, observes the configured trace header, and decodes the returned SSE audio track; the PR reports 15 focused tests passing. (extensions/openrouter/music-generation-provider.transport.test.ts:1, 1e52d3418a2d)
  • Security boundary is deliberate configuration: The extension policy treats SSRF protection as deny-by-default while permitting explicit configuration, so the remaining question is whether this music capability should participate in that operator opt-in. (extensions/AGENTS.md:45, 1b02289fcfe9)
  • Current PR state: The PR is open, non-draft, mergeable, fully checked, proof-labeled sufficient, and has no outstanding line-level review findings; its branch is behind main but cleanly mergeable. (1e52d3418a2d)

Likely related people:

  • vincentkoc: The live PR timeline explicitly routes this provider-policy discussion to vincentkoc, making them the strongest available owner signal for the OpenRouter transport boundary; exact file-history attribution remains incomplete. (role: recent OpenRouter area contributor; confidence: medium; files: extensions/openrouter/music-generation-provider.ts, extensions/openrouter/music-generation-provider.test.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 (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-13T03:42:34.204Z sha 544b2a27db6d8c74e690aaf5b8db5af26a4e7434 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-13T11:42:20.973Z sha 016b1115f5087fa50de45b95fbbe2188673a16fe :: needs maintainer review before merge. :: none
  • reviewed 2026-07-13T11:57:35.229Z sha 016b1115f5087fa50de45b95fbbe2188673a16fe :: needs maintainer review before merge. :: none
  • reviewed 2026-07-13T16:04:42.049Z sha 06be6af8c473a284367b883c2bf730478182531a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T02:21:58.842Z sha c1abed8b5391013d66510040784550159a00beb8 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T10:27:12.548Z sha 1e52d3418a2dcaccd79c62ab956db5a28db5600f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T10:53:19.450Z sha 1e52d3418a2dcaccd79c62ab956db5a28db5600f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T11:15:40.568Z sha 1e52d3418a2dcaccd79c62ab956db5a28db5600f :: needs maintainer review before merge. :: none

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 12, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head fb4b0c2e164376f3bb78717d1a3cf8d3bb9a7b36 adds local real-transport proof and fixes the request-policy bug found by that proof: OpenRouter music no longer hard-overrides request.allowPrivateNetwork=false. PR body Proof now includes the exact commands and notes that this is controlled local HTTP transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head 6fbb61750f2b3d00a70fbe82fbc15272f3d707aa adds the isolated local transport proof test on top of the latest main merge. PR body Proof now records the exact command/result: git diff check passed and node scripts/run-vitest.mjs extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passed 2 files / 15 tests. This is controlled local provider-http transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

Re-review progress:

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head ff819e2a7dc47fe0b268083f473b16dec9c4bf2d fixes the transport proof lint issue and keeps the local provider-http proof. PR body Proof now records git diff check, focused oxlint, and node scripts/run-vitest.mjs extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passing 2 files / 15 tests. This remains controlled local transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head 40f4ce68ec34fdd86e9cfae9d436f6d91827c6ab is updated from main and PR body Proof now records current-head local provider-http proof. git diff check and focused oxlint passed; node scripts/run-vitest.mjs extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passed 2 files / 15 tests. This is controlled local transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 12, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head a6b4e683ce3c60a14fc73db8f8114645e4a84dda is updated from main and PR body Proof now records current-head local provider-http proof. git diff check and focused oxlint passed; node scripts/run-vitest.mjs extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passed 2 files / 15 tests. This is controlled local transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head c39a4a6dfd81a486fa8c70bbb496a888a433feba is updated from main and PR body Proof now records current-head local provider-http proof. git diff check and focused oxlint passed; node scripts/run-vitest.mjs extensions/openrouter/music-generation-provider.transport.test.ts extensions/openrouter/music-generation-provider.test.ts passed 2 files / 15 tests. This is controlled local transport proof, not a live OpenRouter request.

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

Re-review progress:

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 12, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 12, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 12, 2026
@steipete steipete self-assigned this Jul 16, 2026
@steipete
steipete force-pushed the alix/openrouter-request-policy-music-generation branch from 1e52d34 to f643e7a Compare July 16, 2026 07:33
@steipete
steipete merged commit 1c7ad75 into openclaw:main Jul 16, 2026
89 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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

Labels

extensions: openrouter merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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: S 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.

2 participants