Skip to content

Report through sidepulse report, and test against real OpenCode and SidePulse versions - #5

Merged
benkelly merged 4 commits into
mainfrom
claude/admiring-dijkstra-6we38d
Nov 13, 2026
Merged

benkelly merged 4 commits into
mainfrom
claude/admiring-dijkstra-6we38d

Conversation

@benkelly

@benkelly benkelly commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Why

Upstream SidePulse moved session state into a background service on 10 November 2026. The menu-bar app's events.sock still 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.

  • State changes only. A session is reported when its state changes, so tool calls start no process. The menu no longer names the running tool. Upstream draws a running tool the same as Working.
  • Per-session prompts. The open prompt is tracked per session for app mode, so a prompt in one session cannot mark another as blocked. Direct mode keeps its single global flag.
  • Ordered delivery. Reports go out one at a time. Anything queued or in flight when opencode exits is sent synchronously, so opencode run still ends on Completed. A repeated report keeps its request_id, which the service applies only once.
  • Clear on exit. A session still working or waiting when opencode exits is cleared, because the service never expires those states. Done and error stay.
  • Hooks do not wait. A report is queued and the hook returns.
  • CLI lookup. $SIDEPULSE_BIN, then ~/.local/bin/sidepulse, then PATH.
  • Self-check. node plugin.mjs --send sends a harmless clear through the real transport and exits 1 if the service does not accept it.

Two bugs found by the new tests, both fixed here

  • A failed turn went green on OpenCode 1. OpenCode 1 sends session.idle after session.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.
  • A report could be lost at exit under Bun. Bun drops the body of a report written in the same tick as the exit. The exit hook now always sends the report in flight again.

Tests

Four layers. None has a dependency to install.

Layer What it runs against
test/run.mjs The real plugin, driven through fake OpenCode hooks in 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 A real SidePulse install. It starts the real service and reads back what it shows.
test/opencode.mjs A real OpenCode. It runs real turns on one of OpenCode's free models, which need no account, so CI holds no secrets.
Stryker Mutation testing over the plugin. The run fails below 85% caught.

npm test now runs the self-check and test/run.mjs, so the first layer gates the release.

compat.yml runs on every pull request, on main, and every Monday:

Program Versions
SidePulse The commit before sidepulse report, the first commit with it, a later one, and main
OpenCode 1 1.18.0 and 1.19.5
OpenCode 2 2.1.2, 2.3.0 and the latest release
Bun The regression suite

mutation.yml runs when the plugin or its tests change. It takes about ten minutes.

Things to know before merging

  • This releases 0.3.0. package.json goes from 0.2.0 to 0.3.0, and CI publishes to npm when that reaches main.
  • Older SidePulse apps. The old socket transport is removed. An app from before 10 November has no sidepulse report, so the plugin uses direct mode beside it, with two writers on the device. The README says to update SidePulse or pin opencode-sidepulse@0.2.0. A CI job pins this fallback.
  • Cancelled turns still report as Completed, as before.
  • Killed processes. If opencode is killed mid-turn, the exit hook does not run and the session stays Working in the menu until the service restarts. Listed under known limits.
  • The live OpenCode jobs depend on OpenCode's free models. If those are withdrawn the jobs go red. They do not gate the release.
  • OpenCode releases older than 1.18.0 cannot use the free models, so CI cannot run a turn in them.
  • Two environment variables are new, both for the tests: SIDEPULSE_VOLUMES and SIDEPULSE_REPORT_TIMEOUT_MS.

Not tested: on macOS, or with a real device.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XjLjceBHLiETchuMNpQSEu

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
Copilot AI balanced review requested due to automatic review settings November 13, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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
Copilot AI balanced review requested due to automatic review settings November 13, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@benkelly benkelly changed the title Report to the SidePulse service through sidepulse report Report through sidepulse report, and test against real OpenCode and SidePulse versions Nov 13, 2026
@benkelly
benkelly merged commit 594439f into main Nov 13, 2026
13 checks passed
@benkelly
benkelly deleted the claude/admiring-dijkstra-6we38d branch November 13, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants