Experimental Features
Early access to cutting-edge capabilities
Experimental Features
Preemptive Compaction Threshold
Option: preemptive_compaction_threshold
Default: 0.85
Type: number (0.5-0.95)
Threshold percentage to trigger preemptive compaction. The preemptive-compaction hook is enabled by default; this option customizes the threshold at which compaction is triggered.
How It Works
When context window usage reaches the specified threshold (default 85%), preemptive compaction automatically runs to reduce context size before hitting hard limits. This prevents errors and ensures smooth operation.
Configuration
{
"experimental": {
"preemptive_compaction_threshold": 0.85
}
}
Recommended Values
- 0.75-0.80 - More aggressive, compacts earlier
- 0.85 - Default, balanced approach
- 0.90-0.95 - Less aggressive, compacts later
Truncate All Tool Outputs
Option: truncate_all_tool_outputs
Default: false
Type: boolean
Truncates ALL tool outputs instead of just whitelisted tools (Grep, Glob, LSP, AST-grep). The tool output truncator is enabled by default - disable via disabled_hooks.
How It Works
By default, only outputs from specific tools (Grep, Glob, LSP, AST-grep) are truncated. When this option is enabled, outputs from all tools are truncated when they exceed size limits.
Configuration
{
"experimental": {
"truncate_all_tool_outputs": true
}
}
Aggressive Truncation
Option: aggressive_truncation
Default: false
Type: boolean
When token limit is exceeded, aggressively truncates tool outputs to fit within limits. More aggressive than the default truncation behavior. Falls back to summarize/revert if insufficient.
How It Works
When enabled, this feature uses more aggressive truncation strategies when the token limit is exceeded. If truncation alone isn't sufficient, it will attempt to summarize content or revert changes.
Configuration
{
"experimental": {
"aggressive_truncation": true
}
}
Auto Resume
Option: auto_resume
Default: false
Type: boolean
Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues.
How It Works
When a session encounters a thinking block error or thinking disabled violation, and recovery is successful, this feature automatically extracts the last user message and continues the session without manual intervention.
Configuration
{
"experimental": {
"auto_resume": true
}
}
Use Cases
- Long-running sessions that may encounter thinking block errors
- Automated workflows where manual intervention isn't possible
- Scenarios where session continuity is critical
DCP for Compaction
Option: dcp_for_compaction
Default: false
Type: boolean
Enable DCP (Dynamic Context Pruning) for compaction - runs first when token limit exceeded. Prunes duplicate tool calls and old tool outputs before running compaction.
How It Works
DCP (Dynamic Context Pruning) analyzes the context and removes duplicate tool calls and old tool outputs before running standard compaction. This can be more efficient than compaction alone.
Configuration
{
"experimental": {
"dcp_for_compaction": true
}
}
Benefits
- More efficient context reduction
- Preserves important information better
- Faster than standard compaction in some cases
Complete Configuration Example
Here's an example configuration with all experimental features:
{
"experimental": {
"preemptive_compaction_threshold": 0.85,
"truncate_all_tool_outputs": false,
"aggressive_truncation": false,
"auto_resume": false,
"dcp_for_compaction": false
}
}
Configuration Locations
~/.config/opencode/oh-my-opencode.json- User-wide.opencode/oh-my-opencode.json- Project-specific
Best Practices
- Start with defaults - Most users don't need experimental features. Only enable if you have specific requirements.
- Enable one at a time - Test each feature individually to understand its impact.
- Monitor behavior - Watch for unexpected behavior when using experimental features.
- Report issues - If you encounter problems, report them on GitHub.
- Stay updated - Experimental features may change between versions.
Feature Status
Experimental features may:
- Be promoted to stable features in future versions
- Be modified or removed based on feedback
- Have breaking changes without notice
- Have limited documentation
Check the GitHub repository for the latest status of experimental features.