You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hydrate workspace permission policy with the initial layout data so chat opens without a second access-loading screen.
Prefetch feature request state only for restricted workspaces, preserving existing retry, polling, and invalidation behavior.
Share one session-authorized policy read between the server and API; fail closed when entitlement lookup fails.
Record the affected module graphs after shared query-key extraction and conditional server discovery loading. The graph audit includes lazy imports; feature discovery returns before loading integration registries.
Type of Change
Bug fix
Testing
482 tests passed across permission policy, access requests, authorization, routes, and hydration (5 existing skips).
First-render tests cover allowed, restricted, pending, disabled, failed-read, retry, workspace-switch, and background invalidation states.
All eight cleanup passes completed; lint, all 46 audits, docs manifest, and all 26 workspace type checks passed.
The PR appears safe to merge. No new issue was found in the changes since the last review.
Summary
Workspace access data is now loaded on the server before chat renders, so allowed chat opens without a second access screen. Restricted workspaces also load request details only when needed, while the server and API share one policy read.
Hydrates access policy before the workspace renders.
Loads access-request discovery only for restricted workspaces.
Shares policy logic and query keys between server and client code.
Diagram
sequenceDiagram
participant Browser
participant Layout as Workspace layout
participant Policy as Permission policy
participant Requests as Access requests
participant Cache as Query cache
Browser->>Layout: Open workspace
Layout->>Policy: Read policy with session principal
Policy-->>Layout: Authorized workspace policy
Layout->>Cache: Seed policy query
alt A workspace feature is restricted
Layout->>Requests: Discover feature requests
Requests-->>Layout: Request state
Layout->>Cache: Seed discovery query
end
Layout-->>Browser: Render dehydrated workspace
Browser->>Cache: Read hydrated access state
alt Access is allowed
Cache-->>Browser: Show chat
else Access is restricted
Cache-->>Browser: Show access request state
else A server read failed
Cache-->>Browser: Keep chat closed and retry on client
end
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
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.
Summary
Type of Change
Testing
Checklist