Update context management for MiroThinker v1.5 #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MiroThinker v1.5 Context Management Strategy
MiroThinker v1.5 employs a two-layer context management mechanism, each addressing different dimensions of context challenges.
Overview
keep_tool_resultcontext_compress_limitLayer 1:
keep_tool_result- Recency-based Context RetentionCore Problem
Traditional ReAct stuffs all tool outputs into the message history, leading to:
Solution
keep_tool_result = Kkeep_tool_result = -1Benefits
Layer 2:
context_compress_limit- Context CompressionCore Problem
Even with
keep_tool_resulttrimming, a single attempt may still fail to complete the task due to:Solution
context_compress_limit = 0context_compress_limit = NRelation to DeepSeek V3.2's "Discard-all" Strategy
This mechanism is conceptually similar to DeepSeek V3.2's "Discard-all" strategy, which resets the context by discarding all previous tool call history. Both approaches share the same core insight:
How It Works
When a task is not completed within the given turns and context window:
Step 1: Generate Failure Experience Summary (context compression)
Compress conversation history into ~500-1000 tokens structured summary containing:
incomplete/blocked/misdirected/format_missedincomplete: ran out of turns before finishingblocked: got stuck due to tool failure or missing informationmisdirected: went down the wrong pathformat_missed: found the answer but forgot to use\boxed{}Step 2: Inject Summary on Retry
How the Two Layers Work Together