tung
12/01/2025, 1:57 PMDidier Villevalois
12/01/2025, 2:11 PMtung
12/01/2025, 2:34 PMtung
12/01/2025, 3:13 PMSergey Y.
12/01/2025, 4:56 PMSergey Y.
12/01/2025, 5:02 PMDidier Villevalois
12/01/2025, 5:11 PMollama pull <http://hf.co/mradermacher/ToolACE-2.5-Llama-3.1-8B-i1-GGUF:Q4_K_M|hf.co/mradermacher/ToolACE-2.5-Llama-3.1-8B-i1-GGUF:Q4_K_M>Sergey Y.
12/01/2025, 5:20 PMVadim Briliantov
12/01/2025, 11:25 PMSergey Y.
12/01/2025, 11:34 PMtung
12/01/2025, 11:47 PMtung
12/02/2025, 4:19 PMgpt-oss-20b model through OpenRouter, but I’m encountering a serialization issue when calling tools that have no parameters.
I get the following exception:
Exception in thread "main" io.ktor.serialization.JsonConvertException: Illegal input: Field 'arguments' is required for type with serial name 'ai.koog.prompt.executor.clients.openrouter.OpenRouterFunction', but it was missing at path: $.choices[0].message.toolCalls[0].function
I saw that https://github.com/JetBrains/koog/issues/489 was supposed to fix this problem, but the fix doesn’t seem to work in my case.
Here is the code for my tools:
class GetDashboardsTool(private val dashboardUseCase: IGetDashboard) :
Tool<Unit, DashboardsResultConvert>() {
override val argsSerializer: KSerializer<Unit>
get() = Unit.serializer()
override val description: String
get() = "provide all dashboards belong to account"
override val resultSerializer: KSerializer<DashboardsResultConvert>
get() = DashboardsResultConvert.serializer()
override suspend fun execute(args: Unit): DashboardsResultConvert {
return kotlin.runCatching {
dashboardUseCase.invoke().getResultOrNull()
}.fold(onFailure = {
DashboardsResultConvert(error = it.message.orEmpty(), listOf())
}, onSuccess = {
DashboardsResultConvert(dashboard = it?.dashboard ?: listOf(), error = "")
})
}
}
model config:
object GptOss20BModel : LLModelDefinitions {
public val GptOssModel: LLModel = LLModel(
provider = LLMProvider.OpenRouter,
id = "openai/gpt-oss-20b:free",
capabilities = listOf(
LLMCapability.Temperature,
LLMCapability.Speculation,
LLMCapability.Tools,
LLMCapability.Completion,
) + listOf(
LLMCapability.Schema.JSON.Standard,
LLMCapability.ToolChoice
),
contextLength = 131_072,
maxOutputTokens = 32_768,
)
}
Please correct me if i have any miss take.
Koog version: 0.5.3Sergey Y.
12/02/2025, 4:33 PMSergey Y.
12/02/2025, 4:38 PMSergey Y.
12/02/2025, 4:49 PMtung
12/02/2025, 4:51 PMtung
12/02/2025, 4:56 PMSergey Y.
12/02/2025, 5:02 PMSergey Y.
12/02/2025, 5:06 PMAntonii Belyshev
12/02/2025, 7:23 PMarguments field likely means that the model returned a json like
{ tool: "tool_name" }
without "arguments" field at all. However, to call a tool with no arguments, the model is expected to return a json similar to
{ tool: "tool_name", arguments: {} }
with an empty arguments parameter. I think, it could be possible to catch and fix such errors. I am working to add a general component for fixing json errors in tool calls, and I will consider including a specific fix for this particular casetung
12/10/2025, 1:54 PMException during executing subgraph 'clarifyUserQuestion': Unexpected JSON token at offset 741: Expected beginning of the string, but got { at path: $.choices[0].error.metadata['raw'] (Ask Gemini)
JSON input: .....,"code":502,"metadata":{"raw":{"message":"Hyperfusion.Servic.....kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 741: Expected beginning of the string, but got { at path: $.choices[0].error.metadata['raw']
JSON input: .....,"code":502,"metadata":{"raw":{"message":"Hyperfusion.Servic.....
at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:587)
at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:585)
at kotlinx.serialization.json.internal.AbstractJsonLexer.consumeStringLenient(AbstractJsonLexer.kt:453)
at kotlinx.serialization.json.internal.AbstractJsonLexer.consumeStringLenientNotNull(AbstractJsonLexer.kt:425)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeString(StreamingJsonDecoder.kt:338)
at kotlinx.serialization.internal.StringSerializer.deserialize(Primitives.kt:131)
at kotlinx.serialization.internal.StringSerializer.deserialize(Primitives.kt:127)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
at kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement$default(Decoding.kt:539)
at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:111)
at kotlinx.serialization.internal.MapLikeSerializer.readElement(CollectionSerializers.kt:84)
at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:78)
at ai.koog.prompt.executor.clients.openrouter.models.ErrorResponse$$serializer.deserialize(OpenRouterChatCompletion.kt:145)
at ai.koog.prompt.executor.clients.openrouter.models.ErrorResponse$$serializer.deserialize(OpenRouterChatCompletion.kt:145)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:78)
at ai.koog.prompt.executor.clients.openrouter.models.OpenRouterChoice$$serializer.deserialize(OpenRouterChatCompletion.kt:95)
at ai.koog.prompt.executor.clients.openrouter.models.OpenRouterChoice$$serializer.deserialize(OpenRouterChatCompletion.kt:95)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
2025-12-10 19:52:23.489 9253-9253 a.k.a.c.a....ntSubgraph E at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168) (Ask Gemini)
at kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement$default(Decoding.kt:539)
at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80)
at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
at ai.koog.prompt.executor.clients.openrouter.models.OpenRouterChatCompletionResponse$$serializer.deserialize(OpenRouterChatCompletion.kt:156)
at ai.koog.prompt.executor.clients.openrouter.models.OpenRouterChatCompletionResponse$$serializer.deserialize(OpenRouterChatCompletion.kt:156)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.json.Json.decodeFromString(Json.kt:149)
at ai.koog.prompt.executor.clients.openrouter.OpenRouterLLMClient.decodeResponse(OpenRouterLLMClient.kt:181)
at ai.koog.prompt.executor.clients.openrouter.OpenRouterLLMClient.decodeResponse(OpenRouterLLMClient.kt:51)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.getResponse(AbstractOpenAILLMClient.kt:252)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.access$getResponse(AbstractOpenAILLMClient.kt:89)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient$getResponse$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loopOnce(Looper.java:248)
at android.os.Looper.loop(Looper.java:338)
at android.app.ActivityThread.main(ActivityThread.java:9067)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)tung
12/10/2025, 1:55 PM{
"id": "gen-1765372428-79CQvojxQA9JEwFK3HhT",
"provider": "NCompass",
"model": "qwen/qwen3-30b-a3b",
"object": "chat.completion",
"created": 1765372428,
"choices": [
{
"error": {
"message": "Upstream error from NCompass: Hyperfusion.ServiceUnavailableError: litellm.MidStreamFallbackError: Hyperfusion.APIConnectionError: APIConnectionError: OpenAIException - list index out of range. Received Model Group=qwen/qwen3-30b-a3b\nAvailable Model Group Fallbacks=None",
"code": 502,
"metadata": {
"raw": {
"message": "Hyperfusion.ServiceUnavailableError: litellm.MidStreamFallbackError: Hyperfusion.APIConnectionError: APIConnectionError: OpenAIException - list index out of range. Received Model Group=qwen/qwen3-30b-a3b\nAvailable Model Group Fallbacks=None",
"type": null,
"param": null,
"code": "503"
},
"provider_name": "NCompass"
}
},
"logprobs": null,
"finish_reason": null,
"native_finish_reason": null,
"index": 0,
"message": {
"role": "assistant",
"content": "",
"refusal": null,
"reasoning": "\nOkay, the user said \"hi, give me all dashboards.\"....",
"reasoning_details": [
{
"format": "unknown",
"index": 0,
"type": "reasoning.text",
"text": "\nOkay, the user said \"hi, give me all dashboards.\" ...."
}
]
}
}
],
"usage": {
"prompt_tokens": 582,
"completion_tokens": 535,
"total_tokens": 1117,
"cost": 0.00019636,
"is_byok": false,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0,
"video_tokens": 0
},
"cost_details": {
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.00004656,
"upstream_inference_completions_cost": 0.0001498
},
"completion_tokens_details": {
"reasoning_tokens": 535,
"image_tokens": 0
}
}
}