Repository navigation
fix(host-daemon): retry provider probes after invalidation - #2381
Merged
Merged
Conversation
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.
What was wrong
A shell-environment refresh could clear the provider-installation gate and shut down its maintenance runtime while real thread starts were awaiting a shared provider status probe. The gate correctly avoided caching the stale result, but it still returned the interrupted promise to existing callers, so every concurrent
thread.startsharing that probe became a permanent error thread. See #2380 and the investigation thread.What changed
The provider-installation gate now treats a generation change as an instruction to join or start the probe for the current generation. This applies to both stale successful answers and rejected maintenance RPCs, while stable provider errors and unsupported-version results retain their existing behavior. Added focused gate coverage plus a command-dispatch regression with two concurrent thread starts interrupted by
replaceBaseShellEnv.There are no host/server wire changes, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
Runtime shutting downbefore the fix and passes after it.pnpm exec turbo run test --filter=@bb/host-daemon -- --run src/provider-installation-gate.test.ts src/command-dispatch.test.ts— 52 passed.pnpm exec turbo run test --filter=@bb/host-daemon --force— 557 passed.pnpm exec turbo run typecheck --filter=@bb/host-daemon— passed.pnpm exec turbo run build --filter=@bb/host-daemon— passed.git diff --check— passed.Fixes #2380