Repository navigation
Description
Issue Origin
Observed or reproduced in a real environment
Problem Statement
This tracks OpenViking's OpenCode V2 integration parity. The original September proposal targeted OpenCode 2.0.20. This update checks the remaining work against OpenCode 2.2.5 and OpenViking main at 012e1f0c83405664c07d371c4f4d77a013015253.
The integration already does more than the original issue described. This checklist separates existing behaviour, pending fixes and planned workstreams. Some features will be optional to enable, but remain within the project scope. Source review is not an end-to-end runtime test.
Proposed Solution
Keep changes small and independently reviewable, reuse the shared plugin modules, and preserve the V1 integration where the package still supports it.
Already implemented in current source
- V2 prompt/context hooks, execution-boundary capture, compaction hooks and plugin cleanup.
- Capture of assistant text and tool results, with session-local cursors in plugin storage.
- Child-session identity and configurable exclusion handling. Remaining edge cases need reconciliation with fix(opencode): exclude subagent sessions from capture and commit #4988 rather than assuming this feature is absent.
- Direct model-callable server MCP tools under
openviking_*, withcodemode: false. - Profile, memory index and server-stored skill catalog injection.
- Archive preservation work in fix(plugins): archive every message on session commit #5459, merged on October 9.
Existing PRs, not new implementations
- fix(opencode-plugin): stop the v2 prompt hook from holding the send on recall #5496: non-blocking V2 prompt admission with budgeted recall injection and a persistent replay ledger. Current head:
f8ccb6fc2. Implemented and awaiting review, not merged or released. - fix(opencode-plugin): only commit sessions with new messages at cleanup #5497: skip cleanup commits when no new messages were captured. Current head:
d5015c183. Implemented and awaiting review, not merged or released.
Keep idle auto-commit with the server's memory.session_auto_commit scheduler. The plugin-side timer was deliberately removed from #5497 during review.
1. Working skill integration
Existing implementation to review: #5915 replaces the unsupported skill editor method, but its current diff retains the MCP-callback-dependent registration gate and eager callback tests. Check deferred-transform behaviour before treating registration as resolved; extend the existing contribution rather than duplicate it.
- Fix bundled skill registration. The package contains
openviking-memory,openviking-skillsandov-experience-memory, but they were absent from the runtime skill catalog with the npm plugin2026.10.28-1on OpenCode 2.2.5.startV2Plugingates skill registration on a variable set inside a deferred MCP transform, and then callsdraft.source(), which is not in the 2.2.5 SkillEditor API. The test mock executes callbacks eagerly and supplies that unsupported method. Validate the fix against actual runtime discovery, including disabled-MCP cases. - Audit shared skill guidance and packaging. The memory skill still names
search_experience/read_experience, while the Experience skill uses generic search/read tools. Review whether the portable package's usefulov-resourcesandov-memory-troubleshootguidance should also ship to dedicated integrations. - Evaluate native registration of server-stored skills through OpenCode's skill system, beyond the existing injected catalog and MCP reads. Resolve refresh, local-name precedence, permissions and supporting reference/script access before implementation.
2. Diagnostics and visibility
Related installation fix: #6744 removes duplicate V2 discovery while preserving V1 installation. Include its installation contract in diagnostics and verification rather than rebuilding that fix.
- Add an OpenCode adapter for the existing shared memory doctor. Check effective configuration, plugin/MCP/skill registration, authenticated access and capture activity. Keep it distinct from extraction-content troubleshooting.
- Add
/ovstatus, doctor and explicit commit controls using native command registration. - Add an optional TUI companion for status and recall inspection. The server component has no toast API; a V2 TUI component does have notifications, dialogs and status slots.
3. Experience-aware skill use
Shared attribution work: #5475 recognises injected experience envelopes. Review compatibility with the OpenCode hook; it does not implement skill-load triggering in OpenCode.
- Port the optional skill-experience hint workflow through
tool.hook("execute.after"), including native skill loads. General Experience retrieval through the bundled skill already exists and is a separate capability.
The hook retrieves prior skill-usage experiences when a skill is loaded. It does not itself rewrite skills or train a model. Verify configuration, deduplication, native skill loads and direct SKILL.md reads. Capturing outcomes and extracting new experiences are separate server/capture responsibilities.
4. Context management
Shared compression work: #5727 preserves complete citations in fresh and cached digests. Reuse that correctness work; native OpenCode compression and assisted compaction remain separate implementation needs.
- Evaluate keyed session instruction entries for durable profile/archive/task context. Preserve per-turn recall replay and prompt-cache stability.
- Implement and validate controlled native compression through
ctx.experimental.generate.text, with explicit model selection and measured cost/latency. Server-side compression already exists. - Implement and validate controlled OpenViking-assisted compaction through
session.hook("compaction")and its replacementresult, with native fallback and verified archive coverage.
Compression and assisted compaction are in scope, not deferred outside the plan. Confirm the design with maintainers before implementation, keep enablement explicit and preserve native fallback.
Delivery and verification
Existing fixes to reconcile before new implementation:
- fix(opencode-plugin): isolate cross-process session state writes #6777 and fix(opencode): isolate concurrent session-state saves #6779 propose competing fixes for shared session-state save races. Both use unique temporary paths; fix(opencode): isolate concurrent session-state saves #6779 also serialises same-process managers. Neither diff establishes merging of distinct managers' session maps, so test persistence completeness separately from rename-error avoidance.
- fix(opencode): wire recallExcludeUris into auto-recall #6850 wires recall exclusions into the OpenCode context-search path with HTTP-level regression coverage. Its shared fallback-path exclusions remain outside that patch.
These overlap assessments come from current PR source diffs, not runtime validation or acceptance of the proposed fixes.
These four workstreams are proposed coherent review units, not a fixed PR count. Split only where each change is independently useful and reviewable. Diagnostics/commands and the TUI may need separate PRs if the combined diff grows too large. The two existing PRs remain separate.
- Verify capture durability, restart/offline recovery, compaction boundaries and child-session behaviour across the relevant workstreams. Reconcile fix(opencode-plugin): decouple flush/threshold-commit from session.idle and make state save process-safe #3691, fix(opencode): exclude subagent sessions from capture and commit #4988 and fix(opencode): wire captureFilters through config and the capture path #4989 against current code before creating new fixes.
- Optionally distribute the existing upstream
ov-kanbanskill without changing its protocol. At the reviewed revision it ships in the portable bundle, not the dedicated Claude/Codex/OpenCode integrations, so this is not a parity requirement. No dispatcher or atomic-claiming system is planned.
Maintainer feedback requested: does this grouping fit the integration direction, and which boundaries would make review practical?
Alternatives Considered
Keep MCP as the tool transport. Functional tool parity does not require replacing it with custom tools. #3048 was closed without merging; an in-process adapter would need a concrete benefit and compatibility evidence before revisiting it.
Prefer the dedicated hook-based plugin over installing the portable Agent Plugins package alongside it. Individual portable skills can be reused without duplicating MCP registration or adopting the hook-free memory instructions.
Feature Area
Other
Use Case
Use OpenCode alongside Claude Code and Codex against one OpenViking server, with dependable recall, capture, diagnostics and visible execution state. The terminal TUI should expose useful status without making UI components a prerequisite for headless use.
Example API (Optional)
Relevant V2 surfaces: ctx.skill.transform(editor => editor.add(skill)), ctx.command.transform, ctx.tool.hook, ctx.session.hook, ctx.session.instructions, filtered ctx.event.subscribe, plugin storage and an optional ./tui export.
Additional Context
Checked against the OpenCode v2.2.5 tag under packages/plugin/src/promise/ and the current V2 server/TUI documentation. The skill-loading absence was observed in a live runtime; the transform timing issue was isolated with deferred versus eager callbacks. No plugin repair is claimed complete here.
Related work: #5148 remains open; #5496 addresses its V2 path. #4062 and #3691 remain open and concern overlapping lifecycle work. #4988 and #4989 remain open, but current source must determine their surviving delta. #5459 is merged. Track implementation, merge, publication and installed-runtime verification as separate milestones.
This issue is the public progress checklist. Detailed execution records can live in an OV Kanban board; private deployment details do not belong in this thread.
Contribution
- I am willing to contribute to implementing this feature
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
fix(opencode-plugin): commit v2 sessions when they end
fix(opencode-plugin): commit v2 sessions when they end
oliver-mee commentedon Nov 18, 2026
The OpenCode V2 follow-up is split into reviewable changes:
Native server-stored skills remain a separate design decision. The existing catalog and explicit reads work without assuming that a local skill copy can safely preserve permissions, refresh, name precedence and helper access. The current profile, archive and per-message recall paths also do not require a new keyed-instructions layer. Concrete gaps there can be reviewed separately.
The open drafts are for review. The native tests used OpenCode 2.3.0 with isolated fixtures.