Repository navigation
fix(opencode): preserve v2 hook and plugin directory packages - #915
Conversation
Stage the reviewed issue 913 source for isolated fork validation. Preserve package directories and manifests without executing managed packages or installing their dependencies, and include receipt and localized UI fixes. Reviewed local source: 15ac88e2f266571b8a6dc8d777302db0f4dcae44 Exact source tree: 45ebabf Static checks and independent inspection completed. Go, integration, dashboard, rendering, and hosted runtime validation remain pending. This fork staging commit is not an upstream publication or merge.
Check the version-aware binding schema and verify native unregister retains the unchanged managed snapshot.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11ae3119ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| probe = func(bin string) (string, error) { | ||
| ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) | ||
| defer cancel() | ||
| cmd := exec.CommandContext(ctx, bin, "--version") |
There was a problem hiding this comment.
Handle Windows npm shims in the OpenCode version probe
On Windows when OpenCode is installed through npm and opencode resolves to opencode.cmd, this attempts to launch a batch file directly. Go's os/exec documentation explicitly states that it “does not invoke the system shell,” so the probe fails to start instead of returning a version. Because renderScope and native importCode now require this probe, even OpenCode v1 users lose previously working hook synchronization and imports despite being able to run OpenCode from their terminal. Resolve the underlying executable or safely handle Windows batch launchers, and cover the default probe rather than only injected version callbacks.
Useful? React with 👍 / 👎.
Probe recognized native Opencode executables without invoking a batch shell; exercise the default version probe on hosted Windows.
Avoid doubling carriage returns when Git checks out the npm fixture with CRLF.
|
Thanks for working on this, and for the detailed write-up in #913. The overall approach (probe the installed API, keep v1 flat files, register v2 directory packages, never run plugin code or install dependencies) matches what the issue asks for. The earlier Windows npm shim finding is resolved by 6ea1997: it only matches the fixed cmd-shim template and never invokes I reviewed the PR head (d1524ce) by reading the code; I did not run tests locally (CI is green). Findings below, grouped by kind and ordered by severity within each group. Paths are at the PR head. Correctness
Repository rules
Spec coverage (#913)
Consumers
Cleanup (judgement calls)
Happy to discuss any of these. The probe failure in Correctness 1 is the main thing I'd want resolved before merge. |
…r agents Review of the v2 directory package change found that one failed `opencode --version` probe failed the whole hooks plan, so a machine without the binary (a second machine sharing the config, CI, a devcontainer) could no longer sync hooks to any agent, and doctor and the dashboard preview failed with it. Hooks: - A probe that fails or reports an unknown major now skips only the OpenCode bindings with one warning per target. Outputs already owned there are parked, so they are neither rewritten nor removed while the layout is unknown. The probe runs once per plan, list and import. - A `package` binding on OpenCode v1 is skipped with a warning instead of failing the plan. - The v2 dependency warning is reported once, and only when a package file is written, so a synced hook no longer keeps doctor yellow. - `hooks import` reports an unreadable file such as a symlink as that package's problem; other packages and flat files stay importable. The package validation problem is reported once instead of twice. - Directories under `plugins/` are listed as unmanaged only on v2. Plugins: - The inventory leaves `plugins/skillshare-NAME` registrations to hooks, so a synced v2 hook is not offered as an importable plugin. Dashboard: the new warnings are translated in every locale, a `hook NAME:` prefix no longer defeats translation, the native preview translates its per-file error, and the YAML editor documents `package`. Docs: the English pages and the built-in skill describe the behavior above; the ja, ko, zh-Hans and zh-Hant pages now carry the same content as the English ones. The runbook drives the CLI with mdproof assertions instead of prose expectations. Refs runkids#913.
|
I pushed 65a8ffa to this branch to address the review above. The main change: a failed or unrecognized |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Type
Linked issue
Refs #913.
What changed
OpenCode v2 hook and plugin registration preserves package directories and manifests, instead of registering an entry file. OpenCode v1 retains its flat-file behavior; unknown versions are rejected. Imported local packages keep declared dependency metadata; Skillshare does not execute those packages or install their dependencies. Receipt handling preserves account ownership across sync and removal, and the dashboard surfaces localized validation messages.
This is a single compatibility proposal. It touches the CLI, dashboard, tests and translated docs; the linked issue does not currently have an
approvedlabel. AI-assisted implementation and review; no human-review attestation is made here.Verification
make check, scoped Go unit/integration tests, dashboard tests/build and browser interaction checks were not run. The available VM has no devcontainer.Published head
dfc490c5has the exact reviewed source tree45ebabfe2bc63afd3cf49cba1e9d16ea5a3b6721. No live OpenCode configuration or package execution was used.Checklist
Opened at the contributor’s direction as a draft for validation.