Repository navigation
feat(orgs) : OHE-3303 : expose is_visible on organization listings - #461
Merged
Merged
Conversation
Personal workspaces hidden by HIDE_PERSONAL_WORKSPACES are no longer skipped inconsistently per client. The org list now reports an is_visible flag per org so any client (enterprise web app, agent-canvas, future clients) can honour the deployment policy without re-deriving it. The org is only marked invisible, not dropped: it remains a real membership that can be switched to and addressed. Personal orgs stay visible when they are the user's only workspace, so a user is never left with nothing selectable.
tofarr
marked this pull request as ready for review
September 22, 2026 14:48
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
1 of 5 tasks
Contributor
|
🚀 Released in 1.63.0. |
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.
HUMAN:
AGENT:
Why
HIDE_PERSONAL_WORKSPACESis a presentation policy today, but each client re-derives it — and they disagree.The backend never filters personal orgs out of
GET /api/organizations.OrgResponse.is_personalis computed fromstr(org.id) == user_id, and the only three reads of the env var are the web-client config injector, the model, and the default-org bootstrap. So the list endpoint advertises personal workspaces to every caller.The enterprise web app filters them client-side in
use-organizations.ts. Agent Canvas (OpenHands/OpenHands) does not: itsuseAllCloudOrganizationsreturns the unfiltered list incookiemode and deliberately renders a personal row, then builds/settings?org=<personal>links. Because Canvas'sOptionService.getConfig()is a hardcoded stub ({ hide_llm_settings, hide_users_page }) and never fetches/api/v1/web-client/config, it cannot seehide_personal_workspacesand cannot filter even if it wanted to.The result is a deep link that the cloud silently accepts, strips, and ignores — no switch, no feedback. This change gives every client one server-provided answer instead of each one guessing.
Summary
is_visible: bool = TruetoOrgResponse, threaded throughfrom_org(...)as a new parameter that defaults toTrue, so switch/get/create callers are unaffected.list_user_orgs: an org is invisible whenHIDE_PERSONAL_WORKSPACESis on and the user has at least one team org. The personal org stays visible when it is the user's only workspace, preserving the existing zero-org guard.is_visiblefield to the frontendOrganizationtype.Issue Number
N/A — no tracking issue.
How to Test
The new tests run in CI (the suite needs Docker/Postgres):
uv run pytest tests/unit/server/routes/test_orgs.py -k "is_visible or hides_personal or stays_visible or flag_disabled" -qDocker is not usable in my sandbox, so I could not run the DB-backed suite: the root
conftest.pyunconditionally starts a Postgres testcontainer. My tests are DB-free (they patchOrgService.get_user_orgs_paginatedand buildOrgobjects in memory), so I exercised the real handler directly viaTestClientand confirmed all three scenarios:is_visible=False, teamis_visible=Trueis_visible=True(never zero selectable workspaces)is_visible=TruePre-commit (ruff, ruff-format, mypy) passes on all changed backend files;
npm run lint:fixandnpm run buildpass on the frontend.Video/Screenshots
N/A — API-only change, no UI behavior changes in this PR.
use-organizations.tskeeps its existing client-side filter, so this is a pure capability addition with no behavior change for the enterprise web app.Type
Notes
GET /api/organizations/{id}for, so marking rather than dropping avoids a new "invisible but addressable" contract and does not strand existing members parked on a personal org.get_default_org_config().hide_personal_workspaces, which accepts1/true/yes/on. Note the web-client injector still uses== 'true', soHIDE_PERSONAL_WORKSPACES=1currently exposes the flag to the frontend but is not treated as enabled indefault_org_service. Pre-existing divergence, left out of scope.?org=deep link to a hidden personal org is still a silent no-op infrontend/src/utils/org/org-url-param.ts— it returns "handled" without switching and with no feedback. (2) Canvas must readis_visible(and skip invisible orgs when building?org=links) to benefit; that change is in theOpenHands/OpenHandsrepo.@tofarr can click here to continue refining the PR
Enterprise server image for this PR: