fix: rebind remote permission handlers after session swap#1124
Closed
wang-kaopu wants to merge 1 commit intoslopus:mainfrom
Closed
fix: rebind remote permission handlers after session swap#1124wang-kaopu wants to merge 1 commit intoslopus:mainfrom
wang-kaopu wants to merge 1 commit intoslopus:mainfrom
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.
Closes #1123
Summary
This PR fixes a remote permission approval issue where tapping approve/deny
on iOS could stay stuck in a loading state after a session/client change.
The root cause was that Claude-side permission handling could remain bound
to an outdated session client after session swap, so permission responses no
longer matched the active pending request.
Changes
Session.clientupdatable in the Claude remote flowSession.updateClient()to sync the active API session clientPermissionHandler.updateSession()so thepermissionRPC handlercan be rebound after session changes
session events/state updates
session swap
Why this fixes the issue
Remote permission approvals depend on a session-scoped
permissionRPCchannel. After a session/client change, the old handler could still be
registered against the stale client, which meant iOS approval responses
would not resolve the active pending request.
By rebinding the permission handler and updating the active session client
reference, approval responses are routed back to the current session
correctly.
Validation
packages/happy-wirepackages/happy-clitypecheck successfullysrc/claude/utils/permissionHandler.test.tsNotes
In my local repro flow, this also resolved the similar approval-loading
symptom I was seeing with Codex, although this PR is focused on fixing the
Claude-side session swap gap directly.