Skip to content

Commit 61abb2c

Browse files
authored
fix(agents): Applied workaround for kotlin wasm bug which produced invalid wasm file (#1365)
Workaround for kotlin/wasm compiler bug https://youtrack.jetbrains.com/issue/KT-83728 This workaround needed so far for Kotlin/Wasm target. Backend has a bug which makes produced wasm invalid. This is a temporary workaround in case when koog could be released earlier than the compiler, so Air (or other koog users) could adopt kotlin/wasm earlier.
1 parent d430aee commit 61abb2c

File tree

1 file changed

+4
-1
lines changed
  • agents/agents-core/src/commonMain/kotlin/ai/koog/agents/core/agent/entity

1 file changed

+4
-1
lines changed

agents/agents-core/src/commonMain/kotlin/ai/koog/agents/core/agent/entity/AIAgentSubgraph.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,17 @@ public open class AIAgentSubgraph<TInput, TOutput>(
258258

259259
// find the suitable edge to move to the next node, get the transformed output
260260
val resolvedEdge = currentNode.resolveEdgeUnsafe(context, nodeOutput)
261-
?: // In we are in the finish node, we need to exit, otherwise we stuck in the node
261+
262+
// In we are in the finish node, we need to exit, otherwise we stuck in the node
263+
if (resolvedEdge == null) {
262264
if (currentNode == finish) {
263265
currentInput = nodeOutput
264266
break
265267
} else {
266268
logger.error { formatLog(context, "Agent stuck in node ${currentNode.name}") }
267269
throw AIAgentStuckInTheNodeException(currentNode, nodeOutput)
268270
}
271+
}
269272

270273
currentNode = resolvedEdge.edge.toNode
271274
currentInput = resolvedEdge.output

0 commit comments

Comments
 (0)