From fea9477302e9ad4228537068dc1a77cbfa19b813 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 22 Dec 2025 11:16:13 +0900 Subject: [PATCH] feat(preemptive-compaction): auto-continue after compaction (#166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send 'Continue' prompt automatically after preemptive compaction completes successfully, matching anthropic-auto-compact behavior. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/hooks/preemptive-compaction/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/hooks/preemptive-compaction/index.ts b/src/hooks/preemptive-compaction/index.ts index c5c650b..3a8e010 100644 --- a/src/hooks/preemptive-compaction/index.ts +++ b/src/hooks/preemptive-compaction/index.ts @@ -153,12 +153,25 @@ export function createPreemptiveCompactionHook( .showToast({ body: { title: "Compaction Complete", - message: "Session compacted successfully", + message: "Session compacted successfully. Resuming...", variant: "success", duration: 2000, }, }) .catch(() => {}) + + state.compactionInProgress.delete(sessionID) + + setTimeout(async () => { + try { + await ctx.client.session.promptAsync({ + path: { id: sessionID }, + body: { parts: [{ type: "text", text: "Continue" }] }, + query: { directory: ctx.directory }, + }) + } catch {} + }, 500) + return } catch (err) { log("[preemptive-compaction] compaction failed", { sessionID, error: err }) } finally {