Scope AI Workspace project reloads to the selected organization
@Thushani-Jayasekera is already working on this.
Since Sep 16, 2026.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Summary
Update the AI Workspace organization switch flow so that a project reload uses the organization selected by the user.
Rationale
switchOrganization currently updates currentOrganization in the SPA and then reloads projects through GET /projects. The request continues to use the organization claim in the current session or token. A selected organization can therefore differ from the organization that scopes the project response.
Affected areas
portals/ai-workspace/src/contexts/AppShellContext.tsx- The AI Workspace organization token-exchange or server-side organization-context flow
- Project retrieval through
GET /projects
Required changes
Before reloading projects after an organization selection, update the server-side organization context or exchange the token so its organization claim matches the selected organization. Ensure that project requests use that updated context. Keep the existing protection that ignores results from superseded organization selections.
Acceptance criteria
- Selecting organization B after organization A updates the request context to organization B before
GET /projects. - The project response after the switch is scoped to organization B.
- A slower request from an earlier organization selection cannot overwrite the current project state.
- The switch flow has automated test coverage.
Backlinks
- Deferred from PR #3443: https://github.com/wso2/api-platform/pull/3443
- Review comment: https://github.com/wso2/api-platform/pull/3443#discussion_r4012888031
- Planned related work: PR #3398
- Requested by: @Thushani-Jayasekera
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.