Repository navigation
feat(server-utils): Instrument the OpenAI decisions API as gen_ai.decide spans - #25285
Merged
Merged
Conversation
…ide spans Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
# Conflicts: # packages/server-utils/src/ai/openai/utils.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0cf6661. Configure here.
andreiborza
added this pull request to stack #25332
October 13, 2026 13:41
andreiborza
marked this pull request as ready for review
October 13, 2026 13:57
nicohrubec
reviewed
Oct 14, 2026
JPeer264
approved these changes
Oct 14, 2026
JPeer264
left a comment
Member
There was a problem hiding this comment.
{ type: 'predicate', name: 'lgtm', probability: 0.99 }
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
OpenAI
decisions.createcalls now createdecide <model>spans with opgen_ai.decide, recorded in the same shape as Jev calls so Sentry renders them the same way:inputis recorded asstate, images included as they are.criteria, like Jev: choices as{ [value]: description }, score levels as their labels.probabilitiesare keyed by option or score value, and score labels go in alegend.predicateanswers keep OpenAI's{ type, probability }, which Sentry renders as yes/no.input: "I want a refund"state: "I want a refund"[{ name: "wants_refund", type: "predicate", ... }]{ wants_refund: { type: "predicate", ... } }choices: [{ value: "billing", description: "Charges and refunds" }, { value: "other" }]criteria: { billing: "Charges and refunds", other: "" }levels: [{ label: "low" }, { label: "high", description: "Blocks the customer" }]criteria: ["low", "high"],descriptions: { "1": "Blocks the customer" }[{ name: "wants_refund", type: "predicate", ... }]{ wants_refund: { type: "predicate", ... } }{ type: "predicate", probability: 0.97 }choice: true,probabilities: [{ value: true, probability: 0.91 }, ...]choice: "true",probabilities: { "true": 0.91, ... }probabilities: [{ value: 1, label: "high", probability: 0.95 }, ...]probabilities: { "1": 0.95, ... },legend: { "1": "high", ... }OpenAI decisions have a few things Jev does not:
predicatequestions and answers instead ofnoul, with the yes probability inprobability.choiceis recorded as a string so Sentry renders it.descriptionskeyed by score value. Sentry does not render them yet.{ type: "refusal" }, with no probability or reason. Sentry does not render it yet.Why
OpenAI added a Decisions API that works like Jev, and these calls had no span.
Related: #25253