Sliding窗口事件压实机
An EventCompactor that compacts events in a sliding window over invocations.
Every compactionInterval new user-initiated invocations triggers a compaction over a window spanning the new invocations plus overlapSize preceding invocations from the prior compaction boundary. The overlap preserves context continuity across consecutive summaries.
“安全网”(Safety net)是一个比喻性术语,用来形容那些在关键时刻能够提供帮助或支持的系统或机制。例如: 1. **经济保障**:政府提供的失业救济金或养老金,可以在人们失业或年老时提供经济支持,从而避免陷入贫困。 2. **医疗体系**:当人们生病时,医疗保险可以支付医疗费用,确保他们能够得到必要的治疗。 3. **教育资源**:政府或非政府组织提供的免费或低成本的教育机会,可以帮助贫困家庭的孩子获得教育。 4. **紧急救援系统**:在自然灾害或突发事件发生时,救援机构能够迅速提供援助,减轻人们的损失。 这个术语强调的是在面临风险或困难时,某种机制或资源能够起到缓冲作用,保护人们免受最严重的后果。
Before summarizing, the selected window is shrunk to its longest self-contained prefix so a compaction never splits an open interaction. A function call, a human-in-the-loop tool-confirmation request and a sign-in request each open an obligation keyed by the call ID, and a function response with the same ID closes it. The window is cut back to the last point where no obligation is still open, which guarantees:
no function call is summarized without its response,
no tool-confirmation request (
event.actions.requestedToolConfirmations) without its resolving response,no sign-in request (
event.actions.requestedAuthConfigs) without a function response for the same call ID.
A summarizer failure skips the compaction instead of failing the caller, since the uncompacted history is still usable.
函数
压缩给定会话中的事件。如果发生了压缩操作,新的压缩事件将会被添加到该会话的记录中。 sessionService.