You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make StdioTransport accept Flow<String> + suspend writer
Promote the Flow-based pair to the primary constructor and keep the
existing Source/Sink one as a back-compat secondary, marked @deprecated:
the blocking variant pins a dispatcher thread per readLine and would
saturate the I/O pool under high agent concurrency.
Fix close() to cancel childScope. Previously close() only closed the
channels and invoked closeHandler; the Source/Sink path worked because
closing the underlying streams unblocked readLine, but the Flow path
has no equivalent unblock — close() would leave the read job parked
inside input.collect and the transport stuck in CLOSING. Cancelling
childScope cooperatively unwinds the collect, the read job exits,
joinAll returns, and the finally block sets state to CLOSED. The
Source/Sink path is unaffected (the cancel is a no-op once the job has
already exited).
Add StdioTransportFlowTest covering the new primary path: round-trip
send/receive, JSON-skip behaviour, input-flow completion, input-flow
errors, the output exception contract (IOException = clean, anything
else = onError), parent-scope cancellation, and the close-deadlock
regression itself.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: acp/api/acp.api
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -501,6 +501,8 @@ public abstract class com/agentclientprotocol/transport/BaseTransport : com/agen
501
501
}
502
502
503
503
public final class com/agentclientprotocol/transport/StdioTransport : com/agentclientprotocol/transport/BaseTransport {
504
+
public fun <init> (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Ljava/lang/String;)V
505
+
public synthetic fun <init> (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
504
506
public fun <init> (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlinx/io/Source;Lkotlinx/io/Sink;Ljava/lang/String;)V
505
507
public synthetic fun <init> (Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlinx/io/Source;Lkotlinx/io/Sink;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
0 commit comments