Loading...
Loading...
Compare original and translation side by side
[Obs:{ref_id} elided. Key: {summary}. Full content retrievable.][Obs:{ref_id} 已省略。关键信息: {summary}。可检索完整内容。]| Context Composition | First Action | Second Action |
|---|---|---|
| Tool outputs dominate (>50%) | Observation masking | Compaction of remaining turns |
| Retrieved documents dominate | Summarization | Partitioning if docs are independent |
| Message history dominates | Compaction with selective preservation | Partitioning for new subtasks |
| Multiple components contribute | KV-cache optimization first, then layer masking + compaction | |
| Near-limit with active debugging | Mask resolved tool outputs only — preserve error details |
| 上下文构成 | 首要操作 | 次要操作 |
|---|---|---|
| 工具输出占主导(>50%) | 观察掩码 | 压缩剩余对话轮次 |
| 检索文档占主导 | 总结 | 若文档独立则进行分区 |
| 消息历史占主导 | 选择性保留的压缩 | 为新子任务进行分区 |
| 多组件共同影响 | 先进行KV-cache优化,再叠加掩码+压缩 | |
| 接近限制且正在调试 | 仅掩码已解决的工具输出——保留错误细节 |
if context_tokens / context_limit > 0.8:
context = compact_context(context)if len(observation) > max_length:
ref_id = store_observation(observation)
return f"[Obs:{ref_id} elided. Key: {extract_key(observation)}]"undefinedif context_tokens / context_limit > 0.8:
context = compact_context(context)if len(observation) > max_length:
ref_id = store_observation(observation)
return f"[Obs:{ref_id} 已省略。关键信息: {extract_key(observation)}]"undefinedundefinedundefinedCurrent date: {today}Current date: {today}