Skip to content

feat(acp): handle /clear in ACP sessions / ACP 会话内支持 /clear - #9705

Open
BuGlessRB wants to merge 1 commit into
esengine:main-v2from
BuGlessRB:pr/clear-acp
Open

feat(acp): handle /clear in ACP sessions / ACP 会话内支持 /clear#9705
BuGlessRB wants to merge 1 commit into
esengine:main-v2from
BuGlessRB:pr/clear-acp

Conversation

@BuGlessRB

@BuGlessRB BuGlessRB commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #9488 (/clear + YOLO). The CLI got YOLO-mode confirmation skipping for /clear; reasonix acp never did — its turn path runs RunTurn directly and skips the controller's slash-verb dispatch, so /clear went to the model as plain text.

Changes

  • session/prompt with text /clear now clears the session in place (fresh transcript, same session id), matching the CLI's /clear.
  • YOLO tool-approval mode clears immediately — the same question-skipping behaviour as feat(cli): skip /clear confirmation in YOLO mode / YOLO 模式下跳过 /clear 确认 #9488.
  • Ask, Auto, and Plan modes first ask the client via a session/request_permission round-trip (Clear the session / Cancel); declining leaves the session untouched.
  • The verb is advertised in available_commands_update as clear, like any other slash command.
  • Docs updated (ACP.md / ACP.zh-CN.md, TOOL_APPROVAL_MODES.md / zh-CN).

Tests

  • TestE2EClearAskModeAsksAndClearsOnConfirm — permission round-trip, then clear + fresh transcript path under the same session id.
  • TestE2EClearAskModeCancelAborts — declining keeps the session and path.
  • TestE2EClearYoloModeSkipsConfirmation — clears without any client round-trip.

Verified: go test ./internal/acp/, go test ./internal/cli/ ./internal/control/, go build ./..., go vet, repolint clean.

With this, the agentic.nvim /clear interception kludge can be removed.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Sep 1, 2026
@BuGlessRB
BuGlessRB force-pushed the pr/clear-acp branch 5 times, most recently from 86f2621 to fbf2fee Compare September 4, 2026 15:51
…LO mode

The ACP turn path runs RunTurn directly and never reaches the
controller's slash-verb dispatch, so /clear previously went to the
model as plain text. Resolve /clear in the ACP server before the
turn: YOLO mode clears immediately (the mode already opted out of
confirmations), every other approval mode asks the client through a
session/request_permission round-trip first, and the session rotates
to a fresh transcript path under the same session id. Advertise the
verb in available_commands_update like any other slash command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant