mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 13:03:42 +00:00
fix(coding-agent): show compaction UI for extensions
This commit is contained in:
parent
9d3f8117a4
commit
05ee8e3334
2 changed files with 22 additions and 6 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue