Repository navigation
fix(opencode): retry a TUI session report that never landed - #443
Merged
amirlehmam merged 2 commits intoNov 6, 2026
Merged
amirlehmam merged 2 commits into
amirlehmam merged 2 commits into
Conversation
The named pipe can answer "All pipe instances are busy" during a restore burst. The TUI reporter set its dedupe handle before the CLI call resolved, so a failed report-session was never retried: the pane showed in the sidebar without a restore handle and every later observe() of the same id was a no-op. Pass the CLI failure through callWmux, retry it at 1 s / 3 s / 10 s, and reassert the held handle when a hosted execution starts (throttled to once per 30 s) so a handle main dropped after a successful report also heals on the next run. Bump the TUI marker to 6. Verified live: a report-session failed with "All pipe instances are busy", retried after 1 s, and succeeded; the fake surface kept its session id. Targeted suites 98 passed; typecheck clean. Full WSL suite: 6283 passed, 42 known Windows-path/platform failures (none in the changed suites).
The TUI passed the viewed session to reassert, but the reporter holds the root: while the user looked at a subagent the two never matched and the handle never healed. Reassert now takes the event's root. A reassert during an in-flight report sent a second concurrent call, and a late failure from the older one could undo the newer confirmation and start another retry chain. Only the newest call settles state now, and reassert waits while a call or a retry is pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
With several OpenCode panes open, wmux's sidebar can show fewer session rows than the panes that are actually running — and on restore, a pane can come back without its session handle.
The TUI-side plugin reports the viewed session with
wmux report-session <id> --provider opencode --surface <id>. Under a burst, wmux's named pipe can answer:The old reporter set
last = idbefore the CLI call resolved, so a failed report was treated as already sent. Every laterobserve()of the same session was deduped away, and the pane silently lost its restore handle for the rest of its life.Fix
callWmuxnow passes the CLI result to its completion callback (nullon success, the failure otherwise).createSessionReporterretries a report that never landed at 1 s, 3 s and 10 s, cancelling the retry when the view moves to another session.session.execution.startedreasserts the held handle, throttled to once per 30 s, so a handle main dropped after a successful report heals on the next turn instead of waiting for a tab switch.wmux opencode-tuireinstalls the pair.The reassert is deliberately narrow: it only repeats the session this TUI is viewing, so a background session cannot overwrite the tab's restore handle.
Verification
WMUX_PLUGIN_DEBUG:report-sessionfailed with All pipe instances are busy, retried after 1 s, succeeded, and the surface kept its session id.npm run typecheck: clean.Files
resources/opencode-plugin/wmux-tui-core.jsresources/opencode-plugin/wmux-tui.jstests/unit/opencode-tui-core.test.tstests/unit/opencode-tui-install.test.tsdocs/opencode-plugin.md