mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-17 23:01:26 +00:00
Refs #1077 Claude Code's plan-approval dialog offers "clear context" only when `showClearContextOnPlanAccept` is on (the SDK's `Settings` docs: "When true, the plan-approval dialog offers a "clear context" option. Defaults to false."). The adapter offered it on every ExitPlanMode request, and #1077 shows what a cleared context then loses on `session/load`. - `SettingsManager.getShowClearContextOnPlanAccept` resolves the setting as the CLI does: managed settings, then the `--settings` override, then the user/project/local files; false otherwise. - `buildClaudePermissionOptions` offers the clear-context option only when it is on, for v1 and v2. Tests cover the default, the v1 wiring and the settings precedence; the existing clear-context tests and the exit-plan scenarios turn the setting on. Checked with a real session: without the setting, Approve Plan offers `exit-plan-default`, `exit-plan-auto` and `reject`; with `showClearContextOnPlanAccept: true` in the project's `.claude/settings.json`, `exit-plan-clear-auto` is back and the plan runs. --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>