fix(coding-agent): show compaction UI for extensions

This commit is contained in:
Mario Zechner 2026-01-17 11:48:54 +01:00
parent 9d3f8117a4
commit 05ee8e3334
2 changed files with 22 additions and 6 deletions

View file

@ -4,8 +4,16 @@ const COMPACT_THRESHOLD_TOKENS = 100_000;
export default function (pi: ExtensionAPI) {
const triggerCompaction = (ctx: ExtensionContext, customInstructions?: string) => {
if (ctx.hasUI) {
ctx.ui.notify("Compaction started", "info");
}
ctx.compact({
customInstructions,
onComplete: () => {
if (ctx.hasUI) {
ctx.ui.notify("Compaction completed", "info");
}
},
onError: (error) => {
if (ctx.hasUI) {
ctx.ui.notify(`Compaction failed: ${error.message}`, "error");