fix(chat): scope troubleshoot handoff to its workspace#5344
Conversation
MothershipHandoffStorage now records the target workspaceId and only the matching workspace consumes (and clears) it; a different workspace leaves it untouched for its owner. Prevents a workspace-A handoff from firing in workspace B, where A's executionId can't resolve and the run context is dropped.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 59e881e. Configure here. |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 59e881e. Configure here.
Summary
MothershipHandoffStorage(the one-shot "Troubleshoot in Chat" handoff) used a single global localStorage key with no workspace scoping. If a workspace-A handoff was consumed by a different workspace's/homewithin the TTL (e.g. a navigation race, or a/chat/[id]mount skipping consume then landing on another workspace's new chat), the prompt auto-sent with workspace A'sexecutionId— which doesn't resolve in workspace B, so the logs context is dropped server-side and Sim can't see the failure.Fix
store(handoff, workspaceId)now records the targetworkspaceId.consume(workspaceId)only consumes (and clears) a handoff whoseworkspaceIdmatches; a handoff owned by a different workspace is left untouched for its owner rather than misfired. Legacy/corrupt entries (noworkspaceId) are still tombstoned so nothing lingers.workspaceIdtostore; the home surface passes itsworkspaceIdtoconsume.Type of Change
Testing
type-checkandbiomepass.Checklist