Repository navigation
feat: add verified OpenCode 2 support and prepare 0.11.0 - #78
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
npm run re-exports a user-level allow-scripts npmrc entry as environment config, which npm 12 rejects with EALLOWSCRIPTS when the child install also passes --ignore-scripts; the type, packed-host, and packed-tool contracts now strip script-policy npm_config_* keys before invoking child npm. npm 12 also keys pack --json output by package name instead of printing a bare array. The packed-host and packed-tool contracts still assumed the array shape and failed before their install step, and the type contract crashed in its final success log (packResult[0] instead of the normalized packed entry) even after both tsc passes. Normalize all three.
The 0.10.1 release notes left three surfaces marked unverified against a live 2.x provider. All three now have live OpenCode 2.0.16 results recorded in the verified-on-a-live-host table: - a full goal run to completion through goal_complete (archive as achieved with the evidence claim and usage recorded); - the auto-continue loop (two goal_continuation prompts admitted with correlation metadata and a live progress_budget countdown, then the talk-only stall gate pausing the goal); - the session-title status indicator rendering the live status line. Also recorded: cold-boot command ownership over a legacy config command.goal entry (the plugin's framed control result is the admitted turn; the config template text never reaches the model), agent registration with system prompts and translated permission rules, and the plugin-options precedence rule when the same package is listed in both user-level and project config. completionAudit child sessions remain the one unverified path, as documented.
A long-running host (opencode serve) can reload a location's plugin instance without disposing the instance it replaces — a file-watcher event under .opencode, including this plugin's own state writes, can trigger that. The orphaned instance's session lease used to stay live forever, since its owning pid is the host process itself and never exits, permanently blocking its own successor with session_owned_elsewhere. Each plugin instance now touches its own lease's claim every time it actually handles a hook or tool call for a session it owns (not a free-running timer, which would keep an orphan's claim alive forever too). persistence-lease.js reclaims a same-host claim once it stops being refreshed for DEFAULT_STALE_CLAIM_MS; a different host's claim is never reclaimed this way, since network partitions and clock skew make "stopped heartbeating" indistinguishable from "still alive but slow to reach us". Adds a test-only leaseStaleAfterMs plugin option and touch()/touchClaim lease API, plus tests covering reclaim-after-stale, touch() semantics, and an end-to-end orphaned-instance recovery scenario. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds OpenCode 2 support from #76 with corrections for live lease ownership, failed agent switching, verifier ownership and synchronous audit replies. Same-process location reloads now retire the old plugin instance explicitly instead of reclaiming a live lease by age. Every built-in V2 audit verifies the live verifier system and permissions before submission; a failed switch sends no prompt. Rejected config ownership revokes audit readiness, and child verdicts are read only after execution settles.
Directory normalization uses a linear scan to avoid backtracking on adversarial separator runs, with a bounded subprocess regression.
Includes current main's #75 and audit fixes through a normal merge. Prepares 0.11.0 with synchronized version pins and changelog; no publication. Preserves the original contributor commits. This corrected integration supersedes the reviewed #76 implementation.
Validation:
OpenCode 2.0.16 exposes no session-removal method in the plugin context. Verifier children remain retained on that host; optional removal is mapped when supported. The checked-in live canary is isolated and uses a localhost deterministic provider with no paid calls. Hosted OS/Node checks should pass before merging.