Fix OpenAI Java 4.54 compatibility - #12340
Conversation
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The method handle does not bind to either SDK return descriptor. It returns the call ID for both String and Optional results.
🤖 Datadog Autotest · Commit e265663 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
🎯 Code Coverage (details) 🔗 Commit SHA: e265663 | Docs | View more details | Give us feedback! |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
What Does This Do
Adds compatibility handling for
ResponseInputItem.FunctionCallOutput.callId()across OpenAI Java versions. Versions before 4.54 returnString; version 4.54 and later returnOptional<String>. The instrumentation resolves the accessor through the existing method-handle compatibility helper and normalizes both forms to a nullable string.Updates latest-dependency coverage to OpenAI Java 4.54.0, asserts that function-call output IDs are preserved, and adds the request fixture for the 4.54 serialization order.
Motivation
OpenAI Java 4.54.0 made function-call output call IDs optional, changing the JVM method descriptor. The existing direct invocation referenced the earlier
Stringdescriptor, causing muzzle validation to reject 4.54.0 and preventing the instrumentation from loading for that version.Additional Notes
Validation:
./gradlew :dd-java-agent:instrumentation:openai-java:openai-java-3.0:muzzle./gradlew :dd-java-agent:instrumentation:openai-java:openai-java-3.0:test :dd-java-agent:instrumentation:openai-java:openai-java-3.0:latestDepTest --tests ResponseServiceTestThe minimum-dependency suite uses OpenAI Java 3.0.1 and the latest-dependency suite uses OpenAI Java 4.54.0. The response tests passed against both versions. The compatibility fallback is intentionally silent, so an unexpected SDK shape cannot produce a debug-log entry for every function-call output.
Upstream API change: openai/openai-java#939
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]