agetn chat error.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 35/100
Research direction
Start with CustomOpenAILLMClient.decodeResponse and CustomOpenAIChatCompletionResponse in CustomOpenAIChatCompletion.kt, where the server-sent data: prefix reaches kotlinx.serialization and causes decoding to fail. Reproduce the failing chat response, then determine how the response stream should be separated from JSON payloads before decoding. The issue is done when prefixed streaming data is decoded successfully and a regression test covers the reported response format.
Written by the indexing model from the issue text.
Description
What happened?
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the object '{', but had 'd' instead at path: $
JSON input: data: {"id":"chatcmpl-DPTokSFW.....
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:588)
at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:586)
at kotlinx.serialization.json.internal.AbstractJsonLexer.unexpectedToken(AbstractJsonLexer.kt:790)
at kotlinx.serialization.json.internal.StringJsonLexer.consumeNextToken(StringJsonLexer.kt:74)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.beginStructure(StreamingJsonDecoder.kt:102)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAIChatCompletionResponse$$serializer.deserialize(CustomOpenAIChatCompletion.kt:131)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAIChatCompletionResponse$$serializer.deserialize(CustomOpenAIChatCompletion.kt:131)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.json.Json.decodeFromString(Json.kt:149)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAILLMClient.decodeResponse(CustomOpenAILLMClient.kt:687)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAILLMClient.decodeResponse(CustomOpenAILLMClient.kt:65)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.getResponse(AbstractOpenAILLMClient.kt:261)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.access$getResponse(AbstractOpenAILLMClient.kt:81)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient$getResponse$1.invokeSuspend(AbstractOpenAILLMClient.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:277)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:101)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:47)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:130)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:1188)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
Relevant log output or stack trace
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the object '{', but had 'd' instead at path: $
JSON input: data: {"id":"chatcmpl-DPTokSFW.....
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:588)
at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:586)
at kotlinx.serialization.json.internal.AbstractJsonLexer.unexpectedToken(AbstractJsonLexer.kt:790)
at kotlinx.serialization.json.internal.StringJsonLexer.consumeNextToken(StringJsonLexer.kt:74)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.beginStructure(StreamingJsonDecoder.kt:102)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAIChatCompletionResponse$$serializer.deserialize(CustomOpenAIChatCompletion.kt:131)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAIChatCompletionResponse$$serializer.deserialize(CustomOpenAIChatCompletion.kt:131)
at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
at kotlinx.serialization.json.Json.decodeFromString(Json.kt:149)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAILLMClient.decodeResponse(CustomOpenAILLMClient.kt:687)
at ee.carlrobert.codegpt.agent.clients.CustomOpenAILLMClient.decodeResponse(CustomOpenAILLMClient.kt:65)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.getResponse(AbstractOpenAILLMClient.kt:261)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient.access$getResponse(AbstractOpenAILLMClient.kt:81)
at ai.koog.prompt.executor.clients.openai.base.AbstractOpenAILLMClient$getResponse$1.invokeSuspend(AbstractOpenAILLMClient.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:277)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:101)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:47)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:130)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:1188)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
Steps to reproduce
No response
CodeGPT version
latest
Operating System
None
- Dominant language
- Kotlin
- Stars
- 1.9k
- Forks
- 401
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from carlrobertoh/ProxyAI
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1250 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
carlrobertoh/ProxyAI#1233 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1203 · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
carlrobertoh/ProxyAI#1160 · 2 reactions ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlrobertoh/ProxyAI#1068 ·
All issues in carlrobertoh/ProxyAI
Similar issues
-
Location search keeps showing stale "Open-Meteo can't find ..." message after clearing search queryOpenBug Needs review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
breezy-weather/breezy-weather#3082 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
wangzan101/Mika#1033 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
commons-app/apps-android-commons#7486 ·
Maintainers usually reply within 1 day
-
area: ci area: local-media area: startup area: ui platform: bilibili platform: netease platform: youtube status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cwuom/NeriPlayer#794 ·
Maintainers usually reply within 1 day
-
area:android area:ui bug priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
meraxes89/streamify-apk#449 ·
Maintainers usually reply within 1 day