Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opencode v2 compatibility (compaction within context-mode) #1194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Opencode v2 compatibility (compaction within context-mode) #1194
Changes from 1 commit
95859ea801b3f68e2ce942d67978ee42822841cea4c8dd1feFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
…age) Add an OpenCode v2 plugin mouth alongside the existing v1 one so a single published package serves both host generations. - core.ts: host-agnostic ContextModeCore (SessionDB, capture/claim, routing islands, ctx tool handlers); memoized per platform::loadScopeDir so plugin load is idempotent. - plugin-v2.ts: setupV2 mouth — registers the 11 ctx tools under the `ctx` namespace (effective ctx_* names), routing enforcement, session/prompt capture, routing-block + resume-pointer injection on primary requests, compaction ownership (replaces the host summary with our snapshot), and a context-mode-owned destructive-tool policy (ctx_purge/ctx_upgrade refused by default; CONTEXT_MODE_ALLOW_DESTRUCTIVE=1 to enable). - plugin.ts: merged default export {id, setup, server} — V1 hosts call server(), V2 hosts call setup(); ContextModePlugin named export preserved. - index.ts: AdapterTarget (v1/v2) axis; pluginKey/oppositeKey; stale-key removal on target switch; doctor warns on a stale opposite key; detectTargetFromConfig. - detect.ts: getAdapter(platform?, pluginTarget?) threads the target. - cli.ts: --v2/--opencode2 flag + resolveUpgradeTarget (explicit -> PATH -> existing config -> v1). - configs/opencode/opencode-v2.json: v2 `plugins`-key template. - docs: honest v2 permission posture + trust boundary + upgrade path. @opencode/plugin and @opencode/schema are type-only devDependencies (import type -> erased at runtime). v1 behavior is byte-identical; the 57 v1 tests are unchanged. Full suite green (4760 passed). Live-verified against OpenCode 2.0.11: the plugin loads via the `plugins` key and 11 ctx tools register under the ctx namespace with the correct bash-permission bucket and destructive set.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.