Repository navigation
Report through sidepulse report, and test against real OpenCode and SidePulse versions - #5
Merged
Merged
Conversation
Upstream moved session state into a background service. The app's events.sock still accepts a connection but now ignores hook events, so app mode reported success while the device showed nothing, and direct mode never took over. App mode now pipes a program-status report to `sidepulse report --json`, the documented input of the service. The command's exit code selects the mode: a missing CLI or a stopped service falls back to direct mode, which is unchanged. - Report a session only when its state changes, so tool calls start no process. - Track the open prompt per session, so a prompt in one session cannot mark another as blocked. - Send reports one at a time, and flush the queue when opencode exits, so a late "working" cannot overtake "done". - Make `--send` exercise the new transport. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu
The service never expires a Working or Waiting status, so a session still in one of those states when opencode exits stayed lit forever. Clear those sessions in the exit flush. Done and error stay. In direct mode with the CLI installed, every tool call started a process when the device was not mounted. Remember the state the service declined and only ask again when the state changes. Also keep a throwing report from stalling the queue. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu
Two bugs found by running the plugin in real OpenCode releases. OpenCode 1 sends session.idle after session.error. The idle painted a failed turn green in both modes. An idle that follows an error in the same session is now ignored. Measured on 1.19.5. At exit the report in flight was left to its detached process when nothing was queued behind it. Bun drops the body of a report written in the same tick as the exit, so that report could be lost. The exit hook now always sends the report in flight again. The service applies the repeated request_id once. Also add two small seams for the tests: SIDEPULSE_VOLUMES for the device folder and SIDEPULSE_REPORT_TIMEOUT_MS for the CLI timeout. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu
Four layers, none with a dependency to install. - test/run.mjs drives the real plugin through fake OpenCode hooks, one process per test, with a fake sidepulse CLI and a folder as the device. 64 tests cover both modes, the handover, ordering, exit, and event traces recorded from OpenCode 1.19.5, 2.1.2 and 2.3.0. - test/service.mjs runs the plugin against a real SidePulse service and reads back what it shows. - test/opencode.mjs runs real turns in a real OpenCode on a free model, which needs no account. - Stryker mutation testing over the plugin, failing below 85% caught. compat.yml runs the middle two against pinned SidePulse commits and OpenCode releases, plus SidePulse main and the latest OpenCode, on every pull request and every Monday. It also runs the suite under Bun. mutation.yml runs when the plugin or its tests change. npm test now runs the suite as well, so it gates the release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu
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.
Why
Upstream SidePulse moved session state into a background service on 10 November 2026. The menu-bar app's
events.sockstill accepts a connection, but it now ignores everything except "open settings". App mode therefore reported success while the device showed nothing, and direct mode never took over because the socket answered.What changes in the plugin
App mode now pipes one program-status report to
sidepulse report --json, the documented input of the service. The command's exit code selects the mode. A missing CLI or a stopped service falls back to direct mode, which is unchanged.opencode runstill ends on Completed. A repeated report keeps itsrequest_id, which the service applies only once.$SIDEPULSE_BIN, then~/.local/bin/sidepulse, thenPATH.node plugin.mjs --sendsends a harmlessclearthrough the real transport and exits 1 if the service does not accept it.Two bugs found by the new tests, both fixed here
session.idleaftersession.error, and the idle painted over the error in both modes. An idle that follows an error in the same session is now ignored. Measured on 1.19.5. This bug predates this pull request.Tests
Four layers. None has a dependency to install.
test/run.mjssidepulseCLI and a folder as the device. 64 tests cover both modes, the handover, ordering, exit, and event traces recorded from OpenCode 1.19.5, 2.1.2 and 2.3.0.test/service.mjstest/opencode.mjsnpm testnow runs the self-check andtest/run.mjs, so the first layer gates the release.compat.ymlruns on every pull request, onmain, and every Monday:sidepulse report, the first commit with it, a later one, andmainmutation.ymlruns when the plugin or its tests change. It takes about ten minutes.Things to know before merging
package.jsongoes from 0.2.0 to 0.3.0, and CI publishes to npm when that reachesmain.sidepulse report, so the plugin uses direct mode beside it, with two writers on the device. The README says to update SidePulse or pinopencode-sidepulse@0.2.0. A CI job pins this fallback.SIDEPULSE_VOLUMESandSIDEPULSE_REPORT_TIMEOUT_MS.Not tested: on macOS, or with a real device.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu