Repository navigation
fix(opencode): harden the server-half session reporter - #444
Merged
amirlehmam merged 1 commit intoNov 7, 2026
Merged
amirlehmam merged 1 commit into
amirlehmam merged 1 commit into
Conversation
A shared server cannot attribute any pane-specific signal: WMUX_SURFACE_ID names only the pane that started it. The server half now returns a no-op for --service and any serve without --stdio; a standalone TUI's private serve --stdio still reports. v2 session handles move to the TUI half, which knows the viewed session, so the two halves can no longer race over the same handle. report-session is success-aware: 1s/3s/10s retries, accepted:false as a permanent rejection, an increasing --seq so a late report cannot overwrite a newer one, a 30s reassert on later turns, and a 10s CLI timeout. A dispose/reload waits 1.5s for a replacement instance to cancel the release; a real exit still releases synchronously. Marker 9 -> 10, docs and tests. Verified live with an isolated standalone server: the plugin loaded as private, left v2 handles to the TUI half, and its activity/prompt calls reached wmux. Targeted suite 73 passed; full WSL suite 6292 passed, 42 known Windows-path/platform failures (none in the changed suite).
Owner
|
Merged, thank you! The shared-server detection (any |
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.
Problem
The server-side OpenCode plugin (
~/.config/opencode/plugin/wmux.js) had the same fire-and-forget session report as the TUI half, plus two attribution bugs:--servicewhen deciding a server was shared. A plainopencode serve --port …also hosts many panes, whileWMUX_SURFACE_IDnames only the pane that started it — so activity, blocked state, prompts and shell env from every pane landed on one pane.It also released the handle on v2
dispose, which runs on plugin reload as well as shutdown.Fix
--service, and anyservewithout--stdio, returns a no-op. A standalone TUI's privateserve --stdiostill reports.accepted: falsetreated as permanent, an increasing--seqso a late report for an old session cannot win, a 30 s reassert on later turns, and a 10 s CLI timeout.wmuxreinstalls it; docs and tests updated.Verification
opencode --standalone: the plugin loaded as private, loggedsession: handles are reported by the TUI half, and its realagent-activity/hookcalls reached wmux. A privateserve --stdiois not mistaken for shared.resolveNodeRuntimeon Linux).npm run typecheck: clean.Scope
This is PR A of two. PR B will add a bounded transport retry for idempotent report commands in the CLI, so a busy named pipe is handled for every producer, not only OpenCode.