Drop OpenAI's Sora examples from the Lovable video operation (#680) #681
main fromrefs/pull/681/head·merged by tombeckenham View on GitHubFixes #680.
Cause#
Reproduced against the live OpenAI spec and the live Lovable listing. The only Sora text the #666 rewrite left inside the guard's scope was OpenAI's own example block on the operation:
paths./videos.post.x-oaiMeta.examples.request.curl- a curl toapi.openai.comwithmodel=sora-2paths./videos.post.x-oaiMeta.examples.response-"model": "sora-2","size": "1024x1792"
The #666 fixture had no x-oaiMeta, so the test passed and the daily sync threw.
Change#
applyLovableVideoSchemadeletesx-oaiMetafromPOST /videos. Lovable's video page publishes no request example, so nothing replaces it and no Sora value is copied in.- The guard stays, and its error now lists every JSON path that matched, e.g.
lovable: video schema still mentions Sora at post.description. - The test fixture carries the live
x-oaiMetashape, and a new test covers the path in the error.
Verified#
pnpm run test src/server/providers/lovable-video.test.ts- 4 pass.- A throwaway live test ran the real
provider.fetchSpecplusclassifyAndBundle: no throw,/videosisdocs-derived, and neither the bundled input nor output mentions Sora. - lint, typecheck, format check pass.
Not in this PR#
GET /videosstill carries its ownx-oaiMetawithsora-2. It is outside the guard and nothing stores or serves it (only POST request/response schemas are bundled), so it is left alone.pnpm run rederive -- lovablefails on main before reaching any provider code:ERR_UNSUPPORTED_TYPESCRIPT_SYNTAXon the parameter property inpackages/rate-card/src/evaluate.ts:37under Node's strip-only mode. Unrelated to this fix.
Summary by CodeRabbit#
- Bug Fixes
- Improved handling of video provider schemas by removing unsupported example content and identifying where remaining unsupported references appear. This provides clearer feedback when a schema cannot be processed.
- 1
tombeckenham linked this to fix #680
tanstack-source added labelsbug
No actionable comments were generated in the recent review.
Walkthrough
-
The Lovable video schema processing removes OpenAI operation metadata and checks for remaining Sora text. If it finds a match, it throws an error that identifies the matching path. The test fixture and test cover the metadata and error behavior.
Changes: Lovable video schema
Layer / File(s) Summary Remove metadata and validate video schemas
src/server/providers/lovable-video.ts,src/server/providers/lovable-video.test.tsSchema processing removes post['x-oaiMeta']and recursively checks keys and values for Sora text. Errors identify matching paths. The test fixture includes Sora metadata, and the test checks metadata removal and thepost.descriptionerror path.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to417f4-
The change removes OpenAI's Sora examples from the Lovable video operation and makes the Sora check report the exact matching paths. The change is small and covered by tests, and I found no merge-blocking risk.
Pre-merge checks:
4-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title states the main change: removing OpenAI's Sora examples from the Lovable video operation. The raw summary says applyLovableVideoSchema now removes post['x-oaiMeta'], which held the Sora exam… Linked Issues check Issue #680requires four coding changes. (1) Drop or rewrite the Sora text that the#666rewrite left. The diff addsdelete post['x-oaiMeta']inapplyLovableVideoSchema(src/server/providers/lovab…Out of Scope Changes check The whole-PR diff against the merge base touches only src/server/providers/lovable-video.ts and src/server/providers/lovable-video.test.ts. Every hunk maps to #680: thex-oaiMetadeletion, the path-…Full details: Title check
-
Explanation
The title states the main change: removing OpenAI's Sora examples from the Lovable video operation. The raw summary says applyLovableVideoSchema now removes post['x-oaiMeta'], which held the Sora example, and the Sora guard now reports matching paths. The title matches the changeset and the linked objectives. The trailing (
#680) is an issue reference, which does not affect relevance.
Full details: Linked Issues check
-
Explanation
Issue
#680requires four coding changes. (1) Drop or rewrite the Sora text that the#666rewrite left. The diff addsdelete post['x-oaiMeta']inapplyLovableVideoSchema(src/server/providers/lovable-video.ts), which removes the OpenAI curl and response examples that containsora-2. No Sora value is copied in. (2) Keep the guard with a path-specific error. The guard now usessoraPaths, which recursively scans keys and string values, and throwslovable: video schema still mentions Sora at <paths>. (3) Add the live shape to the fixture.soraSpec()in lovable-video.test.ts now includes thex-oaiMetarequest and response examples. (4) Test coverage. The new test checks that the bundled POST /videos contains no Sora text and that a leftoverpost.descriptionyields the path-specific error. The live reproduction described in the PR is author-reported and cannot be re-run from the repository. The coding requirements are met by the code and tests at the reviewed head.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff against the merge base touches only src/server/providers/lovable-video.ts and src/server/providers/lovable-video.test.ts. Every hunk maps to
#680: thex-oaiMetadeletion, the path-reporting guard that replaces the JSON-stringify check, and the fixture and test additions. The PR leaves GET /videosx-oaiMetaunchanged. The issue does not request that change, so leaving it is consistent with scope. No unrelated changes were found.
-
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.
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:
432641fe-c85c-4ddf-b2cd-6281ba85a539
Commits-
Reviewing files that changed from the base of the PR and between 9153af1d1513119dbad447dc1378b5603d729782 and 417f443f0e0cd06eab0f83d56c618bc31176f59c.
Files selected for processing: 2-
src/server/providers/lovable-video.test.tssrc/server/providers/lovable-video.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
-
tombeckenham merged thisf123aeb
tombeckenham closed this
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 417f443f0e0cd06eab0f83d56c618bc31176f59c
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR