Conversation
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.
Summary
Preserves OpenCode 1.18.23 and adds V2 compatibility, verified with 2.0.23. Refresh generated plugins with
teamai hooks injectorteamai pull, then restart OpenCode.Type of Change
Evidence
Plugin must export a default definition with an id and an effect or setup function.The original-module regression failed with an undefined default export; V2 prompt dispatch and native shell attribution also failed before implementation.After: Actual V1 1.18.23 and V2 2.0.23 hosts loaded the CLI-installed plugin in isolated HOME/XDG directories. Each session creation produced exactly one
session-startwith the host session id and canonical cwd, and exactly one enterprise shell-command marker. V2plugin.listconfirmedteamai.hooksandteamai.agent.start-proofactive.Test Plan
npx tsc --noEmitnpm run lintnpx vitest run— 8,028 passed, 20 skipped; final additional failure-path regressions passed in the focused run.npx vitest run opencode-hooks session-id— generated original ESM, both entrypoints, event payloads/matchers, aliases, task links, cleanup, enterprise replacement/removal and nonfatal subprocess errors.npm run buildTEAMAI_OPENCODE_V2_BIN=/Users/pw-smoro/.opencode/bin/opencode2 npm run test:e2e— full suite completed: 557 passed, 26 skipped, 6 failed. All six also fail at the pinned base: oneself-mode-worktrees-808untracked.teamai/last-fetch.jsonassertion and fivestats-recall-dry-runassertions. Both actual OpenCode host tests pass in this full run.Baseline evidence: archived
a8957a8into excluded.scrath/baseline, built it, and rannpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/self-mode-worktrees-808.test.ts -t "lets a checkout pull and contribute after another checkout switched"(same failure), thennpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/stats-recall-dry-run.test.ts(same five failures). No unrelated fixes added.Real-host run:
TEAMAI_OPENCODE_V2_BIN=/Users/pw-smoro/.opencode/bin/opencode2 npx vitest run --config vitest.e2e.config.ts opencode-hooks— 2 passed. The built CLI executeshooks inject; real hosts serve and create sessions; a capture executable verifies spawned dispatch argv/STDIN, while the enterprise command actually appends its marker.Related Issues
Reported OpenCode V2 server-plugin error; no linked issue.
Notes for Reviewers
Whole branch reviewed against initial
origin/mainSHAa8957a8943a297b08fbc017b48d9b29c8bb98b98; parallel Standards/Spec review: 0 findings in each axis, no pending corrections. EN/CN usage docs and agent troubleshooting updated.V2 smoke testing opts in through
TEAMAI_OPENCODE_V2_BIN; default CI retains the pinned V1 binary. Capture verifies adapter delivery, not remote provider side effects. V2 supplies its native shell session variable because its shell hook has no session id.Merge Danger
Door: two-way
Regenerate plugins after rolling back. No schema or data migration.
Blast Radius: OpenCode
Built-in/enterprise hooks and native shell attribution only; other tool adapters are unchanged.