Required array length 2147483644 + 12 is too large
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Describe the bug
#error {
:cause :eca/chat-query-context 0ms
Required array length 2147483644 + 12 is too large
:via
[{:type java.lang.OutOfMemoryError
:message Required array length 2147483644 + 12 is too large
:at [jdk.internal.util.ArraysSupport hugeLength ArraysSupport.java 914]}]
:trace
[[jdk.internal.util.ArraysSupport hugeLength ArraysSupport.java 914]
[jdk.internal.util.ArraysSupport newLength ArraysSupport.java 907]
[java.lang.AbstractStringBuilder newCapacity AbstractStringBuilder.java 267]
[java.lang.AbstractStringBuilder ensureCapacityInternal AbstractStringBuilder.java 247]
[java.lang.AbstractStringBuilder append AbstractStringBuilder.java 752]
[java.lang.StringBuffer append StringBuffer.java 410]
[java.io.StringWriter write StringWriter.java 99]
[com.fasterxml.jackson.core.json.WriterBasedJsonGenerator _writeSegment WriterBasedJsonGenerator.java 1205]
[com.fasterxml.jackson.core.json.WriterBasedJsonGenerator _writeLongString WriterBasedJsonGenerator.java 1162]
[com.fasterxml.jackson.core.json.WriterBasedJsonGenerator _writeString WriterBasedJsonGenerator.java 1083]
[com.fasterxml.jackson.core.json.WriterBasedJsonGenerator writeString WriterBasedJsonGenerator.java 435]
[cheshire.generate$generate invokeStatic generate.clj 139]
[cheshire.generate$generate invoke generate.clj 119]
[cheshire.generate$generate$fn__1154 invoke generate.clj 125]
[clojure.core.protocols$iterator_reduce_BANG_ invokeStatic protocols.clj 42]
[clojure.core.protocols$iter_reduce invokeStatic protocols.clj 52]
[clojure.core.protocols$fn__8260 invokeStatic protocols.clj 74]
[clojure.core.protocols$fn__8260 invoke protocols.clj 74]
[clojure.core.protocols$fn__8207$G__8202__8220 invoke protocols.clj 13]
[clojure.core$reduce invokeStatic core.clj 6965]
[clojure.core$reduce invoke core.clj 6947]
[cheshire.generate$generate invokeStatic generate.clj 125]
[cheshire.generate$generate invoke generate.clj 119]
[cheshire.generate$generate$fn__1163 invoke generate.clj 127]
[clojure.lang.PersistentVector reduce PersistentVector.java 418]
[clojure.core$reduce invokeStatic core.clj 6964]
[clojure.core$reduce invoke core.clj 6947]
[cheshire.generate$generate invokeStatic generate.clj 127]
[cheshire.generate$generate invoke generate.clj 119]
[cheshire.generate$generate$fn__1154 invoke generate.clj 125]
[clojure.core.protocols$iterator_reduce_BANG_ invokeStatic protocols.clj 42]
[clojure.core.protocols$iter_reduce invokeStatic protocols.clj 52]
[clojure.core.protocols$fn__8260 invokeStatic protocols.clj 74]
[clojure.core.protocols$fn__8260 invoke protocols.clj 74]
[clojure.core.protocols$fn__8207$G__8202__8220 invoke protocols.clj 13]
[clojure.core$reduce invokeStatic core.clj 6965]
[clojure.core$reduce invoke core.clj 6947]
[cheshire.generate$generate invokeStatic generate.clj 125]
[cheshire.generate$generate invoke generate.clj 119]
[cheshire.core$generate_string invokeStatic core.clj 76]
[cheshire.core$generate_string invoke core.clj 49]
[cheshire.core$generate_string invokeStatic core.clj 55]
[cheshire.core$generate_string invoke core.clj 49]
[eca.llm_providers.openai_chat$base_request_BANG_ invokeStatic openai_chat.clj 68]
[eca.llm_providers.openai_chat$base_request_BANG_ invoke openai_chat.clj 60]
[eca.llm_providers.openai_chat$completion_BANG_ invokeStatic openai_chat.clj 422]
[eca.llm_providers.openai_chat$completion_BANG_ invoke openai_chat.clj 263]
[eca.llm_api$complete_BANG_ invokeStatic llm_api.clj 215]
[eca.llm_api$complete_BANG_ invoke llm_api.clj 69]
[eca.features.chat$prompt_messages_BANG_ invokeStatic chat.clj 532]
[eca.features.chat$prompt_messages_BANG_ invoke chat.clj 493]
[eca.features.chat$prompt invokeStatic chat.clj 902]
[eca.features.chat$prompt invoke chat.clj 840]
[eca.handlers$chat_prompt invokeStatic handlers.clj 98]
[eca.handlers$chat_prompt invoke handlers.clj 94]
[eca.server$fn__16207 invokeStatic server.clj 48]
[eca.server$fn__16207 invoke server.clj 47]
[clojure.lang.MultiFn invoke MultiFn.java 239]
[jsonrpc4clj.server$pending_received_request invokeStatic server.clj 182]
[jsonrpc4clj.server$pending_received_request invoke server.clj 178]
[jsonrpc4clj.server.ChanServer receive_request server.clj 377]
[jsonrpc4clj.server.ChanServer$fn__15692 invoke server.clj 262]
[jsonrpc4clj.server$thread_loop$fn__15607 invoke server.clj 123]
[clojure.lang.AFn applyToHelper AFn.java 152]
[clojure.lang.AFn applyTo AFn.java 144]
[clojure.core$apply invokeStatic core.clj 667]
[clojure.core$with_bindings_STAR_ invokeStatic core.clj 1990]
[clojure.core$with_bindings_STAR_ doInvoke core.clj 1990]
[clojure.lang.RestFn invoke RestFn.java 428]
[clojure.lang.AFn applyToHelper AFn.java 156]
[clojure.lang.RestFn applyTo RestFn.java 135]
[clojure.core$apply invokeStatic core.clj 671]
[clojure.core$bound_fn_STAR_$fn__5839 doInvoke core.clj 2020]
[clojure.lang.RestFn invoke RestFn.java 400]
[clojure.core.async$thread_call$returning_to_chan__11524$fn__11525 invoke async.clj 509]
[clojure.lang.AFn run AFn.java 22]
[java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1095]
[java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 619]
[java.lang.Thread runWith Thread.java 1460]
[java.lang.Thread run Thread.java 1447]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine PlatformThreads.java 832]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine PlatformThreads.java 808]]} Error receiving message: Internal error (-32603)
{:id 9, :method "chat/prompt"}
To Reproduce Steps to reproduce the behavior:
- Use eca in agent-mode with VSCode extension.
- Ask it to refactor some code, providing the repository directory as context via
@.
Expected behavior I expected the request to be processed by eca without error.
Doctor
ECA version: 0.68.0
Server cmd: /home/rmoeritz/.vscode/extensions/editor-code-assistant.eca-0.28.1/eca server
Default model: openrouter/qwen/qwen3-coder
Login providers:
anthropic: {}
azure: {}
deepseek: {}
github-copilot: {}
google: {}
openai: {}
openrouter: {}
z-ai: {}
Relevant env vars:
Credential files: None found (GPG available: true)
Additional context eca config:
{
"defaultModel": "openrouter/qwen/qwen3-coder",
"providers": {
"openrouter": {
"api": "openai-chat",
"url": "https://openrouter.ai/api/v1",
"key": "<removed>",
"models": {
"qwen/qwen3-coder": {}
}
}
}
}
@rmoeritz-alayacare I will check if we can improve the error message, but if your folder is huge it won't make any difference. But I just want to understand your use case, what folder are you adding to context? why not leave LLM find via tools the files that need to be changed? also project root is already available so no need to do anything else
You can check the prompt sent via /prompt-show as well, I believe you are sending a huge prompt to LLM
why not leave LLM find via tools the files that need to be changed? also project root is already available so no need to do anything else
Ah, I wasn't aware that the project root is already available. Thanks, will try without explicitly adding folders as context & see if that helps.
You can check the prompt sent via
/prompt-showas well, I believe you are sending a huge prompt to LLM
No, that's not it. My prompt was maybe 3 sentences. The issue was probably that it found many files (.git sub-directory?).
also project root is already available so no need to do anything else
Yeah, that seems to have resolved it. Only thing is that the model will announce that it's going to do something ("Now let me check the data directory") and then... nothing! (The last log entry will be :db/upsert-cache 1ms) I wonder if it's waiting for confirmation from me (but I don't see a prompt anywhere 🤔 ).
No, that's not it. My prompt was maybe 3 sentences. The issue was probably that it found many files (.git sub-directory?).
/prompt/show show what goes into final prompt, including contexts if you included dirs, that's why I mentioned that
and then... nothing!
Can you show a screenshot of what looks like? read-only tools are approved by default