OpenCode loads plugins from:
- Global:
~/.config/opencode/plugin/(affects all projects) - Project:
<project>/.opencode/plugin/(project-specific)
The E2E tests use two temp directories:
/tmp/opencode-e2e-python(port 3200)/tmp/opencode-e2e-nodejs(port 3201)
After setupProject() but before sending tasks:
/tmp/opencode-e2e-python/
└── .opencode/
└── plugin/
└── reflection.ts # Copied from project root (reflection-3.ts)
/tmp/opencode-e2e-nodejs/
└── .opencode/
└── plugin/
└── reflection.ts # Copied from project root (reflection-3.ts)
After agent completes tasks:
/tmp/opencode-e2e-python/
├── .opencode/
│ └── plugin/
│ └── reflection.ts (reflection-3.ts)
├── hello.py
└── test_hello.py
/tmp/opencode-e2e-nodejs/
├── .opencode/
│ └── plugin/
│ └── reflection.ts (reflection-3.ts)
├── hello.js
└── hello.test.js
# Install globally (affects all projects)
npm run install:global
# Or install to a specific project
mkdir -p /path/to/project/.opencode/plugin
cp reflection-3.ts /path/to/project/.opencode/plugin/reflection.tsnpm install
npm run test:e2e- Deletes
/tmp/opencode-e2e-*directories - Creates fresh directories with plugin copied to
.opencode/plugin/ - Starts
opencode serveon ports 3200 and 3201 - Creates sessions via SDK and sends coding tasks
- Plugin triggers on
session.idleevents - Judge session evaluates task completion
- Sends feedback if incomplete (max 3 attempts)