You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Removes the `/truncate <percentage>` slash command from every
user-facing surface (browser registry, ACP, mobile, palette ghost-text
hints, docs, placeholder tips). The underlying
`workspace.truncateHistory` IPC, the `onTruncateHistory` callback chain,
and the **Truncate History to 25/50/75%** command-palette entries remain
in place — they back `/clear` and the palette and aren't reachable via
the removed slash command.
## Background
`/truncate` was a free-form, percentage-based destructive command
sitting next to `/clear`, `/compact`, and the palette entries. Its UX
was awkward (the user had to know what percentage they wanted, then
re-confirm in the destructive modal), it didn't work with the OpenAI
Responses API at all, and the palette already exposes fixed 25/50/75%
truncation as discrete actions for users who want bounded history
pruning. The slash command itself was redundant.
## Implementation
Removed the command at every layer that referenced it explicitly:
- **Browser slash command system** (`registry.ts`, `types.ts`,
`parser_multiline.test.ts`) — dropped `truncateCommandDefinition`, the
`{ type: "truncate"; percentage: number }` union member, and the parser
test.
- **Command dispatch** (`chatCommands.ts`) — removed the `case
"truncate":` switch arm and `handleTruncateCommand`.
- **ChatInput destructive-confirmation modal** — simplified
`pendingDestructiveCommand` from a discriminated `{ type, percentage }`
object to a plain `boolean`. `/clear` is now the only path through the
modal, so the title/description/confirm label are hard-coded.
- **ACP integration** (`acp/slashCommands.ts`, `acp/agent.ts`,
`tests/ipc/acp.slashCommands.test.ts`) — removed
`TRUNCATE_COMMAND_NAME`, the server command definition, the `kind:
"truncate"` union member, `parseTruncateCommand`, the agent dispatch
case, and the corresponding test cases.
- **Shared constants** (`constants/slashCommands.ts`,
`common/constants/slashCommandHints.ts`) — removed `"truncate"` from the
workspace-only key/type sets and dropped the `truncate` hint.
- **Mobile** (`mobile/src/utils/slashCommandRunner.ts`) — removed the
`case "truncate":` branch and renamed the now-clear-only
`handleTruncate` helper to `handleClear`, dropping the dead `percentage
< 1` branch.
- **Discovery surfaces** — removed the `/truncate 50` placeholder tip
from the carousel and the e2e scenario that exercised the command; the
review e2e now uses `/clear`.
- **Docs** (`docs/workspaces/compaction/manual.mdx`, `index.mdx`) —
removed the "Truncate (Simple Truncation)" section and the table row in
the approaches table; regenerated `builtInSkillContent.generated.ts` via
`bun scripts/gen_builtin_skills.ts`.
Stale references to `/truncate` in code comments (`aiService.ts`,
`acp/agent.ts`) were also updated.
## Validation
- `make typecheck`, `make lint`, `make fmt-check`, `make static-check` —
green.
- Targeted unit tests: `tests/ipc/acp.slashCommands.test.ts`,
`src/browser/utils/slashCommands/parser_multiline.test.ts`,
`src/browser/utils/chatCommands.test.ts`, `make test-mobile` — all
passing.
- `make test` — 21 pre-existing `GitStatusStore` failures reproduce
identically on `main` without these changes; unrelated to this PR.
## Risks
Low. Three call sites that look similar to `/truncate` are intentionally
preserved:
1. `workspace.truncateHistory` IPC — still used by `/clear` (calls with
`percentage: 1.0`) and the palette **Truncate History to N%** actions.
2. `onTruncateHistory` callback drilled through `ChatPane` → `ChatInput`
— still used by `/clear`.
3. The destructive-confirmation modal is now `/clear`-only; the
previously dynamic title/description are hard-coded.
The only behavioral change visible to users is that typing `/truncate
...` now falls through to the "Unknown command" path instead of
executing.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-7` • Thinking:
`max` • Cost: `$8.53`_
<!-- mux-attribution: model=anthropic:claude-opus-4-7 thinking=max
costs=8.53 -->
0 commit comments