Repository navigation
fix(rpc): gc keeps a Windows endpoint whose socket secret cannot be read - #4293
Open
code-yeongyu wants to merge 6 commits into
Open
code-yeongyu wants to merge 6 commits into
code-yeongyu wants to merge 6 commits into
Conversation
On win32 the pipe name derives from the socket secret. gc's socket probe read a missing or invalid secret as socket_absent, proof that nothing listens, and removed the endpoint even though a live host may still serve the pipe under the key whose file was lost. The probe now reports credential_unavailable and gc keeps the endpoint. Part of sisyphuslabs/omo-desktop-app#4199
code-yeongyu
marked this pull request as ready for review
October 26, 2026 00:17
This branch has not been deployed
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.
Part of a desktop issue (tracked internally) (senpi PR S3 in the approved #4199 design's plan; design test 7, lifecycle half).
Summary
senpi host gc(and the budgeted passensureHostschedules) no longer removes a Windows endpoint whose socket secret is missing, empty, short or long. Such an endpoint is kept with the new reasoncredential_unavailable.Root cause
packages/coding-agent/src/modes/rpc/host-gc-evidence.ts:104-110: on win32 the pipe name is derived from the socket secret.socketSilencecaught a failed or invalid secret read and returnedsocket_absent, the same verdict as a pipe that is provably gone, so the third part of gc's evidence passed and the endpoint directory was deleted. A failed credential read says nothing about whether a host still serves the pipe under the key whose file was lost; the approved design requires credential failure to stay unknown and never authorize teardown.Fix
socketSilencereturnscredential_unavailablewhen the win32 secret cannot be read or has the wrong length;endpointInUsereports it for the public socket and for every.next-*successor bind, andgcEndpointkeeps the endpoint without running the stale-engine judgement (that judgement needs the same secret). A valid secret behaves as before, so normal dead-endpoint cleanup is unchanged.docs/rpc.mdand thehost-gc.tsreason table list the new reason.RED
bun run --cwd packages/coding-agent test test/suite/regressions/desktop-4199-gc-keeps-endpoint-without-secret.test.tson the unchanged code, all four cases (missing, empty, short, long):GREEN
The new regression plus
test/rpc-host-gc-evidence.test.tsandtest/documentation.test.tspass. The real-host cases intest/rpc-host-gc.test.tsneed the workspace build (their spawned host imports@earendil-works/pi-ai/dist), so they ran in CI rather than in this unbuilt checkout.Windows coverage
The changed branch runs only on win32; the regression simulates the platform the way the #1370 regression does. Native receipts 27 and 28 of the design are not part of this PR.
Risks
A Windows endpoint that really is dead but lost its secret file now stays on disk until its secret is restored or the user removes it; that is the design's choice (no deletion from a broken credential read).
Gates (exact head fae8ce6)
Gated push:
bun run checkrc=0; the new regression,test/rpc-host-gc-evidence.test.tsandtest/documentation.test.tsrc=0;node scripts/check-pr-changelog.mjs --base origin/mainrc=0.QA
The changed branch runs only on win32, so a real-CLI
senpi-qarun on macOS cannot reach it; none was run. The simulated-platform regression and CI's Windows jobs are the evidence.