fix(dashboard): chat profile scoping by rotating attach token on profile change - #62581
fix(dashboard): chat profile scoping by rotating attach token on profile change#62581iosub wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a dashboard chat regression where switching the selected management profile could still reattach to an existing keep-alive PTY that was spawned under the previous profile, by treating profile transitions as an attachment identity boundary and rotating the attach token accordingly.
Changes:
- Track profile transitions in
ChatPageto detect when the selected profile changes. - Rotate the PTY
attachtoken when either a forced-fresh session is requested or the selected profile changes. - Reset the profile-change flag after generating the attach token to preserve normal reconnect/reattach behavior when the profile is unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for isolating the attachment identity boundary. The normal profile-switch premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
Recheck unmounting after await buildWsUrl before opening the WebSocket, and add focused regression coverage for attach-token rotation and the deferred URL-build race called out in review.
|
Thanks for the review — both points addressed in f08c129:
|
|
Do I need to do something else? |
Summary
This PR fixes a dashboard chat regression where switching the selected profile could still reattach to a keep-alive PTY created under the previous profile.
Problem
The chat keep-alive attach token was rotated only for forced-fresh sessions. On profile switches without
fresh=1, the client could reattach to an old PTY and continue under stale profile scope.Root Cause
Profile transitions were not treated as attachment identity boundaries.
Changes
ChatPage.Impact
Testing
main.Risk
Low. Change is limited to token rotation decision logic in chat page attach parameter generation.