Repository navigation
fix: preserve OpenCode watcher continuity failure diagnostics - #2
Merged
Merged
Conversation
…, drop duplicate publication
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.
Intent
Preserve OpenCode watcher outcome diagnostics: the fm-primary-watch-arm OpenCode plugin was dropping watcher outcome diagnostic details; keep them so watcher outcomes carry the diagnostics needed downstream.
What Changed
fm-primary-watch-armOpenCode plugin now publishes a durablecheck: OpenCode watcher continuity failurequeue row for every previously lost outcome detail: arm failures, undeliverable wake prompts, exhausted successor restorations, and plugin initialization failures (previously swallowed in empty catch blocks).FM_WATCH_DIAGNOSTIC_DEDUPE_MSwindow (default 300000): identical diagnostics publish one row per window, and stale markers are expired or swept on the next publication so recurring failures surface again.tests/fm-opencode-primary-watch-arm.test.shpinning the durable-diagnostic contract against the real plugin, and documented the new behavior and knob indocs/watcher-continuity.mdanddocs/configuration.md.Risk Assessment
✅ Low: The change is confined to failure-path diagnostic publication with dedupe bounded by a TTL, verified against the wake-queue library's field-sanitizing and locking contract, covered by behavioral tests, and matching its documented contract; no reachable defect could be constructed.
Testing
Drove the real fm-primary-watch-arm plugin through its OpenCode host contract against disposable fixture repos/homes: an undeliverable wake still persisted both the wake-failure and prompt-delivery-failure rows durably via the real fm-wake-lib.sh queue, a refused event stream persisted an initialization-failure row, an unrestorable successor persisted its retry-exhaustion detail, and an identical diagnostic republished only after its dedupe marker expired while the next publication swept other stale markers. The same suite run against the base-commit plugin reproduced the reported bug (no durable row at all). All drives were live against the real plugin module; a full real-OpenCode-CLI primary was not used because the failing OpenCode-side calls (prompt rejection, event-stream exception) cannot be induced deterministically inside a logged-in session without faking the host contract the plugin consumes, and the diff does not touch plugin loading.
bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode prompt failure publishes durable diagnostics' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode plugin initialization failure publishes a durable diagnostic' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode missing successor surfaces a durable terminal failure' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode dedupe marker expiry republishes an identical diagnostic' (target-plugin-pass.txt)Evidence: Target-commit suite run (four durable-diagnostic scenarios passing)
Source: Target-commit suite run (four durable-diagnostic scenarios passing)
Evidence: Regression reproduction against base-commit plugin (diagnostics dropped: 'missing durable prompt failure' with empty queue)
Source: Regression reproduction against base-commit plugin (diagnostics dropped: 'missing durable prompt failure' with empty queue)
Evidence: Live drive evidence: persisted .wake-queue rows and .opencode-watch-diagnostic-* marker files from the real plugin plus real fm-wake-lib.sh
Source: Live drive evidence: persisted .wake-queue rows and .opencode-watch-diagnostic-* marker files from the real plugin plus real fm-wake-lib.sh
--- durable wake queue rows persisted by real bin/fm-wake-lib.sh --- 1791408492 1 check opencode-watch:cc2850cc53d73c373cb31980 check: OpenCode watcher continuity failure: watcher: FAILED - OpenCode could not deliver an actionable wake Cannot read properties of undefined (reading 'prompt') 1791408492 2 check opencode-watch:2edbd265a0c9e762d74207b7 check: OpenCode watcher continuity failure: prompt delivery failed: Cannot read properties of undefined (reading 'prompt') --- dedupe marker files in state dir --- .opencode-watch-diagnostic-2edbd265a0c9e762d74207b7 .opencode-watch-diagnostic-cc2850cc53d73c373cb31980Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode prompt failure publishes durable diagnostics' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode plugin initialization failure publishes a durable diagnostic' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode missing successor surfaces a durable terminal failure' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shscenario 'OpenCode dedupe marker expiry republishes an identical diagnostic' (target-plugin-pass.txt)bash tests/fm-opencode-primary-watch-arm.test.shat target commit b4a8ea13 (all four scenarios pass)bash tests/fm-opencode-primary-watch-arm.test.shwith.opencode/plugins/fm-primary-watch-arm.jstemporarily reverted to base commit 687d414 (regression reproduced: 'missing durable prompt failure' with an empty wake queue), then restored withgit checkout --Bespoke live drive: real pluginsetup()in node with a fixture OpenCode host (session.promptAsync always rejecting), real fixture branch ofbin/fm-watch-arm.sh, realbin/fm-wake-lib.shappending into a disposable FM_HOME; dumped the persisted.wake-queuerows and.opencode-watch-diagnostic-*markers as reviewer-visible evidence✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.