Repository navigation
fix(cli): retry idempotent reports when the pipe is busy - #445
Merged
Merged
Conversation
The named pipe answers "All pipe instances are busy" during a restore burst, and npiperelay reports that on stderr before exiting. The OpenCode plugins now retry their own session reports, but report-agent, hook and release calls from other producers could still lose their one attempt. Extract the Codex launcher's patience policy into transport-retry.ts, fold npiperelay's stderr into the error so the busy case is recognisable, and use a short retry for the idempotent report verbs only: report-session, report-agent, report-metadata, report-subagent, release-agent and prompt admission. A spawn or a typed key never takes that path, so a retry cannot duplicate real work. The new module ships with the CLI in extraResources. Verified against the shipped resources/cli/wmux.js with a socket that drops the first connection: the report retried and landed. Targeted suites 90 passed; full WSL suite 6285 passed, 42 known Windows-path/platform failures (none in the changed suites).
A Unix socket path in the temp dir fails with EACCES on Windows, which is where the release CI runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amirlehmam
force-pushed
the
fix/cli-report-retry
branch
from
November 7, 2026 01:09
a09626a to
03098c6
Compare
Owner
|
Merged, thanks! Two things I did on your branch before merging:
I also checked that a replayed |
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
During a restore burst, wmux's named pipe can answer:
On WSL, npiperelay writes that to stderr and exits before attaching. The OpenCode plugins now retry their own session reports, but every other one-shot producer (
report-agent,hook,release-agent) could still lose its only attempt.Fix
src/cli/transport-retry.ts.report-session,report-agent,report-metadata,report-subagent,release-agent, and prompt admission (hook).transport-retry.jswith the CLI inextraResources; the resource copies are rebuilt andverify-resourcespasses.The retry budget is deliberately short (4 s for reports, 1.5 s for prompt admission). A successful reply resolves immediately; only a request that never produced a response is asked again.
Verification
resources/cli/wmux.jsagainst a socket that drops the first connection: the report retries, lands on the second, and exits 0.npm run typecheck, changed-file lint, andverify-resources: clean.Scope
This is PR B. PR A (server-half hardening) is #444; the TUI-half retry is #443. Together they cover the TUI half, the server half, and the CLI transport.