Skip to content
Source
Sign inSign up
TanStack/schemas

Drop OpenAI's Sora examples from the Lovable video operation (#680) #681

Mergedtombeckenhammerged 1 commit intomain fromrefs/pull/681/headmerged by tombeckenham View on GitHub

tombeckenhamcommented

Fixes #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 to api.openai.com with model=sora-2
  • paths./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

  • applyLovableVideoSchema deletes x-oaiMeta from POST /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-oaiMeta shape, 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.fetchSpec plus classifyAndBundle: no throw, /videos is docs-derived, and neither the bundled input nor output mentions Sora.
  • lint, typecheck, format check pass.

Not in this PR

  • GET /videos still carries its own x-oaiMeta with sora-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 -- lovable fails on main before reaching any provider code: ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX on the parameter property in packages/rate-card/src/evaluate.ts:37 under 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. ⚠️ 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

    2. tombeckenham linked this to fix #680

    3. tanstack-source added labelsbug

    4. Explain Change →

      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.ts
      Schema 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 the post.description error path.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Merge Risk: Minimal · up to 417f4

      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: Passed 4

      Check nameStatusExplanation
      Description CheckPassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title checkPassedThe 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 checkPassedIssue #680 requires four coding changes. (1) Drop or rewrite the Sora text that the #666 rewrite left. The diff adds delete post['x-oaiMeta'] in applyLovableVideoSchema (src/server/providers/lovab…
      Out of Scope Changes checkPassedThe 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: the x-oaiMeta deletion, 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 #680 requires four coding changes. (1) Drop or rewrite the Sora text that the #666 rewrite left. The diff adds delete post['x-oaiMeta'] in applyLovableVideoSchema (src/server/providers/lovable-video.ts), which removes the OpenAI curl and response examples that contain sora-2. No Sora value is copied in. (2) Keep the guard with a path-specific error. The guard now uses soraPaths, which recursively scans keys and string values, and throws lovable: video schema still mentions Sora at <paths>. (3) Add the live shape to the fixture. soraSpec() in lovable-video.test.ts now includes the x-oaiMeta request and response examples. (4) Test coverage. The new test checks that the bundled POST /videos contains no Sora text and that a leftover post.description yields 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: the x-oaiMeta deletion, the path-reporting guard that replaces the JSON-stringify check, and the fixture and test additions. The PR leaves GET /videos x-oaiMeta unchanged. 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.

      Share

      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.ts
      • src/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.

    5. tombeckenham merged thisf123aeb

    6. tombeckenham closed this

Sign in to join this conversation.