feat(opencode): add bridge adapter with hardened lifecycle plugin#29
Closed
aayoawoyemi wants to merge 13 commits into
Closed
feat(opencode): add bridge adapter with hardened lifecycle plugin#29aayoawoyemi wants to merge 13 commits into
aayoawoyemi wants to merge 13 commits into
Conversation
Add ori bridge opencode command with full lifecycle parity to Claude Code integration. - MCP config written to opencode.json (default ori entry) - Lifecycle plugin at .opencode/plugins/lifecycle.js - session.created -> auto-orient - session.idle -> auto-capture - tool.execute.after (write) -> auto-validate - Supports --scope project|global and --activation auto|manual - Plugin reads ORI_VAULT from env, works with any named MCP entry - Full test suite (7 new tests, 37 total bridge tests passing)
Plugin now reads vault path from opencode.json MCP config instead of relying solely on process.env.ORI_VAULT. This fixes auto-orient failing when the plugin runs in OpenCode's process context where the env var isn't available. - Adds getVaultPath() helper that checks env var first, then parses opencode.json to extract vault from command args or environment - Adds error logging when no vault path is found - Adds verbose logging for orient, capture, and validate operations - Uses directory context parameter from OpenCode plugin API
ori orient is an MCP tool (ori_orient), not a CLI command. The plugin was trying to run it via CLI which caused 'unknown option --vault' error. Changes: - Remove auto-orient CLI call from lifecycle plugin - Auto-orient is handled by MCP instructions (identity auto-injected) - Plugin now logs that ori_orient tool is available for manual use - Update AGENTS.md instructions to reflect MCP-based orient - Keep auto-capture (ori add) and auto-validate (ori validate) working
…te guard - Replace $ shell executor with spawnSync for silent ori add/validate - Implement isFirstRun() detection by parsing blank identity.md scaffold - Inject ONBOARDING_PROMPT via client.session.prompt() on first session - Add onboardedSessions Set guard to prevent duplicate prompt injection - Update README, CHANGELOG, and cross-client docs
- Plugin had no access to session content; ori add --auto flag doesn't exist - Session capture is now agent-driven via ori_add MCP tool with content param - Updated cross-client docs and changelog - Updated Godofredo methodology to clarify end-of-session capture
- Add Orient/Work/Persist rhythm structure to blank template - Clarify ori_add must use content parameter (no template stubs) - Add end-of-session capture step - Ensures all fresh installs get the same methodology guidance
- Plugin now fetches session messages via client.session.messages() - Builds conversation transcript (user + assistant text parts only) - Calls ori add --content to save real content (not template stubs) - Added --content flag to ori add CLI command - Reverted scaffold methodology.md to blank template - Updated changelog and cross-client docs
… piping - Replace session.idle with session.compacted + session.deleted for reliable capture - Add capturedSessions guard to prevent duplicate captures - Fix Windows spawnSync with shell:true and quoted args for spaces - Add --content-stdin and --content-file flags to ori add CLI - Add debug logging to lifecycle.js for troubleshooting
- remove Windows shell command construction from lifecycle commands - resolve vaults from any OpenCode MCP entry with ORI_VAULT or --vault - validate only notes resolved under the vault root - update OpenCode bridge test expectations for compacted/deleted capture hooks
Owner
Author
|
Closing-PR-per-new-workflow-branch-remains-pushed-for-review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes external PR #25 with the same OpenCode bridge adapter plus review fixes.
Includes the PR #25 OpenCode bridge work:
ori bridge opencodeAGENTS.mdbridge instructionsori add --content,--content-file, and--content-stdinCLI wiringReview fixes added here:
shell: truecommand construction from lifecycle pluginoriviaspawnSync(command, args, { shell: false }), withori.cmdfallback on WindowsORI_VAULTor--vault, not onlymcp.orisession.idletosession.compacted/session.deletedVerification:
node --check adapters/opencode/plugin/lifecycle.js✅npm run build✅npx vitest run tests/bridge.test.ts --environment node✅ 37/37npm test -- --runruns but still fails on pre-existing ambient failures unrelated to this branch: global vault discovery tests on this machine, activation decay date drift tests, and stale MCP tool-count expectation.