Skip to content

Fix openai-java latestDep tests after bumping to 4.43.0#12036

Open
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/openai-java-4.43-cache-write-tokens
Open

Fix openai-java latestDep tests after bumping to 4.43.0#12036
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/openai-java-4.43-cache-write-tokens

Conversation

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor

What Does This Do

Bumps openai-java latest-dep tests from 4.41.0 to 4.43.0 and fixes the resulting latestDepTest failure in the openai-java-3.0 instrumentation.

4.43.0 added a new field cache_write_tokens to ResponseUsage.InputTokensDetails and made it required by the SDK's generated validate(). The recorded Responses fixtures predate that field, so resp.parse().valid (which runs full schema validation) started returning false.

Fix: added "cache_write_tokens": 0 to the input_tokens_details block of the affected http-records/responses/*.rec fixtures.

Motivation

  • Keep the .valid assertion, which forces full response parsing so all span tags get set.
  • Adding the field is transparent to the pinned 3.0.1 test run: an extra JSON field just lands in additionalProperties, and validate() only fails on missing known fields. So both the pinned test and floating latestDepTest pass.

Additional Notes

  • Fixtures are keyed by a hash of the request body; only response bodies were edited, so record lookup is unaffected.
  • latestDepTest floats to the newest SDK, so this class of break can recur if a future release adds another required-validated field — the fix is the same (add it to the response fixtures).
  • Verified locally: test (3.0.1) + latestDepTest (4.43.0) → 190 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: bug fix Bug fix inst: others All other instrumentations tag: no release notes Changes to exclude from release notes tag: ai generated Largely based on code generated by an AI or LLM labels Jul 22, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Jul 22, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from ygree July 22, 2026 15:13
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review July 22, 2026 15:13
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner July 22, 2026 15:13

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

Copy link
Copy Markdown

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 PR safely bumps openai-java from 4.41.0 to 4.43.0 and updates all 12 response fixtures with the new required cache_write_tokens field. All fixtures have valid JSON syntax and maintain backward compatibility with the pinned 3.0.1 SDK version.

Was this helpful? React 👍 or 👎

📊 Validated against 12 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 5b07986 · What is Autotest? · Any feedback? Reach out in #autotest

@datadog-prod-us1-4

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.73% (+12.34%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5b07986 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 22, 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 13.90 s 13.95 s [-1.0%; +0.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.90 s 13.06 s [-2.0%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 17.47 s 17.29 s [+0.2%; +1.9%] (maybe worse)
startup:petclinic:iast:Agent 17.33 s 16.92 s [-1.8%; +6.7%] (no difference)
startup:petclinic:profiling:Agent 17.34 s 17.48 s [-2.2%; +0.5%] (no difference)
startup:petclinic:sca:Agent 17.44 s 17.54 s [-1.2%; +0.1%] (no difference)
startup:petclinic:tracing:Agent 16.59 s 16.65 s [-1.3%; +0.6%] (no difference)

Commit: 5b07986f · 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

inst: others All other instrumentations tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant