<https://openhands-ai.slack.com/archives/C06QT0AGY...
# proj-agent
l
@wide-doctor-37830 any ideas?
w
I don't think we ever evaluated the condenser on models with that small a context window, so I'm afraid I don't have any concrete numbers to recommend. But the condenser will also kick in whenever the context window gets too full so you may not need to alter the configuration any further. The only reason I'd mess with the max history size is if the agent seems to lose track whenever a condensation happens. Lowering the max history size so that the model hits the threshold right before running out of context might help prevent that. The average token count per-event varies wildly based on workload, domain, tools used, so it's tough to predict an exact value.
The token-based condensation configuration was developed as an experimental feature and never exposed in the settings for the CLI or the GUI. I expect the lift to do so is pretty small, although it didn't go through a particularly rigorous analysis so I'm not sure what the correct setting would be there for a 64k model.
@faint-greece-70506 I hope that helps answer some of your questions, but always happy to chat more about solutions if the existing configuration options just aren't working for you.
f
> But the condenser will also kick in whenever the context window gets too full so you may not need to alter the configuration any further. @wide-doctor-37830 Thank you for replying. But I can confirm that the condenser has in some cases not kicked in early enough, and thus causes the LLM backend to stop its output due to hitting context limit. Also, I am able to run models at much higher context length if need be, but the reason I don't is because a lot of them tend to perform worse starting at about 64k. Even OpenAI has acknowleged quality degradation in their cloud models for output above 64k, even for their models capable of 1m context. So I think this should not be dismissed as a case relevant only for those who run on memory-constrained hardware like myself. And I totally agree with you about what you said regarding the amount of tokens per event can vary greatly. That is why this problem exists in the first place. Regardless of how large context size you've loaded your model with, be it cloud or local, they are ultimately limited by tokens, not "events". All other agentic tools I've used have not had any issues like this, because they allow me to condense based on the actual limit: max tokens. If only OpenHands did the same, it would be the perfect agentic tool. But right now it is awesome, yet unusable due to this ambiguous "events" limit.
w
But I can confirm that the condenser has in some cases not kicked in early enough, and thus causes the LLM backend to stop its output due to hitting context limit.
Hmm, I think that might be a genuine bug. The agent is set to condense the entire history whenever the LLM backend reports hitting context window limits, so you shouldn't see any stoppage there. Unfortunately, even though we use LiteLLM to manage all the LLM APIs, they don't report this problem consistently and some cases have undoubtedly slipped through the cracks. Can you share the error you're seeing so we can add it to the detection logic?
I've opened an issue to track the max-tokens config in the GUI: https://github.com/OpenHands/OpenHands/issues/13425