Skip to content

Fix OpenAI Java 4.54 compatibility - #12340

Open
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/fix-openai-java-4.54-muzzle
Open

Fix OpenAI Java 4.54 compatibility#12340
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/fix-openai-java-4.54-muzzle

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds compatibility handling for ResponseInputItem.FunctionCallOutput.callId() across OpenAI Java versions. Versions before 4.54 return String; version 4.54 and later return Optional<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 String descriptor, 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 ResponseServiceTest

The 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

Jira ticket: [PROJ-IDENT]

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: bug fix Bug fix comp: mlobs ML Observability (LLMObs) tag: ai generated Largely based on code generated by an AI or LLM labels Aug 29, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Aug 29, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review August 29, 2026 02:17
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner August 29, 2026 02:17
@dd-octo-sts

dd-octo-sts Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Remove the issue linking keyword

If you need help, please check our contributing guidelines.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T02:19:57.123928Z e265663 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

The method handle does not bind to either SDK return descriptor. It returns the call ID for both String and Optional results.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit e265663 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@datadog-prod-us1-5

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.74% (+10.93%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e265663 | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.71 s 14.66 s [-0.4%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 13.57 s 13.72 s [-1.7%; -0.5%] (maybe better)
startup:petclinic:appsec:Agent 17.56 s 17.36 s [+0.2%; +2.0%] (maybe worse)
startup:petclinic:iast:Agent 17.39 s 17.56 s [-1.8%; -0.1%] (maybe better)
startup:petclinic:profiling:Agent 17.46 s 17.32 s [-0.1%; +1.8%] (no difference)
startup:petclinic:sca:Agent 17.44 s 17.20 s [+0.2%; +2.5%] (maybe worse)
startup:petclinic:tracing:Agent 16.68 s 16.67 s [-0.8%; +0.9%] (no difference)

Commit: e2656636 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: mlobs ML Observability (LLMObs) tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant