strong-ice-84145
12/03/2025, 3:09 PMagent starts -> tool_call_0 -> output_0_super_big -> .... -> step 15: condensation -> steps 16 ... -> ... In that case the 15 first steps might suffer from output_0_super_big .wide-doctor-37830
12/03/2025, 3:44 PMmax_message_chars attribute that is used to set an upper bound on the number of characters used when serializing events. Most of the logic happens in ConversationMemory via calls to truncate_content (see here).
2. Some condensers work event-by-event instead of across a chunk of the history. These two condensers are used to mask out large observations once enough events have been processed.
AFAICT, neither of these mechanisms have made it intact to v1. The max_message_chars field exists (here) but doesn't seem to be plumbed up anywhere, and the condensers were deliberately not ported because they weren't used or caused bigger problems.
For example, the browser output condenser gave me headaches for a few weeks because it would replace the browsing data (which was far-and-above the largest kind of event at the time) with the URL of the page visited. But the agent wanted the full contents of several pages open at once, so it would open page A then page B then page C then page A would be condensed and the agent would open it again because it wanted all the content laid out before it but then page B was condensed and now we're stuck in a loop.
Solid idea if we can actually detect those useful tokens in the output. And somewhat orthogonally it'd be good to have more token-aware condensation patterns, instead of relying on the number of events to decide when to collapse the context. That might even help avoid the per-model tweaking of condensation parameters we sometimes have to do.curved-angle-80449
12/04/2025, 3:55 PM