Skip to content

Commit 311f3ee

Browse files
Miley Chandonnetclaude
authored andcommitted
Fix Kotlin compiler warnings
- Remove unnecessary non-null assertion in ToolAskHumanTest.kt - Replace deprecated maxTokens with maxCompletionTokens - Add @OptIn(DelicateCoroutinesApi::class) annotations for GlobalScope usage Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 433a18b commit 311f3ee

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

ampere-core/src/commonTest/kotlin/link/socket/ampere/agents/execution/tools/ToolAskHumanTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import link.socket.ampere.agents.execution.request.ExecutionContext
3232
import link.socket.ampere.agents.execution.request.ExecutionRequest
3333
import link.socket.ampere.util.randomUUID
3434

35+
@OptIn(kotlinx.coroutines.DelicateCoroutinesApi::class)
3536
class ToolAskHumanTest {
3637

3738
private fun makeContext(instructions: String) = ExecutionContext.NoChanges(
@@ -158,7 +159,7 @@ class ToolAskHumanTest {
158159
timestamp = Clock.System.now(),
159160
eventSource = EventSource.Human,
160161
urgency = Urgency.HIGH,
161-
emissionId = callbackEvent!!.emissionId,
162+
emissionId = callbackEvent.emissionId,
162163
affordanceId = "free-text",
163164
),
164165
)

ampere-core/src/commonTest/kotlin/link/socket/ampere/llm/UpstreamLlmClientTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class UpstreamLlmClientTest {
5454
val captured = assertNotNull(recorder.lastRequest, "Custom client must be invoked")
5555
assertEquals(AIModel_Claude.Sonnet_4.name, captured.model.id)
5656
assertEquals(0.7, captured.temperature)
57-
assertEquals(256, captured.maxTokens)
57+
assertEquals(256, captured.maxCompletionTokens)
5858
assertEquals(2, captured.messages.size)
5959
assertEquals(ChatRole.System, captured.messages[0].role)
6060
assertEquals("You are a database expert.", captured.messages[0].content)

ampere-core/src/jvmTest/kotlin/link/socket/ampere/agents/events/messages/escalation/EscalationEventHandlerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import link.socket.ampere.agents.events.messages.MessageThread
2828
import link.socket.ampere.data.DEFAULT_JSON
2929
import link.socket.ampere.db.Database
3030

31-
@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
31+
@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class, kotlinx.coroutines.DelicateCoroutinesApi::class)
3232
class EscalationEventHandlerTest {
3333

3434
private val scope = TestScope(UnconfinedTestDispatcher())

ampere-core/src/jvmTest/kotlin/link/socket/ampere/agents/execution/tools/HumanEscalationFlowTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import link.socket.ampere.util.randomUUID
4545
* - Subscribers on base EmissionEvent.Produced receive HumanInteractionEvent.InputRequested
4646
* - GlobalHumanResponseRegistry is NOT referenced (coverage assertion)
4747
*/
48+
@OptIn(kotlinx.coroutines.DelicateCoroutinesApi::class)
4849
class HumanEscalationFlowTest {
4950

5051
private fun newRegistry() = EmissionReplyRegistry()

0 commit comments

Comments
 (0)