feat(preemptive-compaction): auto-continue after compaction (#166)

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)
This commit is contained in:
YeonGyu-Kim
2025-12-22 11:16:13 +09:00
committed by GitHub
parent e3a5f6b84c
commit fea9477302

View File

@@ -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 {