Repository navigation
fix(server-utils): Keep OpenAI decision confidence on Vercel AI decide spans - #25457
Open
andreiborza wants to merge 3 commits into
Open
andreiborza wants to merge 3 commits into
andreiborza wants to merge 3 commits into
Conversation
andreiborza
requested review from
JPeer264 and
mydea
and removed request for
a team
October 16, 2026 14:00
andreiborza
added this pull request to stack #25459
October 16, 2026 14:04
Contributor
size-limit report 📦
|
nicohrubec
approved these changes
Oct 19, 2026
| recordOutputs: true, | ||
| }, | ||
| result: { | ||
| answers: { department: { type: 'choice', value: 'billing' } }, |
Member
There was a problem hiding this comment.
should this not be choice instead of value? https://github.com/vercel/ai/blob/main/packages/ai/src/decide/decision-result.ts#L9-L15
andreiborza
force-pushed
the
ab/vercel-ai-openai-decide-confidence
branch
from
October 19, 2026 09:26
2d16764 to
9c59cf9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c59cf9. Configure here.
…e spans Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andreiborza
force-pushed
the
ab/vercel-ai-openai-decide-confidence
branch
from
October 19, 2026 11:45
13bc41b to
b2b9dcd
Compare
JPeer264
approved these changes
Oct 19, 2026
| answers: { department: { type: 'choice', choice: 'billing' } }, | ||
| providerMetadata: { [provider]: { confidence: { department: 0.91 } } }, | ||
| }, | ||
| } as unknown as Message; |
Member
There was a problem hiding this comment.
l: That might be better (same for the test which already existed)
Suggested change
| } as unknown as Message; | |
| } satisfies Message; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Decide spans from Vercel AI
experimental_decidewithopenai.decisionModel()now keep the confidence of each answer.Why
The OpenAI provider moves confidence out of the answers into its provider metadata, so before this change Sentry lost it. TypeSafe models already kept it.