Skip to content

Commit 355f18d

Browse files
revert(dcp-for-compaction): move back to experimental config from hook (#346)
1 parent 048ed36 commit 355f18d

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

README.ja.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
874874
}
875875
```
876876

877-
利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
877+
利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`
878878

879879
**`auto-update-checker``startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks``"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
880880

@@ -938,8 +938,7 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
938938
| `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
939939
| `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
940940
| `truncate_all_tool_outputs` | `true` | プロンプトが長くなりすぎるのを防ぐため、コンテキストウィンドウの使用状況に基づいてすべてのツール出力を動的に切り詰めます。完全なツール出力が必要な場合は`false`に設定して無効化します。 |
941-
942-
**注意**: `dcp-for-compaction`(コンパクション用動的コンテキスト整理)はフックとして管理されるようになりました。デフォルトで有効で、`disabled_hooks: ["dcp-for-compaction"]`で無効化できます。
941+
| `dcp_for_compaction` | `false` | コンパクション用DCP(動的コンテキスト整理)を有効化 - トークン制限超過時に最初に実行されます。コンパクション前に重複したツール呼び出しと古いツール出力を整理します。 |
943942

944943
**警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
945944

README.ko.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ Schema 자동 완성이 지원됩니다:
871871
}
872872
```
873873

874-
사용 가능한 훅: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
874+
사용 가능한 훅: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`
875875

876876
**`auto-update-checker``startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks``"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
877877

@@ -935,8 +935,7 @@ OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.js
935935
| `aggressive_truncation` | `false` | 토큰 제한을 초과하면 도구 출력을 공격적으로 잘라내어 제한 내에 맞춥니다. 기본 truncation보다 더 공격적입니다. 부족하면 요약/복구로 fallback합니다. |
936936
| `auto_resume` | `false` | thinking block 에러나 thinking disabled violation으로부터 성공적으로 복구한 후 자동으로 세션을 재개합니다. 마지막 사용자 메시지를 추출하여 계속합니다. |
937937
| `truncate_all_tool_outputs` | `true` | 프롬프트가 너무 길어지는 것을 방지하기 위해 컨텍스트 윈도우 사용량에 따라 모든 도구 출력을 동적으로 잘라냅니다. 전체 도구 출력이 필요한 경우 `false`로 설정하여 비활성화하세요. |
938-
939-
**참고**: `dcp-for-compaction` (컴팩션용 동적 컨텍스트 정리)은 이제 훅으로 관리됩니다. 기본으로 활성화되어 있으며, `disabled_hooks: ["dcp-for-compaction"]`으로 비활성화할 수 있습니다.
938+
| `dcp_for_compaction` | `false` | 컴팩션용 DCP(동적 컨텍스트 정리) 활성화 - 토큰 제한 초과 시 먼저 실행됩니다. 컴팩션 전에 중복 도구 호출과 오래된 도구 출력을 정리합니다. |
940939

941940
**경고**: 이 기능들은 실험적이며 예상치 못한 동작을 유발할 수 있습니다. 의미를 이해한 경우에만 활성화하세요.
942941

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
910910
}
911911
```
912912

913-
Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`, `dcp-for-compaction`
913+
Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-context-window-limit-recovery`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`, `ralph-loop`
914914

915915
**Note on `auto-update-checker` and `startup-toast`**: The `startup-toast` hook is a sub-feature of `auto-update-checker`. To disable only the startup toast notification while keeping update checking enabled, add `"startup-toast"` to `disabled_hooks`. To disable all update checking features (including the toast), add `"auto-update-checker"` to `disabled_hooks`.
916916

@@ -974,8 +974,7 @@ Opt-in experimental features that may change or be removed in future versions. U
974974
| `aggressive_truncation` | `false` | 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. |
975975
| `auto_resume` | `false` | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
976976
| `truncate_all_tool_outputs` | `true` | Dynamically truncates ALL tool outputs based on context window usage to prevent prompts from becoming too long. Disable by setting to `false` if you need full tool outputs. |
977-
978-
**Note**: `dcp-for-compaction` (Dynamic Context Pruning for compaction) is now a hook, not an experimental feature. It's enabled by default and can be disabled via `disabled_hooks: ["dcp-for-compaction"]`.
977+
| `dcp_for_compaction` | `false` | Enable DCP (Dynamic Context Pruning) for compaction - runs first when token limit exceeded. Prunes duplicate tool calls and old tool outputs before running compaction. |
979978

980979
**Warning**: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.
981980

README.zh-cn.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ Sisyphus Agent 也能自定义:
878878
}
879879
```
880880

881-
可关的 hook:`todo-continuation-enforcer``context-window-monitor``session-recovery``session-notification``comment-checker``grep-output-truncator``tool-output-truncator``directory-agents-injector``directory-readme-injector``empty-task-response-detector``think-mode``anthropic-context-window-limit-recovery``rules-injector``background-notification``auto-update-checker``startup-toast``keyword-detector``agent-usage-reminder``non-interactive-env``interactive-bash-session``empty-message-sanitizer``preemptive-compaction``compaction-context-injector``thinking-block-validator``claude-code-hooks``ralph-loop``dcp-for-compaction`
881+
可关的 hook:`todo-continuation-enforcer``context-window-monitor``session-recovery``session-notification``comment-checker``grep-output-truncator``tool-output-truncator``directory-agents-injector``directory-readme-injector``empty-task-response-detector``think-mode``anthropic-context-window-limit-recovery``rules-injector``background-notification``auto-update-checker``startup-toast``keyword-detector``agent-usage-reminder``non-interactive-env``interactive-bash-session``empty-message-sanitizer``preemptive-compaction``compaction-context-injector``thinking-block-validator``claude-code-hooks``ralph-loop`
882882

883883
**关于 `auto-update-checker``startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`
884884

@@ -942,8 +942,7 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
942942
| `aggressive_truncation` | `false` | 超出 token 限制时,激进地截断工具输出以适应限制。比默认截断更激进。不够的话会回退到摘要/恢复。 |
943943
| `auto_resume` | `false` | 从 thinking block 错误或 thinking disabled violation 成功恢复后,自动恢复会话。提取最后一条用户消息继续执行。 |
944944
| `truncate_all_tool_outputs` | `true` | 为防止提示过长,根据上下文窗口使用情况动态截断所有工具输出。如需完整工具输出,设置为 `false` 禁用此功能。 |
945-
946-
**注意**: `dcp-for-compaction`(压缩用动态上下文剪枝)现在作为 hook 管理。默认启用,可通过 `disabled_hooks: ["dcp-for-compaction"]` 禁用。
945+
| `dcp_for_compaction` | `false` | 启用压缩用 DCP(动态上下文剪枝)- 在超出 token 限制时首先执行。在压缩前清理重复的工具调用和旧的工具输出。 |
947946

948947
**警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。
949948

assets/oh-my-opencode.schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
"interactive-bash-session",
6262
"empty-message-sanitizer",
6363
"thinking-block-validator",
64-
"ralph-loop",
65-
"dcp-for-compaction"
64+
"ralph-loop"
6665
]
6766
}
6867
},
@@ -1505,6 +1504,9 @@
15051504
}
15061505
}
15071506
}
1507+
},
1508+
"dcp_for_compaction": {
1509+
"type": "boolean"
15081510
}
15091511
}
15101512
},

src/config/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const HookNameSchema = z.enum([
6666
"empty-message-sanitizer",
6767
"thinking-block-validator",
6868
"ralph-loop",
69-
"dcp-for-compaction",
7069
])
7170

7271
export const BuiltinCommandNameSchema = z.enum([
@@ -173,6 +172,8 @@ export const ExperimentalConfigSchema = z.object({
173172
truncate_all_tool_outputs: z.boolean().default(true),
174173
/** Dynamic context pruning configuration */
175174
dynamic_context_pruning: DynamicContextPruningConfigSchema.optional(),
175+
/** Enable DCP (Dynamic Context Pruning) for compaction - runs first when token limit exceeded (default: false) */
176+
dcp_for_compaction: z.boolean().optional(),
176177
})
177178

178179
export const SkillSourceSchema = z.union([

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
276276
const anthropicContextWindowLimitRecovery = isHookEnabled("anthropic-context-window-limit-recovery")
277277
? createAnthropicContextWindowLimitRecoveryHook(ctx, {
278278
experimental: pluginConfig.experimental,
279-
dcpForCompaction: isHookEnabled("dcp-for-compaction"),
279+
dcpForCompaction: pluginConfig.experimental?.dcp_for_compaction,
280280
})
281281
: null;
282282
const compactionContextInjector = createCompactionContextInjector();

0 commit comments

Comments
 (0)