When @raindrop-ai/opencode-plugin is configured as an opencode plugin, it silently fails to load. The plugin's npm install is triggered but opencode doesn't wait for it to complete — the plugin function is never called.
@braintrust/trace-opencode configured alongside it loads fine every time.
RAINDROP_DEBUG=true \
RAINDROP_WRITE_KEY=<your-key> \
BRAINTRUST_API_KEY=dummy \
opencode run --print-logs "say hello" 2>&1Both plugins load and fire hooks. Raindrop should log:
[raindrop-ai/opencode-plugin] [info] Loading @raindrop-ai/opencode-plugin v0.0.8
Braintrust loads, registers tools, and fires hooks. Raindrop triggers npm install and is never heard from again:
17:04:27 service=plugin path=@braintrust/trace-opencode loading plugin
17:04:27 service=plugin path=@raindrop-ai/opencode-plugin loading plugin
17:04:27 service=npm pkg=@raindrop-ai/opencode-plugin@latest installing package
17:04:27 service=npm pkg=@braintrust/trace-opencode@latest installing package
17:04:27 service=braintrust Logging Braintrust spans to project "opencode"
^^^ braintrust loaded — raindrop never appears
Both plugins go through npm install, but braintrust's resolves near-instantly (88 deps already cached, large lock file) while raindrop's takes longer (fewer cached deps, small lock file). Opencode doesn't await the install — it proceeds with plugin loading and raindrop misses the window.
Evidence: manually calling the plugin function works perfectly:
node -e "
process.env.RAINDROP_WRITE_KEY='test';
process.env.RAINDROP_DEBUG='true';
const m = require('$HOME/.cache/opencode/packages/@raindrop-ai/opencode-plugin@latest/node_modules/@raindrop-ai/opencode-plugin/dist/index.cjs');
m.default({directory: '/tmp'}).then(h => console.log(Object.keys(h)));
"
# Outputs: [ 'event', 'chat.message', 'tool.execute.before', 'tool.execute.after', 'experimental.session.compacting', 'experimental.chat.system.transform' ]opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"@braintrust/trace-opencode",
"@raindrop-ai/opencode-plugin"
]
}- opencode v1.3.17
- Node v20.19.2
- macOS