feat(coding-agent): add extension compaction helpers

This commit is contained in:
Mario Zechner 2026-01-17 11:39:46 +01:00
parent 673916f63c
commit 9d3f8117a4
11 changed files with 190 additions and 4 deletions

View file

@ -124,6 +124,18 @@ describe.skipIf(!API_KEY)("Compaction extensions", () => {
abort: () => session.abort(),
hasPendingMessages: () => session.pendingMessageCount > 0,
shutdown: () => {},
getContextUsage: () => session.getContextUsage(),
compact: (options) => {
void (async () => {
try {
const result = await session.compact(options?.customInstructions);
options?.onComplete?.(result);
} catch (error) {
const err = error instanceof Error ? error : new Error(String(error));
options?.onError?.(err);
}
})();
},
},
);