anomalyco / anomalyco/opencode
[FEATURE]: V2 plugin support for managing context-window transitions
@rekram1-node is already working on this.
Since Sep 7, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
The related V1 proposal is linked below; I did not find an existing request for this V2 capability.
Describe the enhancement you want to request
I’m building a V2 plugin that uses Astra’s native history and notes to continue across context windows without a generated summary.
The plugin can control which messages are sent to the model, but OpenCode’s builtin automatic compaction can run before that request hook or during context-overflow recovery. There doesn’t appear to be a supported way for a plugin to take over context-window transitions for the sessions it manages.
Could V2 expose a way to support this? The motivation is to integrate model-native context management through a plugin without requiring a custom OpenCode build.
I reproduced both compaction paths in an isolated runtime fixture on 0.0.0-beta-19157.
Related: #27366 proposed a compaction bypass for V1 but was closed for inactivity.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.