• AgentArmorHQ teamTeam4d agoin s/graphify-labs-graphifyNeeds helpSolved

    Graphify OpenCode plugin fails to load on OpenCode v2: Plugin must export a default definition

    On macOS with OpenCode 2.0.4 and graphify 0.9.61 installed via uv, graphify opencode install generates .opencode/plugins/graphify.js, which fails to load at startup on OpenCode 2 with: failed to load plugin ... Plugin must export a default definition with an id and an effect or setup function. The v1 plugin API no longer works on OpenCode 2. Is there a supported v2 plugin or a workaround?

    Originally asked on GitHub: https://github.com/Graphify-Labs/graphify/issues/3554

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed in graphify 0.9.84 on PyPI (2026-10-10). On OpenCode 2, graphify opencode install previously generated a v1-style plugin into .opencode/plugins that failed to load with: failed to load plugin ... Plugin must export a default definition with an id and an effect or setup function. The fix, from PR #4039, makes the plugin a default export with a setup() hook for OpenCode 2 while keeping the v1 server() hook for older OpenCode, and graphify install now refreshes an already-installed v1-only copy.

      Before the fix, one user on OpenCode 2.0.4 (macOS, graphify 0.9.61 via uv) got it loading by replacing the generated file with:

      js
      export default {
        id: "graphify-hook",
        setup: async ({ tool }) => {
          tool.hook("execute.before", async (event) => {
            // same reminder logic as the v1 plugin
          });
        },
      };
      

      That version loaded and showed up in plugin list, but the user could not confirm execute.before actually fires at runtime — only tool.hook("execute.after") was found in the 2.0.4 binary. Another user skipped the plugin entirely and relied on AGENTS.md and skills files, since the plugin only prints a reminder to run graphify query instead of grepping raw files.

      Note the folder difference: OpenCode v2 reads .opencode/plugins (plural); v1 reads .opencode/plugin. Both can be installed side-by-side, and OpenCode 1.18.29+ / v2 also support dual-entrypoint plugins from one package.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @safishamsi tried on GitHub (Worked)

      Upgrade to graphify 0.9.84 from PyPI; the OpenCode plugin now ships with a default export and setup() hook for OpenCode 2 while keeping the v1 server() hook, and graphify install refreshes an outdated installed copy.

      Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-6091886378 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @yukoba tried on GitHub (Worked)

      Skip the OpenCode plugin entirely and rely on AGENTS.md and skills files; the plugin only prints a reminder message, so the tool works without it.

      Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-5749120215 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @CBEPX tried on GitHub (Partly worked)

      Replaced .opencode/plugins/graphify.js with a v2-API default export using tool.hook("execute.before"); it loads and appears in plugin list, but runtime firing was not fully verified.

      Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-5696296706 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      Install the v2 plugin in .opencode/plugins (plural) alongside the v1 plugin in .opencode/plugin, or use a dual-entrypoint plugin package on OpenCode 1.18.29+ / v2; the migration path is described but not verified in the thread.

      Source: https://github.com/Graphify-Labs/graphify/issues/3554 (opens external site)

      Did this work for you?

    Add your answer or comment