diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 9d5158bf..93e86605 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.12.1"
+ ".": "0.12.2"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 54a51889..d1112eb0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 40
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-2d0bb64dc84ba67ee91db6ff81424a968c5ddea4d2844ba67fc9b4b27881d60f.yml
-openapi_spec_hash: 8e1d6bc2a6c6afef625e2bdcdf28ac63
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-622d0508ba6d0dfdff958a160f8306d7425b0a517997509ffb04f237f8ebcddd.yml
+openapi_spec_hash: edd7b30279dd17b02cbca5fc51e40c89
config_hash: d8e8429147c4e214ff53c11e7ab2a1a6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b71b7366..1442e298 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 0.12.2 (2026-03-18)
+
+Full Changelog: [v0.12.1...v0.12.2](https://github.com/sentdm/sent-dm-java/compare/v0.12.1...v0.12.2)
+
+### Bug Fixes
+
+* **client:** allow updating header/query affecting fields in `toBuilder()` ([f3afdff](https://github.com/sentdm/sent-dm-java/commit/f3afdffd2d250e961747ed0f802504b3f60184ce))
+
+
+### Chores
+
+* **internal:** update retry delay tests ([6fab665](https://github.com/sentdm/sent-dm-java/commit/6fab66502dab0aec7c4de51797fc3ab777c8ee35))
+
## 0.12.1 (2026-03-17)
Full Changelog: [v0.12.0...v0.12.1](https://github.com/sentdm/sent-dm-java/compare/v0.12.0...v0.12.1)
diff --git a/README.md b/README.md
index 82588b28..3f01b133 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/dm.sent/sent-dm-java/0.12.1)
-[](https://javadoc.io/doc/dm.sent/sent-dm-java/0.12.1)
+[](https://central.sonatype.com/artifact/dm.sent/sent-dm-java/0.12.2)
+[](https://javadoc.io/doc/dm.sent/sent-dm-java/0.12.2)
@@ -22,7 +22,7 @@ Use the Sent Dm MCP Server to enable AI assistants to interact with this API, al
-The REST API documentation can be found on [docs.sent.dm](https://docs.sent.dm). Javadocs are available on [javadoc.io](https://javadoc.io/doc/dm.sent/sent-dm-java/0.12.1).
+The REST API documentation can be found on [docs.sent.dm](https://docs.sent.dm). Javadocs are available on [javadoc.io](https://javadoc.io/doc/dm.sent/sent-dm-java/0.12.2).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.sent.dm](https://docs.sent.dm).
### Gradle
```kotlin
-implementation("dm.sent:sent-dm-java:0.12.1")
+implementation("dm.sent:sent-dm-java:0.12.2")
```
### Maven
@@ -42,7 +42,7 @@ implementation("dm.sent:sent-dm-java:0.12.1")
dm.sent
sent-dm-java
- 0.12.1
+ 0.12.2
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 6f49280a..dad6ed46 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "dm.sent"
- version = "0.12.1" // x-release-please-version
+ version = "0.12.2" // x-release-please-version
}
subprojects {
diff --git a/sent-dm-java-core/src/main/kotlin/dm/sent/core/ClientOptions.kt b/sent-dm-java-core/src/main/kotlin/dm/sent/core/ClientOptions.kt
index 5c6973d0..d4557b22 100644
--- a/sent-dm-java-core/src/main/kotlin/dm/sent/core/ClientOptions.kt
+++ b/sent-dm-java-core/src/main/kotlin/dm/sent/core/ClientOptions.kt
@@ -411,13 +411,14 @@ private constructor(
headers.put("X-Stainless-Runtime", "JRE")
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString())
+ // We replace after all the default headers to allow end-users to overwrite them.
+ headers.replaceAll(this.headers.build())
+ queryParams.replaceAll(this.queryParams.build())
apiKey.let {
if (!it.isEmpty()) {
- headers.put("x-api-key", it)
+ headers.replace("x-api-key", it)
}
}
- headers.replaceAll(this.headers.build())
- queryParams.replaceAll(this.queryParams.build())
return ClientOptions(
httpClient,
diff --git a/sent-dm-java-core/src/test/kotlin/dm/sent/core/ClientOptionsTest.kt b/sent-dm-java-core/src/test/kotlin/dm/sent/core/ClientOptionsTest.kt
index 1c468d6d..cf75fa61 100644
--- a/sent-dm-java-core/src/test/kotlin/dm/sent/core/ClientOptionsTest.kt
+++ b/sent-dm-java-core/src/test/kotlin/dm/sent/core/ClientOptionsTest.kt
@@ -16,6 +16,28 @@ internal class ClientOptionsTest {
private val httpClient = mock()
+ @Test
+ fun putHeader_canOverwriteDefaultHeader() {
+ val clientOptions =
+ ClientOptions.builder()
+ .httpClient(httpClient)
+ .putHeader("User-Agent", "My User Agent")
+ .apiKey("My API Key")
+ .build()
+
+ assertThat(clientOptions.headers.values("User-Agent")).containsExactly("My User Agent")
+ }
+
+ @Test
+ fun toBuilder_customerApiKeyCanBeUpdated() {
+ var clientOptions =
+ ClientOptions.builder().httpClient(httpClient).apiKey("My API Key").build()
+
+ clientOptions = clientOptions.toBuilder().apiKey("another My API Key").build()
+
+ assertThat(clientOptions.headers.values("x-api-key")).containsExactly("another My API Key")
+ }
+
@Test
fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() {
var clientOptions =
diff --git a/sent-dm-java-core/src/test/kotlin/dm/sent/core/http/RetryingHttpClientTest.kt b/sent-dm-java-core/src/test/kotlin/dm/sent/core/http/RetryingHttpClientTest.kt
index 421986de..a0cc8cb2 100644
--- a/sent-dm-java-core/src/test/kotlin/dm/sent/core/http/RetryingHttpClientTest.kt
+++ b/sent-dm-java-core/src/test/kotlin/dm/sent/core/http/RetryingHttpClientTest.kt
@@ -400,9 +400,9 @@ internal class RetryingHttpClientTest {
assertThat(sleeper.durations).hasSize(3)
// retries=1: 0.5s * [0.75, 1.0]
assertThat(sleeper.durations[0]).isBetween(Duration.ofMillis(375), Duration.ofMillis(500))
- // retries=2: 1.0s * [0.75, 1.0]
+ // retries=2: 1s * [0.75, 1.0]
assertThat(sleeper.durations[1]).isBetween(Duration.ofMillis(750), Duration.ofMillis(1000))
- // retries=3: 2.0s * [0.75, 1.0]
+ // retries=3: 2s * [0.75, 1.0]
assertThat(sleeper.durations[2]).isBetween(Duration.ofMillis(1500), Duration.ofMillis(2000))
assertNoResponseLeaks()
}
@@ -427,9 +427,9 @@ internal class RetryingHttpClientTest {
assertThat(response.statusCode()).isEqualTo(503)
verify(7, postRequestedFor(urlPathEqualTo("/something")))
assertThat(sleeper.durations).hasSize(6)
- // retries=5: min(0.5 * 2^4, 8) = 8.0s * [0.75, 1.0]
+ // retries=5: backoff hits the 8s cap * [0.75, 1.0]
assertThat(sleeper.durations[4]).isBetween(Duration.ofMillis(6000), Duration.ofMillis(8000))
- // retries=6: min(0.5 * 2^5, 8) = min(16, 8) = 8.0s * [0.75, 1.0] (capped)
+ // retries=6: still capped at 8s * [0.75, 1.0]
assertThat(sleeper.durations[5]).isBetween(Duration.ofMillis(6000), Duration.ofMillis(8000))
assertNoResponseLeaks()
}