refactor: remove compaction autocontinue hook
This commit is contained in:
parent
4a9479e3a8
commit
a5c73367d6
2 changed files with 2 additions and 16 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
15
index.ts
15
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
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue