File tree Expand file tree Collapse file tree
acp/src/commonMain/kotlin/com/agentclientprotocol/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,15 +251,11 @@ public class Client(
251251 if (sessionId != null ) {
252252 // Session may have been closed between the elicitation and the completion;
253253 // per the RFD, ignore unknown/already-completed IDs gracefully
254+
255+
254256 val holder = _sessions .value.sessions[sessionId]
255257 if (holder != null && holder.session.isCompleted) {
256- @Suppress(" SwallowedException" )
257- val session = try {
258- @OptIn(ExperimentalCoroutinesApi ::class )
259- holder.session.getCompleted()
260- } catch (_: IllegalStateException ) {
261- null
262- }
258+ val session = runCatching { getSessionOrThrow(sessionId) }.getOrNull()
263259 if (session != null ) {
264260 val ops = session.operations as ? ElicitationOperations
265261 if (ops != null ) {
You can’t perform that action at this time.
0 commit comments