Repository navigation
Conversation
The generated .opencode/plugins/graphify.js used the v1 plugin API only, so it never runs on OpenCode v2 (Closes Graphify-Labs#3554). Export a dual entrypoint per the official migration guide: v2 reads the default export's id/setup() via Plugin.define + ctx.tool.hook, while v1 (1.18.29+) calls server() and uses the returned hooks. A single file in .opencode/plugins/ now serves both runtimes; config registration is untouched (v2 normalizes the v1 "plugin" key automatically). Reminder behavior unchanged: backtick/$()-free string, ';' separator (Graphify-Labs#1413, Graphify-Labs#1646). Adds regression tests for both entrypoints.
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Graphify review — findings
Rewrites the generated OpenCode graphify plugin to expose both a v2 default export (id/setup() registering a tool.execute.before hook via ctx.tool.hook) and a legacy v1 server() hook, so one .opencode/plugins/graphify.js file works across both runtimes. Dedupes the reminder per session, resolves the project directory from event/session candidates before falling back to ctx.location.directory or process.cwd(), and matches bash/shell/execute tools while injecting the reminder into whichever of command/cmd/script the input carries. Adds tests asserting the file contains both the v2 entrypoint and the v1 server() hook.
Worth a look
- OpenCode v2 reminder check/add races across concurrent hooks —
graphify/install.py:1514· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 546 functions depend on the 314 functions this change touches.
Health — this change adds coupling hotspots:
- new:
main()— 98 callers, 3 callees - new:
dispatch_command()— 2 callers, 125 callees - new:
install()— 13 callers, 11 callees - new:
codebuddy_install()— 20 callers, 5 callees - new:
gemini_install()— 11 callers, 7 callees - new:
claude_install()— 19 callers, 4 callees - new:
_copy_skill_file()— 12 callers, 6 callees - new:
claude_uninstall()— 17 callers, 4 callees - …and 15 more — each is listed as a finding
Verification — 546 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 465 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
31 of 300 test file(s) selected (10%) via static blast radius.
tests/test_affected_cli.py— impacttests/test_agents_platform.py— impacttests/test_atomic_version_stamp.py— impacttests/test_claude_md.py— impacttests/test_codebuddy.py— impacttests/test_devin.py— impacttests/test_explain_cli.py— impacttests/test_extract_cli.py— impacttests/test_gemini_hook.py— impacttests/test_global_add_tag_inference.py— impacttests/test_god_nodes_cli.py— impacttests/test_hollow_chunks_arm_shrink_guard.py— impacttests/test_home_sandbox.py— impacttests/test_hook_strict.py— impacttests/test_incomplete_build_guard.py— impacttests/test_install.py— impact, changed-testtests/test_install_references.py— impacttests/test_install_strings.py— impacttests/test_install_version_warning.py— impacttests/test_merge_chunks_validation.py— impacttests/test_multigraph_diagnostics.py— impacttests/test_no_dedup_flag.py— impacttests/test_path_cli.py— impacttests/test_query_cli.py— impacttests/test_query_induced_edges.py— impacttests/test_read_hook.py— impacttests/test_replace_or_append_section.py— impacttests/test_search_hook.py— impacttests/test_skill_version_warning.py— impacttests/test_uninstall_scope.py— impacttests/test_unverified_semantic_shrink.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
· 23 more finding(s) on lines outside this diff (see the check run).
|
I ran uv tool install git+https://github.com/Corxo91/graphify.git@feat/opencode-v2-dual-plugin
graphify opencode installthis still fails both plugins for opencode2. |
Closes #3554.
Problem
graphify opencode installgenerates.opencode/plugins/graphify.jsusing only the v1 plugin API (export const GraphifyPlugin+(input, output)hooks). V1 implementations do not run on OpenCode v2, so the graph reminder silently never fires there.Change
Single-file dual entrypoint per the official v1→v2 migration guide:
Plugin.define({ id: "graphify", setup(ctx) })+ctx.tool.hook("execute.before"). Resolves the project dir per session (event fields →ctx.session.get→ctx.locationfallback) instead of relying on the plugin-instance directory, so it also works as a global plugin.server()returning the sametool.execute.beforehook..opencode/plugins/graphify.js, discovered by both runtimes) and same config registration (v2 normalizes the v1pluginkey automatically), so no installer logic changes.Reminder behavior unchanged: backtick/$()-free string (#1413), ';' separator for PowerShell 5.1 (#1646).
Tests
test_opencode_plugin_supports_v2_api,test_opencode_plugin_keeps_v1_server_hook.tests/test_install.py: 110 passed;ruff checkclean; generated JS validated withnode --check.Note: left #1412/#1414 (global install path) untouched to avoid conflicts — happy to rebase if needed.