Skip to content

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Nov 6, 2025

Note

Adds extensive tests for VercelProvider mapping/streaming behavior and makes getAIMetricsFromStream robust to rejected usage promises with fallback logic.

  • Tests (__tests__/VercelProvider.test.ts):
    • Add coverage for toVercelAISDK:
      • Handles undefined model/messages, merges additional messages, maps parameters, supports provider map, and throws on undetermined model/provider.
    • Add coverage for getAIMetricsFromStream:
      • Extracts usage from totalUsage (preferred) or usage, handles missing/errored finishReason, absent usage, rejected usage/totalUsage, and supports v4/v5 token fields.
  • Source (src/VercelProvider.ts):
    • Update getAIMetricsFromStream to catch rejections from totalUsage/usage and fall back gracefully; leave success based on finishReason.

Written by Cursor Bugbot for commit 7e59922. This will update automatically on new commits. Configure here.

@jsonbailey jsonbailey requested a review from a team as a code owner November 6, 2025 15:03
@jsonbailey
Copy link
Contributor Author

The better error handling included in this PR is for unreleased code which is why this is a chore and not a fix.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 169118 bytes
Compressed size limit: 200000
Uncompressed size: 789399 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 24988 bytes
Compressed size limit: 26000
Uncompressed size: 122411 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 17636 bytes
Compressed size limit: 20000
Uncompressed size: 90259 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 21721 bytes
Compressed size limit: 25000
Uncompressed size: 74698 bytes

@jsonbailey jsonbailey merged commit 352643e into main Nov 6, 2025
33 checks passed
@jsonbailey jsonbailey deleted the jb/additional-vercel-tests branch November 6, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants