[GH-ISSUE #90] Hermes Agent HTTP 400: prompt (70527 tokens) + max tokens (65536) exceeds the context (131072) #49

Closed
opened 2026-11-04 01:39:19 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @technerd-official on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/90

Strata v0.1.20
Windows 10, i7-6700K 4Ghz, 64GB DDR4 system ram, single RTX 3090 (24GB VRAM), SATA6 SSD.
trying to run Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS (71GB)
(Via Unsloth Studio same model runs perfectly well but only with 11 tok/s on my system)

Connecting via Hermes agent works but still some hiccups!
In Hermes Im getting 50-60 tok/s unbelievable but I run into the next problem below:

Hermes stops after using some tool calls and complains that too little context is available even though 131072 are set within Strata. Seems like another bug. I cant get past this Hermes error after a couple of minutes:

HTTP 400: prompt (70527 tokens) + max tokens (65536) exceeds the context (131072); requests are never truncated
After that I cant get it to work anymore and I have to start a new session this is a huge PITA. I know that Hermes needs a minimum context of 65536 to work but Strata is set already to 131072 so what is wrong?

Also while looking at the Strata console while it's working with Hermes it says:
"[strata] thinking: 316 of max 65536 tokens," why isn't it 131072 ???

Originally created by @technerd-official on GitHub (Sep 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/90 Strata v0.1.20 Windows 10, i7-6700K 4Ghz, 64GB DDR4 system ram, single RTX 3090 (24GB VRAM), SATA6 SSD. trying to run Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS (71GB) (Via Unsloth Studio same model runs perfectly well but only with 11 tok/s on my system) Connecting via Hermes agent works but still some hiccups! In Hermes Im getting 50-60 tok/s unbelievable but I run into the next problem below: Hermes stops after using some tool calls and complains that too little context is available even though 131072 are set within Strata. Seems like another bug. I cant get past this Hermes error after a couple of minutes: **HTTP 400: prompt (70527 tokens) + max tokens (65536) exceeds the context (131072); requests are never truncated** After that I cant get it to work anymore and I have to start a new session this is a huge PITA. I know that Hermes needs a minimum context of 65536 to work but Strata is set already to 131072 so what is wrong? Also while looking at the Strata console while it's working with Hermes it says: **"[strata] thinking: 316 of max 65536 tokens,"** why isn't it 131072 ???
Author
Owner

@tdavis-hub commented on GitHub (Sep 28, 2026):

Re-run the bat or sh file (Windows or Linux) with --setup and select the right context for Strata. Then verify Hermes has the same context window. Also there were several updates today. Run a fresh git pull to make sure you are on the most recent version. I had the same bug earlier today in 0.12 or 0.13 I think. Update and --setup fixed it.

<!-- gh-comment-id:5879485793 --> @tdavis-hub commented on GitHub (Sep 28, 2026): Re-run the bat or sh file (Windows or Linux) with --setup and select the right context for Strata. Then verify Hermes has the same context window. Also there were several updates today. Run a fresh git pull to make sure you are on the most recent version. I had the same bug earlier today in 0.12 or 0.13 I think. Update and --setup fixed it.
Author
Owner

@technerd-official commented on GitHub (Sep 28, 2026):

Re-run the bat or sh file (Windows or Linux) with --setup and select the right context for Strata. Then verify Hermes has the same context window. Also there were several updates today. Run a fresh git pull to make sure you are on the most recent version. I had the same bug earlier today in 0.12 or 0.13 I think. Update and --setup fixed it.

Thanks but I did it already "start-here --setup" Im on newest version "Strata v0.1.20". Context in Strata is set to "131072" and also in Hermes but it still getting this error. Im pulling my hair out. Asked Ai what to do but Im running in circles.

<!-- gh-comment-id:5879921233 --> @technerd-official commented on GitHub (Sep 28, 2026): > Re-run the bat or sh file (Windows or Linux) with --setup and select the right context for Strata. Then verify Hermes has the same context window. Also there were several updates today. Run a fresh git pull to make sure you are on the most recent version. I had the same bug earlier today in 0.12 or 0.13 I think. Update and --setup fixed it. Thanks but I did it already "start-here --setup" Im on newest version "Strata v0.1.20". Context in Strata is set to "131072" and also in Hermes but it still getting this error. Im pulling my hair out. Asked Ai what to do but Im running in circles.
Author
Owner

@uvhat commented on GitHub (Sep 28, 2026):

This occurs if model try to read large files and "max output token" is too large. This is usual issue for qwen 3.8 even with usual llama.cpp or unsloth studio.

You should reduce max output token length for answer, ~8144...16000 for example, and set in rules process files by chunks. Also use context compact, 3.8 qwen is very context-eater thing. Don't try to use very large context window for single answer - it will try to flood this by files reads and thoughts without care about full 256k context window.

this is like:

[first thoughts 1k][-----------------------------------try to read or write many files 256k tokens--------------------------------------] excess of context
[---------------------------------------256k max output tokens-----------------------------------------]
[-----------------------------------------256k context----------------------------------------------------]

change it to smaller max output tokens and set in rules read by small chunks

[first th 1k][---read files 8k--]
[-8k max output tokens-]
[-----------------------------------------256k context----------------------------------------------------]

and with auto context compact it will try to free context and summarize old tokens before full context reached

<!-- gh-comment-id:5880253727 --> @uvhat commented on GitHub (Sep 28, 2026): This occurs if model try to read large files and "max output token" is too large. This is usual issue for qwen 3.8 even with usual llama.cpp or unsloth studio. You should reduce max output token length for answer, ~8144...16000 for example, and set in rules process files by chunks. Also use context compact, 3.8 qwen is very context-eater thing. Don't try to use very large context window for single answer - it will try to flood this by files reads and thoughts without care about full 256k context window. this is like: [first thoughts 1k][-----------------------------------try to read or write many files 256k tokens--------------------------------------] excess of context [---------------------------------------256k max output tokens-----------------------------------------] [-----------------------------------------256k context----------------------------------------------------] change it to smaller max output tokens and set in rules read by small chunks [first th 1k][---read files 8k--] [-8k max output tokens-] [-----------------------------------------256k context----------------------------------------------------] and with auto context compact it will try to free context and summarize old tokens before full context reached
Author
Owner

@technerd-official commented on GitHub (Sep 28, 2026):

this occurs if model try to read large files. You should reduce max output token length for answer, ~8144...16000 for example, and set in rules process files by chunks. Also use context compact, 3.8 qwen is very context-eater thing. Don't try to use very large context window for single answer - it will try to flood this by files reads and thoughts without care about full 256k context window.

How to reduce max output token length correctly? Tried to change the flags in "strata-iq3_xxs.json" but it didn't worked.
I've reduced it to 8192 but it doesnt take it into account. I added --max-new and 8192

"--max-context",
"131072",
"--max-new",
"8192",

<!-- gh-comment-id:5880350449 --> @technerd-official commented on GitHub (Sep 28, 2026): > this occurs if model try to read large files. You should reduce max output token length for answer, ~8144...16000 for example, and set in rules process files by chunks. Also use context compact, 3.8 qwen is very context-eater thing. Don't try to use very large context window for single answer - it will try to flood this by files reads and thoughts without care about full 256k context window. How to reduce max output token length correctly? Tried to change the flags in "strata-iq3_xxs.json" but it didn't worked. I've reduced it to 8192 but it doesnt take it into account. I added --max-new and 8192 "--max-context", "131072", "--max-new", "8192",
Author
Owner

@uvhat commented on GitHub (Sep 28, 2026):

this settings should be in your harness or agent settings.

try something simple for first, cline in vscode for example. setup Auto Compact enabled, set max tokens 8144, set model context length 131072 as you used on setup. Then find how to reduce max tokens in Hermes

<!-- gh-comment-id:5880372121 --> @uvhat commented on GitHub (Sep 28, 2026): this settings should be in your harness or agent settings. try something simple for first, cline in vscode for example. setup Auto Compact enabled, set max tokens 8144, set model context length 131072 as you used on setup. Then find how to reduce max tokens in Hermes
Author
Owner

@technerd-official commented on GitHub (Sep 29, 2026):

Just updated to newest Hermes Agent version "v0.21.5" and it works now! Issue is closed!

<!-- gh-comment-id:5881365159 --> @technerd-official commented on GitHub (Sep 29, 2026): Just updated to newest Hermes Agent version "v0.21.5" and it works now! Issue is closed!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#49
No description provided.