Skip to content

fix(sdk): use java duration for command request timeouts#928

Merged
Pangjiping merged 4 commits into
alibaba:mainfrom
ninan-nn:feature/minor_update_20260521
May 25, 2026
Merged

fix(sdk): use java duration for command request timeouts#928
Pangjiping merged 4 commits into
alibaba:mainfrom
ninan-nn:feature/minor_update_20260521

Conversation

@ninan-nn
Copy link
Copy Markdown
Collaborator

@ninan-nn ninan-nn commented May 21, 2026

Summary

  • Use java.time.Duration as the primary command timeout type for the Kotlin sandbox SDK.
  • Keep deprecated kotlin.time.Duration overloads for RunCommandRequest, RunInSessionRequest, and the Commands.runInSession(...) convenience API so existing Kotlin builder-style callers can migrate gradually.
  • Update command request serialization to convert Java durations with toMillis() while keeping the wire timeout value in milliseconds.
  • Bump the Kotlin sandbox SDK version and default User-Agent from 1.0.11 to 1.0.12.
  • Closes [Bug] Cannot call RunCommandRequest.Builder#timeout(Duration) from Java code due to Kotlin name mangling #849

Testing

  • Unit tests: cd sdks/sandbox/kotlin && ./gradlew :sandbox:test
  • Formatting: cd sdks/sandbox/kotlin && ./gradlew spotlessCheck
  • Integration tests
  • e2e / manual verification

Compatibility

  • Java callers can now use java.time.Duration directly for command timeouts.
  • Existing Kotlin callers that pass kotlin.time.Duration to the supported overloads continue to compile, but those overloads are deprecated in favor of java.time.Duration.
  • Code that directly reads request.timeout now receives java.time.Duration? instead of kotlin.time.Duration? and may need a small migration.

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@ninan-nn ninan-nn changed the title fix(sdk): use java duration for Kotlin command timeouts fix(sdk): use java duration for command request timeouts May 21, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 58509092e2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ninan-nn ninan-nn added the sdks label May 21, 2026
Pangjiping
Pangjiping previously approved these changes May 21, 2026
Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: e07b9fde00

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangjiping Pangjiping merged commit 75b3803 into alibaba:main May 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cannot call RunCommandRequest.Builder#timeout(Duration) from Java code due to Kotlin name mangling

2 participants