refactor(shake): removed shake-summary mode and local-model compressor
- Dropped `summarizeShakeRegions`, the shake-summary prompt, and related types. - Removed `shake-summary` compaction strategy and `providers.shakeSummaryModel` setting. - Migrated existing `shake-summary` configs to plain `shake` on load. - Simplified `/shake` to `elide` and `images` modes only.
This commit is contained in:
@@ -1124,48 +1124,16 @@ export class CommandController {
|
||||
}
|
||||
|
||||
/**
|
||||
* TUI handler for `/shake`. `elide`/`images` are instant structural drops;
|
||||
* `summary` runs the local on-device compressor behind a cancelable loader
|
||||
* (Esc aborts via `abortCompaction`). Rebuilds the chat and reports counts.
|
||||
* TUI handler for `/shake`. `elide` drops heavy structural content and
|
||||
* `images` strips image blocks. Rebuilds the chat and reports counts.
|
||||
*/
|
||||
async handleShakeCommand(mode: ShakeMode): Promise<void> {
|
||||
let result: ShakeResult;
|
||||
if (mode === "summary") {
|
||||
if (this.ctx.loadingAnimation) {
|
||||
this.ctx.loadingAnimation.stop();
|
||||
this.ctx.loadingAnimation = undefined;
|
||||
}
|
||||
this.ctx.statusContainer.clear();
|
||||
const originalOnEscape = this.ctx.editor.onEscape;
|
||||
this.ctx.editor.onEscape = () => {
|
||||
this.ctx.session.abortCompaction();
|
||||
};
|
||||
const loader = new Loader(
|
||||
this.ctx.ui,
|
||||
spinner => theme.fg("accent", spinner),
|
||||
text => theme.fg("muted", text),
|
||||
"Shaking context (summary)… (esc to cancel)",
|
||||
getSymbolTheme().spinnerFrames,
|
||||
);
|
||||
this.ctx.statusContainer.addChild(loader);
|
||||
this.ctx.ui.requestRender();
|
||||
try {
|
||||
result = await this.ctx.session.shake("summary");
|
||||
} catch (error) {
|
||||
this.ctx.showError(`Shake failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
} finally {
|
||||
loader.stop();
|
||||
this.ctx.statusContainer.clear();
|
||||
this.ctx.editor.onEscape = originalOnEscape;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
result = await this.ctx.session.shake(mode);
|
||||
} catch (error) {
|
||||
this.ctx.showError(`Shake failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
result = await this.ctx.session.shake(mode);
|
||||
} catch (error) {
|
||||
this.ctx.showError(`Shake failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const dropped = result.toolResultsDropped + result.blocksDropped + (result.imagesDropped ?? 0);
|
||||
|
||||
Reference in New Issue
Block a user