fix(anthropic-auto-compact): run DCP only on compaction failure and retry after pruning (#284)

Make DCP behavior opt-in via new 'dcp_on_compaction_failure' experimental flag (disabled by default).

When enabled, Dynamic Context Pruning only executes after summarization fails, then retries compaction. By default, DCP runs before truncation as before.

Changes:
- Add 'dcp_on_compaction_failure' boolean flag to experimental config (default: false)
- Update executor.ts to check flag before running DCP behavior
- Add corresponding documentation to all 4 README files (EN, KO, JA, ZH-CN)
- Update JSON schema

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-28 00:43:37 +09:00
committed by GitHub
parent 3e180cd9f1
commit c4c0d82f97
10 changed files with 102 additions and 39 deletions

View File

@@ -846,7 +846,8 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
"experimental": {
"aggressive_truncation": true,
"auto_resume": true,
"truncate_all_tool_outputs": false
"truncate_all_tool_outputs": false,
"dcp_on_compaction_failure": true
}
}
```
@@ -856,6 +857,7 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
| `aggressive_truncation` | `false` | 超出 token 限制时,激进地截断工具输出以适应限制。比默认截断更激进。不够的话会回退到摘要/恢复。 |
| `auto_resume` | `false` | 从 thinking block 错误或 thinking disabled violation 成功恢复后,自动恢复会话。提取最后一条用户消息继续执行。 |
| `truncate_all_tool_outputs` | `true` | 为防止提示过长,根据上下文窗口使用情况动态截断所有工具输出。如需完整工具输出,设置为 `false` 禁用此功能。 |
| `dcp_on_compaction_failure` | `false` | 启用后DCP动态上下文剪枝仅在压缩摘要失败后运行然后重试压缩。平时 DCP 不会运行。当达到 token 限制时需要更智能的恢复请启用此选项。 |
**警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。