Skip to content

fix: allow missing task and duration in diarized transcriptions#803

Open
wskr00 wants to merge 4 commits into
openai:mainfrom
wskr00:fix/optional-diarized-duration-task
Open

fix: allow missing task and duration in diarized transcriptions#803
wskr00 wants to merge 4 commits into
openai:mainfrom
wskr00:fix/optional-diarized-duration-task

Conversation

@wskr00

@wskr00 wskr00 commented Jul 19, 2026

Copy link
Copy Markdown

Summary

Fixes diarized transcription response handling when optional fields are omitted by the API.

  • Make duration optional in TranscriptionDiarized.
  • Accept an omitted task field while continuing to reject unexpected task values.
  • Add deserialization and validation coverage for responses without these fields.

Testing

  • ./scripts/test
  • ./scripts/format
  • ./scripts/lint

Fixes #802

wskr00 added 2 commits July 18, 2026 23:02
Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
@wskr00
wskr00 requested a review from a team as a code owner July 19, 2026 02:12

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1703369d8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* server responded with an unexpected value).
*/
fun duration(): Double = duration.getRequired("duration")
fun duration(): Optional<Double> = duration.getOptional("duration")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the duration getter's JVM descriptor

When an application or library compiled against the previous SDK invokes this getter after the SDK jar is upgraded without recompiling that caller, its bytecode still resolves duration()D, while this class now only provides duration()Ljava/util/Optional;; the invocation therefore fails at runtime with NoSuchMethodError, even when the response contains a duration. The primitive builder overload preserves the setter ABI, but the public getter needs equivalent compatibility handling (for example, retaining it and exposing the optional value under a new method name) or this change must be treated as a breaking release.

Useful? React with 👍 / 👎.

Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
@wskr00

wskr00 commented Jul 19, 2026

Copy link
Copy Markdown
Author

About this:

When an application or library compiled against the previous SDK invokes this getter after the SDK jar is upgraded without recompiling that caller, its bytecode still resolves duration()D, while this class now only provides duration()Ljava/util/Optional;; the invocation therefore fails at runtime with NoSuchMethodError, even when the response contains a duration. The primitive builder overload preserves the setter ABI, but the public getter needs equivalent compatibility handling (for example, retaining it and exposing the optional value under a new method name) or this change must be treated as a breaking release.

Since the API can omit duration, the model needs an optional representation. Would the team prefer that keep the current change to duration(): Optional<Double>, or preserve the existing duration(): Double method for binary compatibility and introduce a separate optional accessor, such as durationOptional()?

I would appreciate guidance on the team's preferred compatibility approach before changing the public API further.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c8d0d2db5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make diarized transcription duration and task optional

1 participant