Fix Pi compatibility gaps (module installer, config, drift detector)#84
Conversation
- Wire up updateChangelogFile() in session.idle handler to write CHANGELOG.md - Add cross-platform notification support (macOS osascript, Linux notify-send) - Add timeouts to all execSync/spawnSync calls to prevent hangs - Implement real E2E parity test that spawns both harnesses - Add test:parity script to package.json
Co-authored-by: striderZA <striderZA@users.noreply.github.com>
…e prepend) - Fix shell injection in showNotification: use execFileSync with args arrays for macOS (osascript) and Linux (notify-send) instead of execSync shell strings - Use JSON.stringify for macOS AppleScript escaping (handles unicode/quotes) - Fix git() to handle spawnSync errors intentionally (check result.error + status) - Fix parity test: remove unused OUTPUT_DIR, fix inverted available check, eliminate double --version spawn with result caching - Fix changelog duplicate prepend: guard against repeated session.idle writes
Previous guard used version header match which was too aggressive — it would skip writes even when new commits changed the content between idle events. Now compares whether existing file body already starts with the full new content, allowing updates when content actually changes.
Co-authored-by: striderZA <striderZA@users.noreply.github.com>
…ore compare The previous guard only stripped # Changelog from existing but not from content, so the startsWith comparison never matched (content included '# Changelog\n\n' while existingBody started with '## [version]'). Now strips the header from both sides before comparing.
The workflow ran individual test files directly with node, but the tests import from .ts source files that require the tsx loader. Changed to use npm test which includes --import tsx.
Closes #81 - Add --pi flag to install.mjs targeting .agents/ instead of .opencode/ - Fix installed.json location to .agents/modules/ in Pi mode - Remove phantom pi.json references from README.md and AGENTS.md (actual Pi config is .pi/settings.json) - Fix ocgs-drift-detector REQUIRED_SECTIONS to parse YAML frontmatter instead of markdown headings - Skip MCP merge in Pi mode with warning (Pi manages MCP separately) Verified: 158 plugin tests pass, no pi.json references remain
PR Review: Fix Pi compatibility gapsCritical Issues Found1. PR description claims don't match the actual codeThe description lists 4 changes, but several are not reflected in the files on disk:
The actual YAML frontmatter implementation lives in 2.
|
| Severity | Count | Key Items |
|---|---|---|
| 🔴 Critical | 1 | PR description doesn't match code (4/4 claimed changes absent) |
| 🟡 Major | 3 | Drift detector doesn't parse YAML; missing command scan; --pi flag not implemented |
| 🟢 Minor | 5 | Undefined log prefix, CRLF edge case, quote stripping, unused shell:true, fragile section matching |
Verdict: CHANGE-SCOPE MISMATCH. The PR body describes changes that mostly don't exist in the code. The --pi flag for install.mjs, the frontmatter rewrite for the Pi drift detector, and the pi.json → .pi/settings.json fixes are all absent. 158 tests passing may reflect the current state, but the scope claimed by the PR is not delivered.
PR Review: Fix Pi compatibility gaps (#81)Claims vs RealityAll 4 claimed changes are present in the code on disk:
The automated review comment appears to have been based on a stale version of the branch. Bugs (2 found)1. 2. Code Quality Issues (4)3. 4. 5. 6. Positive Highlights
Summary
Verdict: APPROVED with minor fixes. The core functionality works (all 4 PR claims verified), tests pass, and the refactoring is solid. The 2 bugs and 4 style issues are small — the commands scan omission is the most impactful and should be addressed. |
- Add SAME and UPDATE to LOG_PREFIXES for consistency - Remove shell: true from spawnSync to avoid shell injection - Add command directory scan to drift detector - Add null guard for event.input in tool_result handler Fixes bugs identified in PR #84 review
PR Review: Fix Pi compatibility gaps (#81)Claims vs RealityAll 4 claimed changes are present and verified on disk:
(The two automated reviews above contradict each other — the first was based on a stale branch snapshot.) Issues Found1. /^---\n([\s\S]*?)\n---/ // OpenCode version — fails on Windows CRLF
/^---\r?\n([\s\S]*?)\r?\n---/ // Pi extension — correctThe Pi version handles 2. .replace(/^["']|["']$/g, '')
.replace(/^(["'])(.*)\1$/g, '$2')3. Dual git helper with different security profiles (
The 4. Unused import ( import { execSync, spawnSync } from "child_process"
5. Unnecessary /^# Changelog\n\n/mThe Strengths
Summary
Verdict: APPROVED with minor issues. All 4 claimed changes are delivered. The CRLF bug (item 1) is the most impactful — should be fixed to match the Pi extension's |



Closes #81
Changes
1. Module installer
--piflag--piflag to.opencode/modules/install.mjs--piis passed:MODULES_DIR→.agents/modules/,INSTALLED_PATH→.agents/modules/installed.json, install target →.agents/<subdir>/2.
pi.jsonphantom references fixedREADME.mdline 79:pi.json→.pi/settings.jsonREADME.mdline 185:pi.json→.pi/settings.jsonREADME.mdline 268:pi.json→.pi/directory referenceAGENTS.mdline 22:pi.json→.pi/directory reference3.
ocgs-drift-detectorREQUIRED_SECTIONS bug fixed["description"], skills →["name", "description"], commands →["name", "description", "skill"]parseFrontmatter()function that extracts key-value pairs from YAML4.
installed.jsonlocation mismatch fixedINSTALLED_PATHnow points to.agents/modules/installed.jsonin Pi mode,.opencode/modules/installed.jsonin OpenCode modeVerification
install.mjs listworks in both default and--pimodespi.jsonreferences remain in README.md or AGENTS.mdFiles changed (4)
.opencode/modules/install.mjs(+64/-99).pi/extensions/ocgs-drift-detector/index.ts(+175/-130)AGENTS.md(+2/-1)README.md(+6/-3)