Repository navigation
Recheck waiting provider requests with the server after a daemon reconnect - #6252
Closed
timsuchanek wants to merge 2 commits into
Closed
timsuchanek wants to merge 2 commits into
timsuchanek wants to merge 2 commits into
Conversation
…nnect A daemon that reconnected as the same instance kept every provider wait open even when the server had settled the interaction while it was away. The provider stayed blocked on a question nobody could answer, and the turn accepted steers it could never read. On every session open the daemon now re-registers each provider request the server already acknowledged. A rejected or settled answer releases the provider with the server's reason, an open one keeps waiting, a recreated one adopts the new interaction id, and a failed request leaves the wait for the next reconnect.
… a reconnect A reconnect skipped waits that did not have an interaction id yet. If the server settled the interaction before the delayed first registration response arrived, nothing rechecked it. Such a wait is now flagged during the reconnect and rechecked as soon as its first registration finishes.
Contributor
|
Thanks for the pull request, @timsuchanek. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request. See CONTRIBUTING.md for details. |
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.
Human comments
What was wrong
A same-instance daemon reconnect never checked its open provider waits against the server. If the server settled an interaction while the daemon was away, the daemon's
InteractiveRequestRegistrykept the provider blocked forever. The turn stayedactiveand accepted steers it could never read (#6251). On 0.43.4 the 5 s disconnect timer did the settling. On main it happens when the liveinteractive.resolvecommand fails, for example withhost_unavailablewhen the socket closes mid-send:settleInteractiveResolveCommandResultInTransactioninterrupts the interaction, and the daemon is never told.What changed
apps/host-daemon/src/interactive-request-registry.ts: newrevalidateRegisteredRequests(). It re-posts every acknowledged provider wait to the existing/internal/session/interactive-requestroute, which is idempotent for open requests and returnsrejectedfor settled ones.rejected, or a settled status: the wait is rejected with the server's reason. The provider gets a JSON-RPC error, which the Claude bridge turns into adenyso the turn continues.onRevalidationFailure.registerAndWait(applyRegistrationResponse). It now ignores a response for an entry that the registry no longer holds.apps/host-daemon/src/app.ts:onSessionOpenedruns the recheck next toflushPendingInteractiveInterrupts(), and failed rechecks are logged.HOST_DAEMON_PROTOCOL_VERSIONbump: the change reuses an existing route without changing its fields or meaning. Servers on older versions benefit too.How you verified
onSessionOpenedcall. The in-flight registry test times out on the first commit of this branch.pnpm exec turbo run test --filter=@bb/host-daemon: 75 files, 823 passed, 12 skipped.pnpm exec turbo run typecheck --filter=@bb/host-daemon: passes.oxfmt --checkis clean on the changed files.bb thread stopand the messages re-sent.Fixes #6251