From a5c73367d6afcf563ba977a0c69fb517c3953883 Mon Sep 17 00:00:00 2001 From: emidab Date: Wed, 16 Sep 2026 10:34:13 +0000 Subject: [PATCH] refactor: remove compaction autocontinue hook --- README.md | 3 +-- index.ts | 15 +-------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4d4e1be..47bdd0b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ or from a local clone: ```json { - "plugin": [["/path/to/opencode-session-restart", { "disable_compaction_continue": true }]] + "plugin": [["/path/to/opencode-session-restart"]] } ``` @@ -70,7 +70,6 @@ Either way the text is prepended to the handoff prompt under a `STANDING INSTRUC - The new session keeps the fresh prompt as its user-turn text and immediately starts working. On-disk state (git status, staged or uncommitted changes) carries over because it is the same project directory. - The original session is always left running and its full transcript remains in the session tree — the clean context lives in the child session. The handoff prompt includes the parent session ID so both you and the model know where to read the earlier conversation. -- `disable_compaction_continue` (default `true`) rejects the synthetic "continue" turn opencode would append after a compaction, so a compaction that does slip through never silently continues. Set it to `false` to keep stock behavior. ## Development diff --git a/index.ts b/index.ts index 9501b1e..43d8578 100644 --- a/index.ts +++ b/index.ts @@ -6,12 +6,6 @@ export const id = "opencode-session-restart" type PluginClient = PluginInput["client"] export type RestartPluginOptions = { - /** - * Reject the synthetic "continue" turn opencode appends after compaction, - * forcing a human (or the restart tool) to decide what happens next. - * Default: true. - */ - disable_compaction_continue: boolean /** * Static text always prepended to every restart prompt, for agents that do * not define their own `handoff_text`. An agent-defined `handoff_text` @@ -20,9 +14,7 @@ export type RestartPluginOptions = { static_text?: string } -const DEFAULT_OPTIONS: RestartPluginOptions = { - disable_compaction_continue: true, -} +const DEFAULT_OPTIONS: RestartPluginOptions = {} const MAX_TITLE_LENGTH = 80 @@ -136,11 +128,6 @@ export const server: Plugin = async ({ client }, rawOptions = {}) => { }, }), }, - "experimental.compaction.autocontinue": async (_input, output) => { - if (options.disable_compaction_continue) { - output.enabled = false - } - }, } }